User: pkendall Date: 01/05/20 16:38:18 Modified: src/main/org/jbossmq SpyQueueSender.java SpyTopicPublisher.java Log: Set the defaultDeliveryMode based on the type of queue/topic being used. Revision Changes Path 1.3 +9 -1 jbossmq/src/main/org/jbossmq/SpyQueueSender.java Index: SpyQueueSender.java =================================================================== RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/SpyQueueSender.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SpyQueueSender.java 2001/03/02 01:12:41 1.2 +++ SpyQueueSender.java 2001/05/20 23:38:18 1.3 @@ -10,6 +10,8 @@ import javax.jms.JMSException; import javax.jms.Message; import javax.jms.Queue; +import javax.jms.TemporaryQueue; +import javax.jms.DeliveryMode; import javax.jms.InvalidDestinationException; /** @@ -18,7 +20,7 @@ * @author Norbert Lataille ([EMAIL PROTECTED]) * @author Hiram Chirino ([EMAIL PROTECTED]) * - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class SpyQueueSender extends SpyMessageProducer @@ -37,6 +39,12 @@ { this.session=session; this.queue=queue; + try { + if(queue instanceof TemporaryQueue) + setDeliveryMode(DeliveryMode.NON_PERSISTENT); + else + setDeliveryMode(DeliveryMode.PERSISTENT); + } catch(JMSException e) {} } // Public -------------------------------------------------------- 1.3 +9 -2 jbossmq/src/main/org/jbossmq/SpyTopicPublisher.java Index: SpyTopicPublisher.java =================================================================== RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/SpyTopicPublisher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SpyTopicPublisher.java 2001/03/02 01:12:42 1.2 +++ SpyTopicPublisher.java 2001/05/20 23:38:18 1.3 @@ -10,8 +10,9 @@ import javax.jms.JMSException; import javax.jms.Message; import javax.jms.Topic; -import javax.jms.InvalidDestinationException; +import javax.jms.TemporaryTopic; import javax.jms.DeliveryMode; +import javax.jms.InvalidDestinationException; /** * This class implements javax.jms.TopicPublisher @@ -19,7 +20,7 @@ * @author Norbert Lataille ([EMAIL PROTECTED]) * @author Hiram Chirino ([EMAIL PROTECTED]) * - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ public class SpyTopicPublisher extends SpyMessageProducer @@ -38,6 +39,12 @@ { mySession=s; myTopic=t; + try { + if(t instanceof TemporaryTopic) + setDeliveryMode(DeliveryMode.NON_PERSISTENT); + else + setDeliveryMode(DeliveryMode.PERSISTENT); + } catch(JMSException e) {} } // Public -------------------------------------------------------- _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development