• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RegistrationManagerStateP类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.google.protos.ipc.invalidation.JavaClient.RegistrationManagerStateP的典型用法代码示例。如果您正苦于以下问题:Java RegistrationManagerStateP类的具体用法?Java RegistrationManagerStateP怎么用?Java RegistrationManagerStateP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

RegistrationManagerStateP类属于com.google.protos.ipc.invalidation.JavaClient包,在下文中一共展示了RegistrationManagerStateP类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: RegistrationManager

点赞 3

import com.google.protos.ipc.invalidation.JavaClient.RegistrationManagerStateP; //导入依赖的package包/类
public RegistrationManager(Logger logger, Statistics statistics, DigestFunction digestFn,
    RegistrationManagerStateP registrationManagerState) {
  this.logger = logger;
  this.statistics = statistics;
  this.desiredRegistrations = new SimpleRegistrationStore(digestFn);

  if (registrationManagerState == null) {
    // Initialize the server summary with a 0 size and the digest corresponding
    // to it.  Using defaultInstance would wrong since the server digest will
    // not match unnecessarily and result in an info message being sent.
    this.lastKnownServerSummary = ProtoWrapper.of(getRegistrationSummary());
  } else {
    this.lastKnownServerSummary =
      ProtoWrapper.of(registrationManagerState.getLastKnownServerSummary());
    desiredRegistrations.add(registrationManagerState.getRegistrationsList());
    for (RegistrationP regOp : registrationManagerState.getPendingOperationsList()) {
      pendingOperations.put(ProtoWrapper.of(regOp.getObjectId()), regOp.getOpType());
    }
  }
}
 

开发者ID:morristech,
项目名称:android-chromium,
代码行数:21,
代码来源:RegistrationManager.java

示例2: InvalidationClientCore

点赞 2

import com.google.protos.ipc.invalidation.JavaClient.RegistrationManagerStateP; //导入依赖的package包/类
/**
 * Constructs a client.
 *
 * @param resources resources to use during execution
 * @param random a random number generator
 * @param clientType client type code
 * @param clientName application identifier for the client
 * @param config configuration for the client
 * @param applicationName name of the application using the library (for debugging/monitoring)
 * @param regManagerState marshalled registration manager state, if any
 * @param protocolHandlerState marshalled protocol handler state, if any
 * @param listener application callback
 */
private InvalidationClientCore(final SystemResources resources, Random random, int clientType,
    final byte[] clientName, ClientConfigP config, String applicationName,
    RunStateP ticlRunState,
    RegistrationManagerStateP regManagerState,
    ProtocolHandlerState protocolHandlerState,
    StatisticsState statisticsState,
    InvalidationListener listener) {
  this.resources = Preconditions.checkNotNull(resources);
  this.random = random;
  this.logger = Preconditions.checkNotNull(resources.getLogger());
  this.internalScheduler = resources.getInternalScheduler();
  this.storage = resources.getStorage();
  this.config = config;
  this.ticlState = (ticlRunState == null) ? new RunState() : new RunState(ticlRunState);
  this.smearer = new Smearer(random, this.config.getSmearPercent());
  this.applicationClientId =
      CommonProtos2.newApplicationClientIdP(clientType, ByteString.copyFrom(clientName));
  this.listener = listener;
  this.msgValidator = new TiclMessageValidator2(resources.getLogger());
  this.statistics = (statisticsState != null) ?
      Statistics.deserializeStatistics(resources.getLogger(), statisticsState.getCounterList()) :
      new Statistics();
  this.registrationManager = new RegistrationManager(logger, statistics, digestFn,
      regManagerState);
  this.protocolHandler = new ProtocolHandler(config.getProtocolHandlerConfig(), resources,
      smearer, statistics, clientType, applicationName, this, msgValidator, protocolHandlerState);
}
 

开发者ID:morristech,
项目名称:android-chromium,
代码行数:41,
代码来源:InvalidationClientCore.java

示例3: marshal

点赞 2

import com.google.protos.ipc.invalidation.JavaClient.RegistrationManagerStateP; //导入依赖的package包/类
@Override
public RegistrationManagerStateP marshal() {
  RegistrationManagerStateP.Builder builder = RegistrationManagerStateP.newBuilder();
  builder.setLastKnownServerSummary(lastKnownServerSummary.getProto());
  builder.addAllRegistrations(desiredRegistrations.getElements(EMPTY_PREFIX, 0));
  for (Map.Entry<ProtoWrapper<ObjectIdP>, RegistrationP.OpType> pendingOp :
      pendingOperations.entrySet()) {
    ObjectIdP objectId = pendingOp.getKey().getProto();
    boolean isReg = pendingOp.getValue() == OpType.REGISTER;
    builder.addPendingOperations(CommonProtos2.newRegistrationP(objectId, isReg));
  }
  return builder.build();
}
 

开发者ID:morristech,
项目名称:android-chromium,
代码行数:14,
代码来源:RegistrationManager.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)