activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r582086 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: BrokerService.java jmx/BrokerView.java jmx/BrokerViewMBean.java
Date Fri, 05 Oct 2007 06:02:48 GMT
Author: rajdavies
Date: Thu Oct  4 23:02:46 2007
New Revision: 582086

URL: http://svn.apache.org/viewvc?rev=582086&view=rev
Log:
patch http://issues.apache.org/activemq/browse/AMQ-1444

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?rev=582086&r1=582085&r2=582086&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java
Thu Oct  4 23:02:46 2007
@@ -782,12 +782,30 @@
         this.managementContext = managementContext;
     }
 
+    public NetworkConnector getNetworkConnectorByName(String connectorName) {
+        for(NetworkConnector connector : networkConnectors) {
+            if(connector.getName().equals(connectorName)) {
+                return connector;
+            }
+        }
+        return null;
+    }
+
     public String[] getNetworkConnectorURIs() {
         return networkConnectorURIs;
     }
 
     public void setNetworkConnectorURIs(String[] networkConnectorURIs) {
         this.networkConnectorURIs = networkConnectorURIs;
+    }
+
+    public TransportConnector getConnectorByName(String connectorName) {
+        for(TransportConnector connector : transportConnectors) {
+            if(connector.getName().equals(connectorName)) {
+                return connector;
+            }
+        }
+        return null;
     }
 
     public String[] getTransportConnectorURIs() {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java?rev=582086&r1=582085&r2=582086&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java
Thu Oct  4 23:02:46 2007
@@ -24,12 +24,14 @@
 import org.apache.activemq.broker.Broker;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.ConnectionContext;
+import org.apache.activemq.broker.TransportConnector;
 import org.apache.activemq.broker.region.Subscription;
 import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.activemq.command.ActiveMQTopic;
 import org.apache.activemq.command.ConsumerId;
 import org.apache.activemq.command.ConsumerInfo;
 import org.apache.activemq.command.RemoveSubscriptionInfo;
+import org.apache.activemq.network.NetworkConnector;
 //import org.apache.log4j.LogManager;
 //import org.apache.log4j.PropertyConfigurator;
 
@@ -154,6 +156,30 @@
 
     public ObjectName[] getInactiveDurableTopicSubscribers() {
         return broker.getInactiveDurableTopicSubscribers();
+    }
+
+    public String addConnector(String discoveryAddress) throws Exception {
+        TransportConnector connector = brokerService.addConnector(discoveryAddress);
+        connector.start();
+        return connector.getName();
+    }
+
+    public String addNetworkConnector(String discoveryAddress) throws Exception {
+        NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress);
+        connector.start();
+        return connector.getName();
+    }
+
+    public boolean removeConnector(String connectorName) throws Exception {
+        TransportConnector connector = brokerService.getConnectorByName(connectorName);
+        connector.stop();
+        return brokerService.removeConnector(connector);
+    }
+
+    public boolean removeNetworkConnector(String connectorName) throws Exception {
+        NetworkConnector connector = brokerService.getNetworkConnectorByName(connectorName);
+        connector.stop();
+        return brokerService.removeNetworkConnector(connector);
     }
 
     public void addTopic(String name) throws Exception {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java?rev=582086&r1=582085&r2=582086&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/BrokerViewMBean.java
Thu Oct  4 23:02:46 2007
@@ -90,6 +90,14 @@
 
     ObjectName[] getTemporaryQueueSubscribers();
 
+    String addConnector(String discoveryAddress) throws Exception;
+
+    String addNetworkConnector(String discoveryAddress) throws Exception;
+
+    boolean removeConnector(String connectorName) throws Exception;
+
+    boolean removeNetworkConnector(String connectorName) throws Exception;
+
     /**
      * Adds a Topic destination to the broker.
      * 



Mime
View raw message