JQueueConnectionFactory.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: JQueueConnectionFactory.java,v 1.9 2004/03/19 14:31:48 sauthieg Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas_jms;
00027 
00028 import javax.jms.JMSException;
00029 import javax.jms.QueueConnection;
00030 import javax.jms.QueueConnectionFactory;
00031 import javax.jms.XAQueueConnectionFactory;
00032 
00033 import org.objectweb.util.monolog.api.BasicLevel;
00034 
00044 public class JQueueConnectionFactory extends JConnectionFactory implements QueueConnectionFactory {
00045     
00046     private XAQueueConnectionFactory xaqcf;
00047 
00052     public JQueueConnectionFactory(String name) {
00053         this.name = name;
00054         jms = JmsManagerImpl.getJmsManager();
00055         xacf = jms.getXAQueueConnectionFactory();
00056         xaqcf = (XAQueueConnectionFactory) xacf;
00057     }
00058 
00059     // -----------------------------------------------------------------------
00060     // QueueConnectionFactory implementation
00061     // -----------------------------------------------------------------------
00062 
00072     public QueueConnection createQueueConnection() throws JMSException {
00073         TraceJms.logger.log(BasicLevel.DEBUG,"");
00074         JQueueConnection qc = (JQueueConnection) getJConnection();
00075         if (qc == null) {
00076             qc = new JQueueConnection(this, xaqcf);
00077         }
00078         return (QueueConnection) qc;
00079     }
00080 
00094     public QueueConnection createQueueConnection(String userName, String password) throws JMSException {
00095         TraceJms.logger.log(BasicLevel.DEBUG,"");
00096         JQueueConnection qc = (JQueueConnection) getJConnection(userName);
00097         if (qc == null) {
00098             qc = new JQueueConnection(this, xaqcf, userName, password);
00099         }
00100         return (QueueConnection) qc;
00101     }
00102 
00103 
00104 } 

Generated on Tue Feb 15 15:05:50 2005 for JOnAS by  doxygen 1.3.9.1