org.apache.qpid.client
Class AMQConnectionFactory

java.lang.Object
  extended by org.apache.qpid.client.AMQConnectionFactory
All Implemented Interfaces:
ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, XAConnectionFactory, XAQueueConnectionFactory, XATopicConnectionFactory, Referenceable, ObjectFactory

public class AMQConnectionFactory
extends Object
implements ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, ObjectFactory, Referenceable, XATopicConnectionFactory, XAQueueConnectionFactory, XAConnectionFactory


Constructor Summary
AMQConnectionFactory()
           
AMQConnectionFactory(ConnectionURL url)
          This constructor is never used!
AMQConnectionFactory(String url)
          This is the Only constructor used! It is used form the context and from the JNDI objects.
AMQConnectionFactory(String host, int port, String virtualPath)
          This constructor is never used!
AMQConnectionFactory(String host, int port, String defaultUsername, String defaultPassword, String virtualPath)
          This constructor is never used!
AMQConnectionFactory(String broker, String username, String password, String clientName, String virtualHost)
          This constructor is never used!
 
Method Summary
 Connection createConnection()
           
 Connection createConnection(String userName, String password)
           
 Connection createConnection(String userName, String password, String id)
           
 QueueConnection createQueueConnection()
           
 QueueConnection createQueueConnection(String username, String password)
           
 TopicConnection createTopicConnection()
           
 TopicConnection createTopicConnection(String username, String password)
           
 XAConnection createXAConnection()
          Creates a XAConnection with the default user identity.
 XAConnection createXAConnection(String username, String password)
          Creates a XAConnection with the specified user identity.
 XAQueueConnection createXAQueueConnection()
          Creates a XAQueueConnection with the default user identity.
 XAQueueConnection createXAQueueConnection(String username, String password)
          Creates a XAQueueConnection with the specified user identity.
 XATopicConnection createXATopicConnection()
          Creates a XATopicConnection with the default user identity.
 XATopicConnection createXATopicConnection(String username, String password)
          Creates a XATopicConnection with the specified user identity.
 ConnectionURL getConnectionURL()
           
 String getConnectionURLString()
           
 String getDefaultPassword(String password)
           
 String getDefaultUsername(String password)
           
 String getHost()
           
 Object getObjectInstance(Object obj, Name name, Context ctx, Hashtable env)
          JNDI interface to create objects from References.
 int getPort()
           
 Reference getReference()
           
 SSLConfiguration getSSLConfiguration()
          Getter for SSLConfiguration
