activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r636428 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java
Date Wed, 12 Mar 2008 17:12:44 GMT
Author: rajdavies
Date: Wed Mar 12 10:12:35 2008
New Revision: 636428

URL: http://svn.apache.org/viewvc?rev=636428&view=rev
Log:
Add network consumer id to a DemandSubscription

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java?rev=636428&r1=636427&r2=636428&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DemandSubscription.java
Wed Mar 12 10:12:35 2008
@@ -38,8 +38,9 @@
         remoteInfo = info;
         localInfo = info.copy();
         localInfo.setBrokerPath(info.getBrokerPath());
-        remoteSubsIds.add(info.getConsumerId());
-    }
+        localInfo.setNetworkSubscription(true);
+        remoteSubsIds.add(info.getConsumerId());    
+     }
 
     /**
      * Increment the consumers associated with this subscription
@@ -47,7 +48,10 @@
      * @param id
      * @return true if added
      */
-    public boolean add(ConsumerId id) {
+    public boolean add(ConsumerId id) {   
+        if (localInfo != null) {
+            localInfo.addNetworkConsumerId(id);
+        }
         return remoteSubsIds.add(id);
     }
 
@@ -55,9 +59,12 @@
      * Increment the consumers associated with this subscription
      * 
      * @param id
-     * @return true if added
+     * @return true if removed
      */
     public boolean remove(ConsumerId id) {
+        if (localInfo != null) {
+            localInfo.removeNetworkConsumerId(id);
+        }
         return remoteSubsIds.remove(id);
     }
 



Mime
View raw message