Hiram R. Chirino 2006-09-07 19:37:04 +00:00
parent a2efa7e2e3
commit a02fd05f57
3 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,7 @@ public class CompositeDemandForwardingBridge extends DemandForwardingBridgeSuppo
public CompositeDemandForwardingBridge(Transport localBroker, Transport remoteBroker) {
super(localBroker, remoteBroker);
remoteBrokerName = remoteBroker.toString();
remoteBrokerNameKnownLatch.countDown();
}
protected void serviceRemoteBrokerInfo(Command command) throws IOException {

View File

@ -57,6 +57,7 @@ public class DemandForwardingBridge extends DemandForwardingBridgeSupport {
ServiceSupport.dispose(this);
}
}
remoteBrokerNameKnownLatch.countDown();
}
}

View File

@ -100,6 +100,7 @@ public abstract class DemandForwardingBridgeSupport implements Bridge {
protected final ConcurrentHashMap subscriptionMapByRemoteId = new ConcurrentHashMap();
protected final BrokerId localBrokerPath[] = new BrokerId[] { null };
protected CountDownLatch startedLatch = new CountDownLatch(2);
protected CountDownLatch remoteBrokerNameKnownLatch = new CountDownLatch(1);
protected boolean decreaseNetworkConsumerPriority;
protected int networkTTL = 1;
protected final AtomicBoolean remoteInterupted = new AtomicBoolean(false);
@ -212,6 +213,9 @@ public abstract class DemandForwardingBridgeSupport implements Bridge {
protected void startLocalBridge() throws Exception {
if(localBridgeStarted.compareAndSet(false,true)){
synchronized( this ) {
remoteBrokerNameKnownLatch.await();
localConnectionInfo=new ConnectionInfo();
localConnectionInfo.setConnectionId(new ConnectionId(idGenerator.generateId()));
localClientId="NC_"+remoteBrokerName+"_inbound"+name;