org.jboss.jms
Class ConnectionFactoryHelper

java.lang.Object
  extended by org.jboss.jms.ConnectionFactoryHelper

public class ConnectionFactoryHelper
extends Object

A helper for creating connections from jms connection factories.

Version:
$Revision: 1.7.6.2 $
Author:
Jason Dillon, Adrian Brock

Constructor Summary
ConnectionFactoryHelper()
           
 
Method Summary
static javax.jms.Connection createConnection(Object factory)
          Create a connection from the given factory.
static javax.jms.Connection createConnection(Object factory, String username, String password)
          Create a connection from the given factory.
static javax.jms.QueueConnection createQueueConnection(Object factory)
          Create a queue connection from the given factory.
static javax.jms.QueueConnection createQueueConnection(Object factory, String username, String password)
          Create a queue connection from the given factory.
static javax.jms.TopicConnection createTopicConnection(Object factory)
          Create a topic connection from the given factory.
static javax.jms.TopicConnection createTopicConnection(Object factory, String username, String password)
          Create a topic connection from the given factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionFactoryHelper

public ConnectionFactoryHelper()
Method Detail

createConnection

public static javax.jms.Connection createConnection(Object factory,
                                                    String username,
                                                    String password)
                                             throws javax.jms.JMSException
Create a connection from the given factory. An XA connection will be created if possible.

Parameters:
factory - An object that implements ConnectionFactory, XAQConnectionFactory
username - The username to use or null for no user.
password - The password for the given username or null if no username was specified.
Returns:
A queue connection.
Throws:
javax.jms.JMSException - Failed to create connection.
IllegalArgumentException - Factory is null or invalid.

createConnection

public static javax.jms.Connection createConnection(Object factory)
                                             throws javax.jms.JMSException
Create a connection from the given factory. An XA connection will be created if possible.

Parameters:
factory - An object that implements QueueConnectionFactory, XAQueueConnectionFactory
Returns:
A queue connection.
Throws:
javax.jms.JMSException - Failed to create connection.
IllegalArgumentException - Factory is null or invalid.

createQueueConnection

public static javax.jms.QueueConnection createQueueConnection(Object factory,
                                                              String username,
                                                              String password)
                                                       throws javax.jms.JMSException
Create a queue connection from the given factory. An XA connection will be created if possible.

Parameters:
factory - An object that implements QueueConnectionFactory, XAQueueConnectionFactory
username - The username to use or null for no user.
password - The password for the given username or null if no username was specified.
Returns:
A queue connection.
Throws:
javax.jms.JMSException - Failed to create connection.
IllegalArgumentException - Factory is null or invalid.

createQueueConnection

public static javax.jms.QueueConnection createQueueConnection(Object factory)
                                                       throws javax.jms.JMSException
Create a queue connection from the given factory. An XA connection will be created if possible.

Parameters:
factory - An object that implements QueueConnectionFactory, XAQueueConnectionFactory
Returns:
A queue connection.
Throws:
javax.jms.JMSException - Failed to create connection.
IllegalArgumentException - Factory is null or invalid.

createTopicConnection

public static javax.jms.TopicConnection createTopicConnection(Object factory,
                                                              String username,
                                                              String password)
                                                       throws javax.jms.JMSException
Create a topic connection from the given factory. An XA connection will be created if possible.

Parameters:
factory - An object that implements TopicConnectionFactory, XATopicConnectionFactory
username - The username to use or null for no user.
password - The password for the given username or null if no username was specified.
Returns:
A topic connection.
Throws:
javax.jms.JMSException - Failed to create connection.
IllegalArgumentException - Factory is null or invalid.

createTopicConnection

public static javax.jms.TopicConnection createTopicConnection(Object factory)
                                                       throws javax.jms.JMSException
Create a topic connection from the given factory. An XA connection will be created if possible.

Parameters:
factory - An object that implements TopicConnectionFactory, XATopicConnectionFactory
Returns:
A topic connection.
Throws:
javax.jms.JMSException - Failed to create connection.
IllegalArgumentException - Factory is null or invalid.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.