git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@433244 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-08-21 13:43:39 +00:00
parent 8043380127
commit 58d4605661
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;