• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InvalidationClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: 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(
        ProtoConverter.convertToInvalidationProto(invalidation), ackHandleP));
  } catch (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidate", ackHandle);
  }
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:13,代码来源:AndroidInvalidationClientImpl.java


示例17: 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(
        ProtoConverter.convertToObjectIdProto(objectId), ackHandleP));
  } catch (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateUnknownVersion", ackHandle);
  }
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:13,代码来源:AndroidInvalidationClientImpl.java


示例18: 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 (InvalidProtocolBufferException exception) {
    // Log and drop invalid call.
    logBadAckHandle("invalidateAll", ackHandle);
  }
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:11,代码来源:AndroidInvalidationClientImpl.java


示例19: informRegistrationStatus

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


示例20: informRegistrationStatus

import com.google.ipc.invalidation.external.client.InvalidationClient; //导入依赖的package包/类
@Override
public void informRegistrationStatus(
    InvalidationClient client, ObjectId objectId, RegistrationState regState) {
  Event event = Event.newBuilder(Event.Action.INFORM_REGISTRATION_STATUS)
      .setClientKey(clientKey).setObjectId(objectId).setRegistrationState(regState).build();
  sendEvent(event);
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:8,代码来源:AndroidClientProxy.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StreamClientConfigurationImpl类代码示例发布时间:2022-05-22
下一篇:
Java GuiSlider类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap