当前位置: 首页>>代码示例>>Java>>正文


Java InvalidationClient类代码示例

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


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

示例1: createClient

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
/**
 * Creates a new InvalidationClient instance that the proxy will delegate requests to and listen
 * for events from.
 */
// Overridden by tests to inject mock clients or for listener interception

InvalidationClient createClient(SystemResources resources, int clientType, byte[] clientName,
    String applicationName, InvalidationListener listener, ClientConfigP config) {
  // We always use C2DM, so set the channel-supports-offline-delivery bit on our config.
  final ClientConfigP.Builder configBuilder;
  if (config == null) {
    configBuilder = InvalidationClientCore.createConfig();
  } else {
    configBuilder = ClientConfigP.newBuilder(config);
  }
  configBuilder.setChannelSupportsOfflineDelivery(true);
  config = configBuilder.build();
  Random random = new Random(resources.getInternalScheduler().getCurrentTimeMs());
  return new InvalidationClientImpl(resources, random, clientType, clientName, config,
      applicationName, listener);
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:22,代码来源:AndroidClientProxy.java

示例2: invalidate

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void invalidate(InvalidationClient client, Invalidation invalidation,
    AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateIntent(
        ProtoWrapperConverter.convertToInvalidationProto(invalidation), ackHandleP));
  } catch (ValidationException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidate", ackHandle);
  }
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:13,代码来源:AndroidInvalidationClientImpl.java

示例3: invalidateUnknownVersion

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void invalidateUnknownVersion(InvalidationClient client, ObjectId objectId,
    AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateUnknownIntent(
        ProtoWrapperConverter.convertToObjectIdProto(objectId), ackHandleP));
  } catch (ValidationException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateUnknownVersion", ackHandle);
  }
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:13,代码来源:AndroidInvalidationClientImpl.java

