本文整理了Java中co.cask.coopr.common.zookeeper.guice.ZookeeperModule
类的一些代码示例,展示了ZookeeperModule
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperModule
类的具体详情如下:
包路径:co.cask.coopr.common.zookeeper.guice.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),
内容来源于网络,如有侵权,请联系作者删除!