https://issues.apache.org/jira/browse/AMQ-3406 - BrokerServiceAware for DiscoveryAgent

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1148646 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2011-07-20 08:17:51 +00:00
parent 5f99d5c98a
commit 1b97cdd3c0
1 changed files with 8 additions and 2 deletions

View File

@ -324,7 +324,13 @@ public class TransportConnector implements Connector, BrokerServiceAware {
protected DiscoveryAgent createDiscoveryAgent() throws IOException {
if (discoveryUri != null) {
return DiscoveryAgentFactory.createDiscoveryAgent(discoveryUri);
DiscoveryAgent agent = DiscoveryAgentFactory.createDiscoveryAgent(discoveryUri);
if( agent!=null && agent instanceof BrokerServiceAware ) {
((BrokerServiceAware)agent).setBrokerService(brokerService);
}
return agent;
}
return null;
}
@ -551,4 +557,4 @@ public class TransportConnector implements Connector, BrokerServiceAware {
public int connectionCount() {
return connections.size();
}
}
}