activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r382890 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx: TopicView.java TopicViewMBean.java
Date Fri, 03 Mar 2006 17:20:21 GMT
Author: rajdavies
Date: Fri Mar  3 09:20:19 2006
New Revision: 382890

URL: http://svn.apache.org/viewcvs?rev=382890&view=rev
Log:
Added methods to create/destroy durable subscriber

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicView.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicViewMBean.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicView.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicView.java?rev=382890&r1=382889&r2=382890&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicView.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicView.java
Fri Mar  3 09:20:19 2006
@@ -13,10 +13,36 @@
  */
 package org.apache.activemq.broker.jmx;
 
+import org.apache.activemq.broker.ConnectionContext;
 import org.apache.activemq.broker.region.Topic;
+import org.apache.activemq.command.ConsumerInfo;
+import org.apache.activemq.command.RemoveSubscriptionInfo;
 public class TopicView extends DestinationView implements TopicViewMBean{
     
     public TopicView(ManagedRegionBroker broker, Topic destination){
         super(broker, destination);
+    }
+
+    public void createDurableSubscriber(String clientId,String subscriberName) throws Exception{
+        ConnectionContext context = new ConnectionContext();
+        context.setBroker(broker);
+        context.setClientId(clientId);
+        ConsumerInfo info = new ConsumerInfo();
+        info.setDestination(destination.getActiveMQDestination());
+        info.setSubcriptionName(subscriberName);
+        broker.addConsumer(context, info);
+        broker.removeConsumer(context, info);        
+    }
+
+    public void destroyDurableSubscriber(String clientId,String subscriberName) throws Exception{
+        RemoveSubscriptionInfo info = new RemoveSubscriptionInfo();
+        info.setClientId(clientId);
+        info.setSubcriptionName(subscriberName);
+        ConnectionContext context = new ConnectionContext();
+        context.setBroker(broker);
+        context.setClientId(clientId);
+        broker.removeSubscription(context, info);
+  
+        
     }
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicViewMBean.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicViewMBean.java?rev=382890&r1=382889&r2=382890&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicViewMBean.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/TopicViewMBean.java
Fri Mar  3 09:20:19 2006
@@ -34,5 +34,9 @@
     
     public CompositeData[] browse() throws OpenDataException;
     public TabularData browseAsTable() throws OpenDataException;
+    
+    public void createDurableSubscriber(String clientId,String subscriberName) throws Exception;
+    
+    public void destroyDurableSubscriber(String clientId,String subscriberName) throws Exception;
 
 }



Mime
View raw message