*/
public void startReplicationConsumers() throws Exception
{
if ( ( replConsumers != null ) && ( replConsumers.size() > 0 ) )
{
final PingerThread pingerThread = new PingerThread( pingerSleepTime );
pingerThread.start();
for ( final ReplicationConsumer consumer : replConsumers )
{
consumer.init( getDirectoryService() );
// A counter to be decremented when the consumer thread is started
final CountDownLatch counter = new CountDownLatch( 1 );
Runnable consumerTask = new Runnable()
{
public void run()
{
try
{
while ( true )
{
if ( CONSUMER_LOG.isDebugEnabled() )
{
MDC.put( "Replica", consumer.getId() );
}
LOG.info( "starting the replication consumer with {}", consumer );
CONSUMER_LOG.info( "starting the replication consumer with {}", consumer );
boolean isConnected = consumer.connect( ReplicationConsumer.NOW );
if ( isConnected )
{
// Ok, we are connected, we can signal the parent that all is ok
counter.countDown();
pingerThread.addConsumer( consumer );
// We are now connected, start the replication
ReplicationStatusEnum status = null;
do