co.cask.coopr.common.zookeeper.guice.ZookeeperModule类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.3k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中co.cask.coopr.common.zookeeper.guice.ZookeeperModule类的一些代码示例,展示了ZookeeperModule类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperModule类的具体详情如下:
包路径:co.cask.coopr.common.zookeeper.guice.ZookeeperModule
类名称:ZookeeperModule

ZookeeperModule介绍

[英]Guice module for binding zookeeper related classes.
[中]用于绑定zookeeper相关类的Guice模块。

代码示例

代码示例来源:origin: caskdata/coopr

@Override
 protected void configure() {
  bind(ZKClient.class).toInstance(zkClient);
  bind(IdService.class).in(Scopes.SINGLETON);
  bind(LockService.class).in(Scopes.SINGLETON);
 }
}

代码示例来源:origin: caskdata/coopr

new ZookeeperModule(zkClientService),
new StoreModule(conf),
new QueueModule(zkClientService),

代码示例来源:origin: caskdata/coopr

@Before
public void before() throws IOException {
 zkServer = InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).setTickTime(30000).build();
 zkServer.startAndWait();
 zkClient = ZKClientService.Builder.of(zkServer.getConnectionStr()).build();
 zkClient.startAndWait();
 Injector injector = Guice.createInjector(
  new ZookeeperModule(zkClient),
  new QueueModule(zkClient)
 );
 zkQueueGroupService = injector.getInstance(ZKQueueService.class);
 zkQueueGroupService.startAndWait();
}

代码示例来源:origin: caskdata/coopr

Modules.override(
 new ConfigurationModule(conf),
 new ZookeeperModule(zkClientService),
 new TestStoreModule(),
 new QueueModule(zkClientService),

相关文章

ZookeeperModule类方法