activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r383971 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQInputStream.java
Date Tue, 07 Mar 2006 19:24:17 GMT
Author: chirino
Date: Tue Mar  7 11:24:15 2006
New Revision: 383971

URL: http://svn.apache.org/viewcvs?rev=383971&view=rev
Log:
support destination options on a stream consumer.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQInputStream.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQInputStream.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQInputStream.java?rev=383971&r1=383970&r2=383971&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQInputStream.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/ActiveMQInputStream.java
Tue Mar  7 11:24:15 2006
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.HashMap;
 
 import javax.jms.IllegalStateException;
 import javax.jms.InvalidDestinationException;
@@ -34,6 +35,7 @@
 import org.apache.activemq.command.ProducerId;
 import org.apache.activemq.selector.SelectorParser;
 import org.apache.activemq.util.IOExceptionSupport;
+import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.JMSExceptionSupport;
 
 /**
@@ -81,7 +83,6 @@
         }
 
         this.info = new ConsumerInfo(consumerId);
-        this.info.setDestination(dest);
         this.info.setSubcriptionName(name);
 
         if (selector != null && selector.trim().length() != 0) {
@@ -92,11 +93,19 @@
         
         new SelectorParser().parse(selector);
         this.info.setSelector(selector);
-
+        
         this.info.setPrefetchSize(prefetch);
         this.info.setNoLocal(noLocal);
         this.info.setBrowser(false);
         this.info.setDispatchAsync(false);
+        
+        // Allows the options on the destination to configure the consumerInfo
+        if (dest.getOptions() != null) {
+            HashMap options = new HashMap(dest.getOptions());
+            IntrospectionSupport.setProperties(this.info, options, "consumer.");
+        }
+        
+        this.info.setDestination(dest);
 
         this.connection.addInputStream(this);
         this.connection.addDispatcher(info.getConsumerId(), this);



Mime
View raw message