private void doRejoin(RejoinRequest rejoinRequest) {
if (rejoinRequest == null) {
return;
}
final ClusterNode oldNodeReference = rejoinRequest.getRejoinOldNode();
rejoinStatus.rejoinStarted();
if (Thread.currentThread().isInterrupted()) {
// clear interrupt status if set
info("Clearing interrupt state of rejoin thread");
Thread.currentThread().interrupted();
}
int rejoinNumber = rejoinCount.incrementAndGet();
info("Starting Terracotta Rejoin (as client id: " + (oldNodeReference == null ? "null" : oldNodeReference.getId())
+ " left the cluster) [rejoin count = " + rejoinNumber + "] ... ");
rejoinListener.clusterRejoinStarted();
clusteredInstanceFactory = createNewClusteredInstanceFactory(Collections.EMPTY_MAP);
// now reinitialize all existing caches with the new instance factory, outside lock
rejoinListener.clusterRejoinComplete();