public void startReplication(CoreRemotingConnection rc, final ClusterConnection clusterConnection,
final Pair<TransportConfiguration, TransportConfiguration> pair, final boolean isFailBackRequest) throws HornetQException
{
if (replicationManager != null)
{
throw new HornetQAlreadyReplicatingException();
}
if (!isStarted())
{
throw new HornetQIllegalStateException();
}
synchronized (replicationLock)
{
if (replicationManager != null)
{
throw new HornetQAlreadyReplicatingException();
}
ReplicationFailureListener listener = new ReplicationFailureListener();
rc.addCloseListener(listener);
rc.addFailureListener(listener);
replicationManager = new ReplicationManager(rc, executorFactory);