00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.jonas_jms;
00026
00027 import javax.jms.ConnectionConsumer;
00028 import javax.jms.JMSException;
00029 import javax.jms.Queue;
00030 import javax.jms.QueueConnection;
00031 import javax.jms.QueueSession;
00032 import javax.jms.ServerSessionPool;
00033 import javax.jms.XAConnection;
00034 import javax.jms.XAQueueConnection;
00035 import javax.jms.XAQueueConnectionFactory;
00036
00037 import org.objectweb.util.monolog.api.BasicLevel;
00038
00048 public class JQueueConnection extends JConnection implements QueueConnection {
00049
00050
00051 protected XAQueueConnection xaqc = null;
00052
00053
00060 public JQueueConnection(JConnectionFactory jcf,
00061 XAQueueConnectionFactory xaqcf,
00062 String user, String passwd) throws JMSException {
00063 super(jcf, user);
00064
00065
00066 xaqc = xaqcf.createXAQueueConnection(user, passwd);
00067 this.xac = (XAConnection) xaqc;
00068 }
00069
00073 public JQueueConnection(JConnectionFactory jcf, XAQueueConnectionFactory xaqcf)
00074 throws JMSException {
00075
00076 super(jcf, INTERNAL_USER_NAME);
00077 xaqc = xaqcf.createXAQueueConnection();
00078 this.xac = (XAConnection) xaqc;
00079 }
00080
00081
00082
00083
00084
00098 public ConnectionConsumer createConnectionConsumer(Queue queue,
00099 String selector,
00100 ServerSessionPool pool,
00101 int maxmessages) throws JMSException {
00102 TraceJms.logger.log(BasicLevel.DEBUG, "");
00103 return xaqc.createConnectionConsumer(queue, selector, pool, maxmessages);
00104 }
00105
00115 public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException {
00116 TraceJms.logger.log(BasicLevel.DEBUG, "");
00117 return new JQueueSession(this, xaqc);
00118 }
00119 }