static String getUniqueClientID()
           
 String getVirtualPath()
           
 void setConnectionURLString(String url)
           
 void setDefaultPassword(String password)
           
 void setDefaultUsername(String username)
           
 void setHost(String host)
           
 void setPort(int port)
           
 void setSSLConfiguration(SSLConfiguration sslConfig)
          Setter for SSLConfiguration
 void setVirtualPath(String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMQConnectionFactory

public AMQConnectionFactory()

AMQConnectionFactory

public AMQConnectionFactory(String url)
                     throws org.apache.qpid.url.URLSyntaxException
This is the Only constructor used! It is used form the context and from the JNDI objects.

Throws:
org.apache.qpid.url.URLSyntaxException

AMQConnectionFactory

public AMQConnectionFactory(ConnectionURL url)
This constructor is never used!


AMQConnectionFactory

public AMQConnectionFactory(String broker,
                            String username,
                            String password,
                            String clientName,
                            String virtualHost)
                     throws org.apache.qpid.url.URLSyntaxException
This constructor is never used!

Throws:
org.apache.qpid.url.URLSyntaxException

AMQConnectionFactory

public AMQConnectionFactory(String host,
                            int port,
                            String virtualPath)
This constructor is never used!


AMQConnectionFactory

public AMQConnectionFactory(String host,
                            int port,
                            String defaultUsername,
                            String defaultPassword,
                            String virtualPath)
This constructor is never used!

Method Detail

getDefaultPassword

public final String getDefaultPassword(String password)
Returns:
The _defaultPassword.

setDefaultPassword

public final void setDefaultPassword(String password)
Parameters:
password - The _defaultPassword to set.

getSSLConfiguration

public final SSLConfiguration getSSLConfiguration()
Getter for SSLConfiguration

Returns:
SSLConfiguration if set, otherwise null

setSSLConfiguration

public final void setSSLConfiguration(SSLConfiguration sslConfig)
Setter for SSLConfiguration

Parameters:
sslConfig - config to store

getDefaultUsername

public final String getDefaultUsername(String password)
Returns:
The _defaultPassword.

setDefaultUsername

public final void setDefaultUsername(String username)
Parameters:
username - The _defaultUsername to set.

getHost

public final String getHost()
Returns:
The _host .

setHost

public final void setHost(String host)
Parameters:
host - The _host to set.

getPort

public final int getPort()
Returns:
_port The _port to set.

setPort

public final void setPort(int port)
Parameters:
port - The port to set.

getVirtualPath

public final String getVirtualPath()
Returns:
he _virtualPath.

setVirtualPath

public final void setVirtualPath(String path)
Parameters:
path - The _virtualPath to set.

getUniqueClientID

public static String getUniqueClientID()

createConnection

public Connection createConnection()
                            throws JMSException
Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createConnection

public Connection createConnection(String userName,
                                   String password)
                            throws JMSException
Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createConnection

public Connection createConnection(String userName,
                                   String password,
                                   String id)
                            throws JMSException
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection()
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection(String username,
                                             String password)
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection()
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection(String username,
                                             String password)
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

getConnectionURL

public ConnectionURL getConnectionURL()

getConnectionURLString

public String getConnectionURLString()

setConnectionURLString

public final void setConnectionURLString(String url)
                                  throws org.apache.qpid.url.URLSyntaxException
Throws:
org.apache.qpid.url.URLSyntaxException

getObjectInstance

public Object getObjectInstance(Object obj,
                                Name name,
                                Context ctx,
                                Hashtable env)
                         throws Exception
JNDI interface to create objects from References.

Specified by:
getObjectInstance in interface ObjectFactory
Parameters:
obj - The Reference from JNDI
name -
ctx -
env -
Returns:
AMQConnection,AMQTopic,AMQQueue, or AMQConnectionFactory.
Throws:
Exception

getReference

public Reference getReference()
                       throws NamingException
Specified by:
getReference in interface Referenceable
Throws:
NamingException

createXAConnection

public XAConnection createXAConnection()
                                throws JMSException
Creates a XAConnection with the default user identity.

The XAConnection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Specified by:
createXAConnection in interface XAConnectionFactory
Returns:
A newly created XAConnection
Throws:
JMSException - If creating the XAConnection fails due to some internal error.
JMSSecurityException - If client authentication fails due to an invalid user name or password.

createXAConnection

public XAConnection createXAConnection(String username,
                                       String password)
                                throws JMSException
Creates a XAConnection with the specified user identity.

The XAConnection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Specified by:
createXAConnection in interface XAConnectionFactory
Parameters:
username - the caller's user name
password - the caller's password
Returns:
A newly created XAConnection.
Throws:
JMSException - If creating the XAConnection fails due to some internal error.
JMSSecurityException - If client authentication fails due to an invalid user name or password.

createXATopicConnection

public XATopicConnection createXATopicConnection()
                                          throws JMSException
Creates a XATopicConnection with the default user identity.

The XATopicConnection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Specified by:
createXATopicConnection in interface XATopicConnectionFactory
Returns:
A newly created XATopicConnection
Throws:
JMSException - If creating the XATopicConnection fails due to some internal error.
JMSSecurityException - If client authentication fails due to an invalid user name or password.

createXATopicConnection

public XATopicConnection createXATopicConnection(String username,
                                                 String password)
                                          throws JMSException
Creates a XATopicConnection with the specified user identity.

The XATopicConnection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Specified by:
createXATopicConnection in interface XATopicConnectionFactory
Parameters:
username - the caller's user name
password - the caller's password
Returns:
A newly created XATopicConnection.
Throws:
JMSException - If creating the XATopicConnection fails due to some internal error.
JMSSecurityException - If client authentication fails due to an invalid user name or password.

createXAQueueConnection

public XAQueueConnection createXAQueueConnection()
                                          throws JMSException
Creates a XAQueueConnection with the default user identity.

The XAQueueConnection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Specified by:
createXAQueueConnection in interface XAQueueConnectionFactory
Returns:
A newly created XAQueueConnection
Throws:
JMSException - If creating the XAQueueConnection fails due to some internal error.
JMSSecurityException - If client authentication fails due to an invalid user name or password.

createXAQueueConnection

public XAQueueConnection createXAQueueConnection(String username,
                                                 String password)
                                          throws JMSException
Creates a XAQueueConnection with the specified user identity.

The XAQueueConnection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Specified by:
createXAQueueConnection in interface XAQueueConnectionFactory
Parameters:
username - the caller's user name
password - the caller's password
Returns:
A newly created XAQueueConnection.
Throws:
JMSException - If creating the XAQueueConnection fails due to some internal error.
JMSSecurityException - If client authentication fails due to an invalid user name or password.


Licensed to the Apache Software Foundation