info("Shutting down old ClusteredInstanceFactory...");
shutdownClusteredInstanceFactoryWrapper(clusteredInstanceFactory);
}
info("Creating new ClusteredInstanceFactory");
ClusteredInstanceFactory factory;
CacheCluster underlyingCacheCluster = null;
try {
factory = TerracottaClusteredInstanceHelper.getInstance().newClusteredInstanceFactory(cacheConfigs,
terracottaClientConfiguration);
underlyingCacheCluster = factory.getTopology();
} finally {
// always set up listener so that rejoin can happen upon nodeLeft
if (isRejoinEnabled()) {
if (underlyingCacheCluster != null) {
underlyingCacheCluster.addTopologyListener(new NodeLeftListener(this, underlyingCacheCluster
.waitUntilNodeJoinsCluster()));
} else {
warn("Unable to register node left listener for rejoin");
}
}