[jboss-svn-commits] JBL Code SVN: r6945 - labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Oct 20 07:00:14 EDT 2006


Author: estebanschifman
Date: 2006-10-20 07:00:13 -0400 (Fri, 20 Oct 2006)
New Revision: 6945

Modified:
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
Log:
add "topic" destination type to JmsCourier

Modified: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-10-20 10:53:36 UTC (rev 6944)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-10-20 11:00:13 UTC (rev 6945)
@@ -23,15 +23,7 @@
 package org.jboss.internal.soa.esb.couriers;
 
 import java.util.*;
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TopicPublisher;
+import javax.jms.*;
 import javax.naming.Context;
 
 import org.apache.log4j.Logger;
@@ -154,7 +146,7 @@
         String sType = getEpr().getDestinationType();
         if (JMSEpr.QUEUE_TYPE.equals(sType))
         {
-            Queue queue = (Queue) oJndiCtx.lookup(getEpr().getDestinationName());
+            javax.jms.Queue queue = (javax.jms.Queue) oJndiCtx.lookup(getEpr().getDestinationName());
             QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
             QueueConnection qConn = qcf.createQueueConnection();
             QueueSession qSess = qConn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
@@ -164,7 +156,13 @@
         }
         else if(JMSEpr.TOPIC_TYPE.equals(sType))
         {
-        	
+            Topic topic = (Topic) oJndiCtx.lookup(getEpr().getDestinationName());
+            TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;
+            TopicConnection tConn = tcf.createTopicConnection();
+            TopicSession tSess = tConn.createTopicSession(false,TopicSession.AUTO_ACKNOWLEDGE);
+            _jmsConnection	 = tConn;
+            _jmsSession		 = tSess;
+            _messageProducer = tSess.createPublisher(topic);
         }
         else
         	throw new CourierException("Unknown destination type");




More information about the jboss-svn-commits mailing list