本文整理了Java中org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStore.stop()
方法的一些代码示例,展示了ZookeeperMetadataStore.stop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperMetadataStore.stop()
方法的具体详情如下:
包路径:org.springframework.integration.zookeeper.metadata.ZookeeperMetadataStore
类名称:ZookeeperMetadataStore
方法名:stop
暂无
代码示例来源:origin: spring-projects/spring-integration
@Override
public void stop(Runnable callback) {
stop();
callback.run();
}
代码示例来源:origin: spring-projects/spring-integration
@Override
@After
public void tearDown() throws Exception {
this.metadataStore.stop();
this.client.delete().deletingChildrenIfNeeded().forPath(this.metadataStore.getRoot());
}
代码示例来源:origin: org.springframework.integration/spring-integration-zookeeper
@Override
public void stop(Runnable callback) {
stop();
callback.run();
}
代码示例来源:origin: spring-projects/spring-integration
@Test
public void testPutIfAbsent() throws Exception {
final String testKey = "ZookeeperMetadataStoreTests-Persist";
final String testKey2 = "ZookeeperMetadataStoreTests-Persist-2";
metadataStore.put(testKey, "Integration");
assertNotNull(client.checkExists().forPath(metadataStore.getPath(testKey)));
assertEquals("Integration",
IntegrationUtils.bytesToString(client.getData().forPath(metadataStore.getPath(testKey)), "UTF-8"));
CuratorFramework otherClient = createNewClient();
final ZookeeperMetadataStore otherMetadataStore = new ZookeeperMetadataStore(otherClient);
otherMetadataStore.start();
otherMetadataStore.putIfAbsent(testKey, "OtherValue");
assertEquals("Integration",
IntegrationUtils.bytesToString(client.getData().forPath(metadataStore.getPath(testKey)), "UTF-8"));
assertEquals("Integration", metadataStore.get(testKey));
assertThat("Integration", eventually(equalsResult(() -> otherMetadataStore.get(testKey))));
otherMetadataStore.putIfAbsent(testKey2, "Integration-2");
assertEquals("Integration-2",
IntegrationUtils.bytesToString(client.getData().forPath(metadataStore.getPath(testKey2)), "UTF-8"));
assertEquals("Integration-2", otherMetadataStore.get(testKey2));
assertThat("Integration-2", eventually(equalsResult(() -> otherMetadataStore.get(testKey2))));
otherMetadataStore.stop();
CloseableUtils.closeQuietly(otherClient);
}
代码示例来源:origin: spring-projects/spring-integration
@Test
public void testReplace() throws Exception {
final String testKey = "ZookeeperMetadataStoreTests-Replace";
metadataStore.put(testKey, "Integration");
assertNotNull(client.checkExists().forPath(metadataStore.getPath(testKey)));
assertEquals("Integration",
IntegrationUtils.bytesToString(client.getData().forPath(metadataStore.getPath(testKey)), "UTF-8"));
CuratorFramework otherClient = createNewClient();
final ZookeeperMetadataStore otherMetadataStore = new ZookeeperMetadataStore(otherClient);
otherMetadataStore.start();
otherMetadataStore.replace(testKey, "OtherValue", "Integration-2");
assertEquals("Integration",
IntegrationUtils.bytesToString(client.getData().forPath(metadataStore.getPath(testKey)), "UTF-8"));
assertEquals("Integration", metadataStore.get(testKey));
assertThat("Integration", eventually(equalsResult(() -> otherMetadataStore.get(testKey))));
otherMetadataStore.replace(testKey, "Integration", "Integration-2");
assertEquals("Integration-2",
IntegrationUtils.bytesToString(client.getData().forPath(metadataStore.getPath(testKey)), "UTF-8"));
assertThat("Integration-2", eventually(equalsResult(() -> metadataStore.get(testKey))));
assertEquals("Integration-2", otherMetadataStore.get(testKey));
otherMetadataStore.stop();
CloseableUtils.closeQuietly(otherClient);
}
代码示例来源:origin: spring-projects/spring-integration
assertThat(notifiedChanges.get(3), IsIterableContainingInOrder.contains("remove", testKey, "Integration-3"));
otherMetadataStore.stop();
CloseableUtils.closeQuietly(otherClient);
内容来源于网络,如有侵权,请联系作者删除!