示例4: invalidateAll

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void invalidateAll(InvalidationClient client, AckHandle ackHandle) {
  try {
    AckHandleP ackHandleP = AckHandleP.parseFrom(ackHandle.getHandleData());
    issueIntent(context, ListenerUpcalls.newInvalidateAllIntent(ackHandleP));
  } catch (ValidationException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateAll", ackHandle);
  }
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:11,代码来源:AndroidInvalidationClientImpl.java

示例5: informRegistrationStatus

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void informRegistrationStatus(
    InvalidationClient client, ObjectId objectId, RegistrationState regState) {
  Intent intent = ListenerUpcalls.newRegistrationStatusIntent(
      ProtoWrapperConverter.convertToObjectIdProto(objectId),
      regState == RegistrationState.REGISTERED);
  issueIntent(context, intent);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:9,代码来源:AndroidInvalidationClientImpl.java

示例6: invalidate

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void invalidate(final InvalidationClient client, final Invalidation invalidation,
    final AckHandle ackHandle) {
  Preconditions.checkState(internalScheduler.isRunningOnThread(), "Not on internal thread");
  Preconditions.checkNotNull(ackHandle);
  listenerScheduler.schedule(NO_DELAY, new NamedRunnable("CheckingInvalListener.invalidate") {
    @Override
    public void run() {
      statistics.recordListenerEvent(ListenerEventType.INVALIDATE);
      delegate.invalidate(client, invalidation, ackHandle);
    }
  });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:14,代码来源:CheckingInvalidationListener.java

示例7: invalidateUnknownVersion

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void invalidateUnknownVersion(final InvalidationClient client, final ObjectId objectId,
    final AckHandle ackHandle) {
  Preconditions.checkState(internalScheduler.isRunningOnThread(), "Not on internal thread");
  Preconditions.checkNotNull(ackHandle);
  listenerScheduler.schedule(NO_DELAY,
      new NamedRunnable("CheckingInvalListener.invalidateUnknownVersion") {
    @Override
    public void run() {
      statistics.recordListenerEvent(ListenerEventType.INVALIDATE_UNKNOWN);
      delegate.invalidateUnknownVersion(client, objectId, ackHandle);
    }
  });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:15,代码来源:CheckingInvalidationListener.java

示例8: invalidateAll

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void invalidateAll(final InvalidationClient client, final AckHandle ackHandle) {
  Preconditions.checkState(internalScheduler.isRunningOnThread(), "Not on internal thread");
  Preconditions.checkNotNull(ackHandle);
  listenerScheduler.schedule(NO_DELAY, new NamedRunnable("CheckingInvalListener.invalidateAll") {
    @Override
    public void run() {
      statistics.recordListenerEvent(ListenerEventType.INVALIDATE_ALL);
      delegate.invalidateAll(client, ackHandle);
    }
  });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:13,代码来源:CheckingInvalidationListener.java

示例9: informRegistrationFailure

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void informRegistrationFailure(final InvalidationClient client, final ObjectId objectId,
    final boolean isTransient, final String errorMessage) {
  Preconditions.checkState(internalScheduler.isRunningOnThread(), "Not on internal thread");
  listenerScheduler.schedule(NO_DELAY, new NamedRunnable("CheckingInvalListener.regFailure") {
    @Override
    public void run() {
      statistics.recordListenerEvent(ListenerEventType.INFORM_REGISTRATION_FAILURE);
      delegate.informRegistrationFailure(client, objectId, isTransient, errorMessage);
    }
  });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:13,代码来源:CheckingInvalidationListener.java

示例10: informRegistrationStatus

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void informRegistrationStatus(final InvalidationClient client, final ObjectId objectId,
    final RegistrationState regState) {
  Preconditions.checkState(internalScheduler.isRunningOnThread(), "Not on internal thread");
  listenerScheduler.schedule(NO_DELAY, new NamedRunnable("CheckingInvalListener.regStatus") {
    @Override
    public void run() {
      statistics.recordListenerEvent(ListenerEventType.INFORM_REGISTRATION_STATUS);
      delegate.informRegistrationStatus(client, objectId, regState);
    }
  });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:13,代码来源:CheckingInvalidationListener.java

示例11: reissueRegistrations

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void reissueRegistrations(final InvalidationClient client, final byte[] prefix,
    final int prefixLen) {
  Preconditions.checkState(internalScheduler.isRunningOnThread(), "Not on internal thread");
  listenerScheduler.schedule(NO_DELAY, new NamedRunnable("CheckingInvalListener.reissueRegs") {
    @Override
    public void run() {
      statistics.recordListenerEvent(ListenerEventType.REISSUE_REGISTRATIONS);
      delegate.reissueRegistrations(client, prefix, prefixLen);
    }
  });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:13,代码来源:CheckingInvalidationListener.java

示例12: informError

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void informError(final InvalidationClient client, final ErrorInfo errorInfo) {
  Preconditions.checkState(internalScheduler.isRunningOnThread(), "Not on internal thread");
  listenerScheduler.schedule(NO_DELAY, new NamedRunnable("CheckingInvalListener.informError") {
    @Override
    public void run() {
      statistics.recordListenerEvent(ListenerEventType.INFORM_ERROR);
      delegate.informError(client, errorInfo);
    }
  });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:12,代码来源:CheckingInvalidationListener.java

示例13: ready

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void ready(final InvalidationClient client) {
  Preconditions.checkState(internalScheduler.isRunningOnThread(), "Not on internal thread");
  listenerScheduler.schedule(NO_DELAY, new NamedRunnable("CheckingInvalListener.ready") {
    @Override
    public void run() {
      logger.info("Informing app that ticl is ready");
      delegate.ready(client);
    }
  });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:12,代码来源:CheckingInvalidationListener.java

示例14: informRegistrationStatus

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public final void informRegistrationStatus(final InvalidationClient client,
    final ObjectId objectId, final RegistrationState regState) {
  state.informRegistrationSuccess(objectId);
  AndroidListener.this.informRegistrationStatus(state.getClientId().getByteArray(), objectId,
      regState);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:8,代码来源:AndroidListener.java

示例15: informRegistrationFailure

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public final void informRegistrationFailure(final InvalidationClient client,
    final ObjectId objectId, final boolean isTransient, final String errorMessage) {
  state.informRegistrationFailure(objectId, isTransient);
  AndroidListener.this.informRegistrationFailure(state.getClientId().getByteArray(), objectId,
      isTransient, errorMessage);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:8,代码来源:AndroidListener.java


注:本文中的com.google.ipc.invalidation.external.client.InvalidationClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。