001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: * Free SoftwareFoundation, Inc.
023: * 59 Temple Place, Suite 330
024: * Boston, MA 02111-1307 USA
025: *
026: * @author Scott Ferguson
027: */
028:
029: package com.caucho.jms.connection;
030:
031: import com.caucho.config.ConfigException;
032: import com.caucho.management.j2ee.J2EEManagedObject;
033: import com.caucho.management.j2ee.JMSResource;
034: import com.caucho.jms.memory.*;
035: import com.caucho.util.L10N;
036:
037: import javax.jms.*;
038: import javax.sql.DataSource;
039: import java.sql.SQLException;
040: import java.util.ArrayList;
041: import java.util.Collections;
042: import java.util.HashMap;
043: import java.util.List;
044: import java.util.logging.Logger;
045:
046: /**
047: * A sample connection factory.
048: */
049: public class XAConnectionFactoryImpl extends ConnectionFactoryImpl {
050: private static final Logger log = Logger
051: .getLogger(XAConnectionFactoryImpl.class.getName());
052: private static final L10N L = new L10N(
053: XAConnectionFactoryImpl.class);
054:
055: public XAConnectionFactoryImpl() {
056: }
057:
058: /**
059: * Creates a new queue connection
060: */
061: @Override
062: public Connection createConnection() throws JMSException {
063: return createXAConnection();
064: }
065:
066: /**
067: * Creates a new connection
068: *
069: * @param username the username to authenticate with the server.
070: * @param password the password to authenticate with the server.
071: *
072: * @return the created connection
073: */
074: public Connection createConnection(String username, String password)
075: throws JMSException {
076: return createXAConnection(username, password);
077: }
078:
079: /**
080: * Creates queue.
081: */
082: public Queue createQueue(String name) throws JMSException {
083: throw new UnsupportedOperationException();
084: }
085:
086: /**
087: * Creates topics.
088: */
089: public Topic createTopic(String name) throws JMSException {
090: throw new UnsupportedOperationException();
091: }
092:
093: /**
094: * Creates a new queue connection
095: */
096: public QueueConnection createQueueConnection() throws JMSException {
097: return createXAQueueConnection();
098: }
099:
100: /**
101: * Creates a new queue connection
102: *
103: * @param username the username to authenticate with the server.
104: * @param password the password to authenticate with the server.
105: *
106: * @return the created connection
107: */
108: public QueueConnection createQueueConnection(String username,
109: String password) throws JMSException {
110: return createXAQueueConnection(username, password);
111: }
112:
113: /**
114: * Creates a new queue connection
115: */
116: public TopicConnection createTopicConnection() throws JMSException {
117: return createXATopicConnection();
118: }
119:
120: /**
121: * Creates a new queue connection
122: *
123: * @param username the username to authenticate with the server.
124: * @param password the password to authenticate with the server.
125: *
126: * @return the created connection
127: */
128: public TopicConnection createTopicConnection(String username,
129: String password) throws JMSException {
130: return createXATopicConnection(username, password);
131: }
132: }
|