本文整理汇总了Java中com.google.ipc.invalidation.external.client.SystemResources.getNetwork方法的典型用法代码示例。如果您正苦于以下问题:Java SystemResources.getNetwork方法的具体用法?Java SystemResources.getNetwork怎么用?Java SystemResources.getNetwork使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.ipc.invalidation.external.client.SystemResources
的用法示例。
在下文中一共展示了SystemResources.getNetwork方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ProtocolHandler
import com.google.ipc.invalidation.external.client.SystemResources; //导入方法依赖的package包/类
/**
* Creates an instance.
*
* @param config configuration for the client
* @param resources resources to use
* @param smearer a smearer to randomize delays
* @param statistics track information about messages sent/received, etc
* @param applicationName name of the application using the library (for debugging/monitoring)
* @param listener callback for protocol events
*/
ProtocolHandler(ProtocolHandlerConfigP config, final SystemResources resources,
Smearer smearer, Statistics statistics, int clientType, String applicationName,
ProtocolListener listener, ProtocolHandlerState marshalledState) {
this.logger = resources.getLogger();
this.statistics = statistics;
this.internalScheduler = resources.getInternalScheduler();
this.network = resources.getNetwork();
this.listener = listener;
this.clientVersion = CommonProtos.newClientVersion(resources.getPlatform(), "Java",
applicationName);
this.clientType = clientType;
if (marshalledState == null) {
// If there is no marshalled state, construct a clean batcher.
this.batcher = new Batcher(resources, statistics);
} else {
// Otherwise, restore the batcher from the marshalled state.
this.batcher = new Batcher(resources, statistics, marshalledState.getBatcherState());
this.messageId = marshalledState.getMessageId();
this.lastKnownServerTimeMs = marshalledState.getLastKnownServerTimeMs();
this.nextMessageSendTimeMs = marshalledState.getNextMessageSendTimeMs();
}
logger.info("Created protocol handler for application %s, platform %s", applicationName,
resources.getPlatform());
}
示例2: ProtocolHandler
import com.google.ipc.invalidation.external.client.SystemResources; //导入方法依赖的package包/类
/**
* Creates an instance.
*
* @param config configuration for the client
* @param resources resources to use
* @param smearer a smearer to randomize delays
* @param statistics track information about messages sent/received, etc
* @param applicationName name of the application using the library (for debugging/monitoring)
* @param listener callback for protocol events
*/
ProtocolHandler(ProtocolHandlerConfigP config, final SystemResources resources,
Smearer smearer, Statistics statistics, int clientType, String applicationName,
ProtocolListener listener, TiclMessageValidator2 msgValidator,
ProtocolHandlerState marshalledState) {
this.logger = resources.getLogger();
this.statistics = statistics;
this.internalScheduler = resources.getInternalScheduler();
this.network = resources.getNetwork();
this.listener = listener;
this.msgValidator = msgValidator;
this.clientVersion = CommonProtos2.newClientVersion(resources.getPlatform(), "Java",
applicationName);
this.clientType = clientType;
if (marshalledState == null) {
// If there is no marshalled state, construct a clean batcher.
this.batcher = new Batcher(resources, statistics);
} else {
// Otherwise, restore the batcher from the marshalled state.
this.batcher = new Batcher(resources, statistics, marshalledState.getBatcherState());
this.messageId = marshalledState.getMessageId();
this.lastKnownServerTimeMs = marshalledState.getLastKnownServerTimeMs();
this.nextMessageSendTimeMs = marshalledState.getNextMessageSendTimeMs();
}
logger.info("Created protocol handler for application %s, platform %s", applicationName,
resources.getPlatform());
}