activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r514365 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/ConsumerBrokerExchange.java broker/TransportConnection.java broker/region/RegionBroker.java state/SessionState.java
Date Sun, 04 Mar 2007 06:47:55 GMT
Author: rajdavies
Date: Sat Mar  3 22:47:54 2007
New Revision: 514365

URL: http://svn.apache.org/viewvc?view=rev&rev=514365
Log:
add wildcard info to the ConsumerBrokerExchange

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConsumerBrokerExchange.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConsumerBrokerExchange.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConsumerBrokerExchange.java?view=diff&rev=514365&r1=514364&r2=514365
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConsumerBrokerExchange.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/ConsumerBrokerExchange.java
Sat Mar  3 22:47:54 2007
@@ -29,6 +29,7 @@
     private Destination regionDestination;
     private Region region;
     private Subscription subscription;
+    private boolean wildcard;
 
     /**
      * @return the connectionContext
@@ -84,5 +85,19 @@
      */
     public void setSubscription(Subscription subscription){
         this.subscription=subscription;
+    }
+
+    /**
+     * @return the wildcard
+     */
+    public boolean isWildcard(){
+        return this.wildcard;
+    }
+
+    /**
+     * @param wildcard the wildcard to set
+     */
+    public void setWildcard(boolean wildcard){
+        this.wildcard=wildcard;
     }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?view=diff&rev=514365&r1=514364&r2=514365
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Sat Mar  3 22:47:54 2007
@@ -1007,14 +1007,26 @@
         }
     }
     
-    private ConsumerBrokerExchange getConsumerBrokerExchange(ConsumerId id) {
-        ConsumerBrokerExchange result = consumerExchanges.get(id);
-        if (result == null) {
-            synchronized(consumerExchanges) {
-                result = new ConsumerBrokerExchange();
-                ConnectionState state = lookupConnectionState(id);
-                ConnectionContext context = state.getContext();
+    private ConsumerBrokerExchange getConsumerBrokerExchange(ConsumerId id){
+        ConsumerBrokerExchange result=consumerExchanges.get(id);
+        if(result==null){
+            synchronized(consumerExchanges){
+                result=new ConsumerBrokerExchange();
+                ConnectionState state=lookupConnectionState(id);
+                ConnectionContext context=state.getContext();
                 result.setConnectionContext(context);
+                SessionState ss=state.getSessionState(id.getParentId());
+                if(ss!=null){
+                    ConsumerState cs=ss.getConsumerState(id);
+                    if(cs!=null){
+                        ConsumerInfo info=cs.getInfo();
+                        if(info!=null){
+                            if(info.getDestination()!=null&&info.getDestination().isPattern()){
+                                result.setWildcard(true);
+                            }
+                        }
+                    }
+                }
                 consumerExchanges.put(id,result);
             }
         }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java?view=diff&rev=514365&r1=514364&r2=514365
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
Sat Mar  3 22:47:54 2007
@@ -396,7 +396,7 @@
     }
 
     public void acknowledge(ConsumerBrokerExchange consumerExchange,MessageAck ack) throws
Exception{
-        if(consumerExchange.getRegion()==null){
+        if(consumerExchange.isWildcard() || consumerExchange.getRegion()==null){
             ActiveMQDestination destination=ack.getDestination();
             Region region=null;
             switch(destination.getDestinationType()){

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java?view=diff&rev=514365&r1=514364&r2=514365
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/state/SessionState.java
Sat Mar  3 22:47:54 2007
@@ -81,6 +81,10 @@
         return consumers.values();
     }
     
+    public ConsumerState getConsumerState(ConsumerId consumerId) {
+        return (ConsumerState)consumers.get(consumerId);
+    }
+    
     private void checkShutdown() {
 		if( shutdown.get() )
 			throw new IllegalStateException("Disposed");



Mime
View raw message