if (state == SERVER_STATE.STOPPED)
{
return;
}
state = SERVER_STATE.STOPPING;
final ReplicationManager localReplicationManager;
synchronized (replicationLock)
{
localReplicationManager = replicationManager;
}
if (localReplicationManager != null)
{
remotingService.freeze(localReplicationManager.getBackupTransportConnection());
if (!criticalIOError)
storageManager.closeIdGenerator();
// Schedule for 10 seconds
scheduledPool.schedule(new Runnable() {
@Override
public void run()
{
localReplicationManager.clearReplicationTokens();
}
}, 10, TimeUnit.SECONDS);
localReplicationManager.sendLiveIsStopping();
stopComponent(localReplicationManager);
}
stopComponent(connectorsService);