quorumManager = new QuorumManager(serverLocator0, threadPool, scheduledPool, getIdentity(), nodeManager);
serverLocator0.addClusterTopologyListener(quorumManager);
}
//use a Node Locator to connect to the cluster
LiveNodeLocator nodeLocator = configuration.getBackupGroupName() == null ?
new AnyLiveNodeLocator(quorumManager, HornetQServerImpl.this) :
new NamedLiveNodeLocator(configuration.getBackupGroupName(), quorumManager);
serverLocator0.addClusterTopologyListener(nodeLocator);
do
{
try
{
nodeLocator.connectToCluster(serverLocator0);
break;
}
catch (HornetQException e)
{
if (closed)
return;
Thread.sleep(serverLocator0.getRetryInterval());
}
} while (true);
serverLocator0.addIncomingInterceptor(new ReplicationError(HornetQServerImpl.this, nodeLocator));
// nodeManager.startBackup();
backupManager.start();
replicationEndpoint.setQuorumManager(quorumManager);
replicationEndpoint.setExecutor(executorFactory.getExecutor());
EndpointConnector endpointConnector = new EndpointConnector();
HornetQServerLogger.LOGGER.backupServerStarted(version.getFullVersion(), nodeManager.getNodeId());
state = SERVER_STATE.STARTED;
BACKUP_ACTIVATION signal;
do
{
//locate the first live server to try to replicate
nodeLocator.locateNode();
if (closed)
{
return;
}
Pair<TransportConfiguration, TransportConfiguration> possibleLive = nodeLocator.getLiveConfiguration();
nodeID = nodeLocator.getNodeID();
//in a normal (non failback) scenario if we couldn't find our live server we should fail
if (!attemptFailBack)
{
//this shouldn't happen
if (nodeID == null)