本文整理汇总了Java中org.sdnplatform.sync.internal.SyncManager.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Java SyncManager.shutdown方法的具体用法?Java SyncManager.shutdown怎么用?Java SyncManager.shutdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sdnplatform.sync.internal.SyncManager
的用法示例。
在下文中一共展示了SyncManager.shutdown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRemoveNode
import org.sdnplatform.sync.internal.SyncManager; //导入方法依赖的package包/类
@Test
public void testRemoveNode() throws Exception {
waitForFullMesh(2000);
IStoreClient<String, String> client0 =
syncManagers[0].getStoreClient("global",
String.class, String.class);
IStoreClient<String, String> client1 =
syncManagers[1].getStoreClient("global",
String.class, String.class);
IStoreClient<String, String> client2 =
syncManagers[2].getStoreClient("global",
String.class, String.class);
client0.put("key", "value");
waitForValue(client1, "key", "value", 2000, "client1");
nodes.remove(0);
nodeString = mapper.writeValueAsString(nodes);
SyncManager oldNode = syncManagers[0];
syncManagers = Arrays.copyOfRange(syncManagers, 1, 4);
moduleContexts = Arrays.copyOfRange(moduleContexts, 1, 4);
try {
for(int i = 0; i < syncManagers.length; i++) {
moduleContexts[i].addConfigParam(syncManagers[i],
"nodes", nodeString);
syncManagers[i].doUpdateConfiguration();
waitForConnection(syncManagers[i], (short)1, false, 2000);
}
} finally {
oldNode.shutdown();
}
waitForFullMesh(2000);
client1.put("newkey", "newvalue");
waitForValue(client2, "key", "value", 2000, "client4");
waitForValue(client2, "newkey", "newvalue", 2000, "client0");
}