01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package javax.jms;
23:
24: /** The <CODE>XAConnectionFactory</CODE> interface is a base interface for the
25: * <CODE>XAQueueConnectionFactory</CODE> and
26: * <CODE>XATopicConnectionFactory</CODE> interfaces.
27: *
28: * <P>Some application servers provide support for grouping JTS capable
29: * resource use into a distributed transaction (optional). To include JMS API transactions
30: * in a JTS transaction, an application server requires a JTS aware JMS
31: * provider. A JMS provider exposes its JTS support using an
32: * <CODE>XAConnectionFactory</CODE> object, which an application server uses
33: * to create <CODE>XAConnection</CODE> objects.
34: *
35: * <P><CODE>XAConnectionFactory</CODE> objects are JMS administered objects,
36: * just like <CODE>ConnectionFactory</CODE> objects. It is expected that
37: * application servers will find them using the Java Naming and Directory
38: * Interface (JNDI) API.
39: *
40: *<P>The <CODE>XAConnectionFactory</CODE> interface is optional. JMS providers
41: * are not required to support this interface. This interface is for
42: * use by JMS providers to support transactional environments.
43: * Client programs are strongly encouraged to use the transactional support
44: * available in their environment, rather than use these XA
45: * interfaces directly.
46: *
47: * @see javax.jms.XAQueueConnectionFactory
48: * @see javax.jms.XATopicConnectionFactory
49: */
50:
51: public interface XAConnectionFactory {
52:
53: /** Creates an <CODE>XAConnection</CODE> with the default user identity.
54: * The connection is created in stopped mode. No messages
55: * will be delivered until the <code>Connection.start</code> method
56: * is explicitly called.
57: *
58: * @return a newly created <CODE>XAConnection</CODE>
59: *
60: * @exception JMSException if the JMS provider fails to create an XA
61: * connection due to some internal error.
62: * @exception JMSSecurityException if client authentication fails due to
63: * an invalid user name or password.
64: *
65: * @since 1.1
66: */
67:
68: XAConnection createXAConnection() throws JMSException;
69:
70: /** Creates an XA connection with the specified user identity.
71: * The connection is created in stopped mode. No messages
72: * will be delivered until the <code>Connection.start</code> method
73: * is explicitly called.
74: *
75: * @param userName the caller's user name
76: * @param password the caller's password
77: *
78: * @return a newly created XA connection
79: *
80: * @exception JMSException if the JMS provider fails to create an XA
81: * connection due to some internal error.
82: * @exception JMSSecurityException if client authentication fails due to
83: * an invalid user name or password.
84: *
85: * @since 1.1
86: */
87:
88: XAConnection createXAConnection(String userName, String password)
89: throws JMSException;
90: }
|