@Override
public Object call() throws Exception {
GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder();
gcb.transport().defaultTransport().nodeName(nodeName);
BlockingThreadPoolExecutorFactory remoteExecutorFactory = new BlockingThreadPoolExecutorFactory(
10, 1, 0, 60000);
gcb.transport().remoteCommandThreadPool().threadPoolFactory(remoteExecutorFactory);
BlockingThreadPoolExecutorFactory stateTransferExecutorFactory = new BlockingThreadPoolExecutorFactory(
4, 1, 0, 60000);
gcb.transport().stateTransferThreadPool().threadPoolFactory(stateTransferExecutorFactory);
EmbeddedCacheManager cm = new DefaultCacheManager(gcb.build());
try {
for (int j = 0; j < NUM_CACHES/2; j++) {
cm.defineConfiguration("repl-cache-" + j, replConfig);
cm.defineConfiguration("dist-cache-" + j, distConfig);
}
for (int j = 0; j < NUM_CACHES/2; j++) {
Cache<Object, Object> replCache = cm.getCache("repl-cache-" + j);
replCache.put(cm.getAddress(), "bla");
Cache<Object, Object> distCache = cm.getCache("dist-cache-" + j);
distCache.put(cm.getAddress(), "bla");
}
} finally {
registerCacheManager(cm);
}
log.infof("Started cache manager %s", cm.getAddress());
return null;
}
});