org.jboss.jms
Class ConnectionFactoryHelper

java.lang.Object
  extended byorg.jboss.jms.ConnectionFactoryHelper

public class ConnectionFactoryHelper
extends java.lang.Object

A helper for creating connections from jms connection factories.


Constructor Summary
ConnectionFactoryHelper()
           
 
Method Summary
static Connection (src) createConnection(java.lang.Object factory)
          Create a connection from the given factory.
static Connection (src) createConnection(java.lang.Object factory, java.lang.String username, java.lang.String password)
          Create a connection from the given factory.
static QueueConnection (src) createQueueConnection(java.lang.Object factory)
          Create a queue connection from the given factory.
static QueueConnection (src) createQueueConnection(java.lang.Object factory, java.lang.String username, java.lang.String password)
          Create a queue connection from the given factory.
static TopicConnection (src) createTopicConnection(java.lang.Object factory)
          Create a topic connection from the given factory.
static TopicConnection (src) createTopicConnection(java.lang.Object factory, java.lang.String username, java.lang.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 Connection (src)  createConnection(java.lang.Object factory,
                                          java.lang.String username,
                                          java.lang.String password)
                                   throws JMSException (src) 
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:
JMSException (src) - Failed to create connection.
java.lang.IllegalArgumentException - Factory is null or invalid.

createConnection

public static Connection (src)  createConnection(java.lang.Object factory)
                                   throws JMSException (src) 
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:
JMSException (src) - Failed to create connection.
java.lang.IllegalArgumentException - Factory is null or invalid.

createQueueConnection

public static QueueConnection (src)  createQueueConnection(java.lang.Object factory,
                                                    java.lang.String username,
                                                    java.lang.String password)
                                             throws JMSException (src) 
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:
JMSException (src) - Failed to create connection.
java.lang.IllegalArgumentException - Factory is null or invalid.

createQueueConnection

public static QueueConnection (src)  createQueueConnection(java.lang.Object factory)
                                             throws JMSException (src) 
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:
JMSException (src) - Failed to create connection.
java.lang.IllegalArgumentException - Factory is null or invalid.

createTopicConnection

public static TopicConnection (src)  createTopicConnection(java.lang.Object factory,
                                                    java.lang.String username,
                                                    java.lang.String password)
                                             throws JMSException (src) 
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:
JMSException (src) - Failed to create connection.
java.lang.IllegalArgumentException - Factory is null or invalid.

createTopicConnection

public static TopicConnection (src)  createTopicConnection(java.lang.Object factory)
                                             throws JMSException (src) 
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:
JMSException (src) - Failed to create connection.
java.lang.IllegalArgumentException - Factory is null or invalid.