activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r374288 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/BrokerService.java network/NetworkConnector.java
Date Thu, 02 Feb 2006 06:54:21 GMT
Author: rajdavies
Date: Wed Feb  1 22:54:17 2006
New Revision: 374288

URL: http://svn.apache.org/viewcvs?rev=374288&view=rev
Log:
put back default Constructor on NetworkConnector - for now.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=374288&r1=374287&r2=374288&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Wed Feb  1 22:54:17 2006
@@ -191,7 +191,7 @@
      * @throws Exception
      */
     public NetworkConnector addNetworkConnector(URI discoveryAddress) throws Exception{
-        NetworkConnector connector=new NetworkConnector(this);
+        NetworkConnector connector=new NetworkConnector();
         // add the broker name to the parameters if not set
         connector.setUri(discoveryAddress);
         return addNetworkConnector(connector);
@@ -1000,6 +1000,7 @@
 
             for (Iterator iter = getNetworkConnectors().iterator(); iter.hasNext();) {
                 NetworkConnector connector = (NetworkConnector) iter.next();
+                connector.setBrokerName(getBrokerName());
                 connector.start();
             }
             

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java?rev=374288&r1=374287&r2=374288&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/NetworkConnector.java
Wed Feb  1 22:54:17 2006
@@ -42,19 +42,20 @@
 public class NetworkConnector implements Service, DiscoveryListener {
 
     private static final Log log = LogFactory.getLog(NetworkConnector.class);
-    private BrokerService brokerService;
+    private String brokerName = "localhost";
     private DiscoveryAgent discoveryAgent;
     private URI localURI;
 
     private ConcurrentHashMap bridges = new ConcurrentHashMap();
     boolean failover=true;
     
-    public NetworkConnector(BrokerService service) {
-        this.brokerService = service;
+    
+    public NetworkConnector(){
+        
     }
+    
 
-    public NetworkConnector(BrokerService service,URI localURI, DiscoveryAgent discoveryAgent)
throws IOException {
-        this.brokerService = service;
+    public NetworkConnector(URI localURI, DiscoveryAgent discoveryAgent) throws IOException
{
         this.localURI = localURI;
         setDiscoveryAgent(discoveryAgent);
     }
@@ -164,7 +165,7 @@
         this.discoveryAgent = discoveryAgent;
         if (discoveryAgent != null) {
             this.discoveryAgent.setDiscoveryListener(this);
-            this.discoveryAgent.setBrokerName(brokerService.getBrokerName());
+            this.discoveryAgent.setBrokerName(brokerName);
         }
     }
 
@@ -193,7 +194,7 @@
                 }
             }
         };
-        result.setLocalBrokerName(brokerService.getBrokerName());
+        result.setLocalBrokerName(brokerName);
         return result;
     }
 
@@ -205,6 +206,22 @@
 
     public void setFailover(boolean reliable) {
         this.failover = reliable;
+    }
+
+
+    /**
+     * @return Returns the brokerName.
+     */
+    public String getBrokerName(){
+        return brokerName;
+    }
+
+
+    /**
+     * @param brokerName The brokerName to set.
+     */
+    public void setBrokerName(String brokerName){
+        this.brokerName=brokerName;
     }
 
 }



Mime
View raw message