org.objectweb.joram.client.jms.admin
Class AbstractConnectionFactory

java.lang.Object
  extended by org.objectweb.joram.client.jms.admin.AdministeredObject
      extended by org.objectweb.joram.client.jms.admin.AbstractConnectionFactory
All Implemented Interfaces:
SoapObjectItf, java.io.Serializable, javax.naming.Referenceable
Direct Known Subclasses:
ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, XAConnectionFactory, XAQueueConnectionFactory, XATopicConnectionFactory

public abstract class AbstractConnectionFactory
extends AdministeredObject

Implements the javax.jms.ConnectionFactory interface.

See Also:
Serialized Form

Field Summary
(package private) static java.lang.String dfltLogin
          Default login name for connection, default value is "anonymous".
(package private) static java.lang.String dfltPassword
          Default login password for connection, default value is "anonymous".
(package private) static java.lang.String dfltRootLogin
          Default administrator login name for connection, default value is "root".
(package private) static java.lang.String dfltRootPassword
          Default administrator login password for connection, default value is "root".
(package private) static java.lang.String dfltServerHost
          Default server's hostname for connection, default value is "localhost".
(package private) static int dfltServerPort
          Default server's port for connection, default value is 16010.
protected  Identity identity
          Authentication identity.
protected  java.lang.String identityClassName
           
private  boolean isSetIdentityClassName
           
private static org.objectweb.util.monolog.api.Logger logger
           
protected  FactoryParameters params
          Object containing the factory's parameters.
protected  java.lang.String reliableClass
          Reliable class name, for example use by ssl.
 
Constructor Summary
AbstractConnectionFactory()
          Constructs an empty ConnectionFactory.
AbstractConnectionFactory(java.lang.String url)
          Constructs a ConnectionFactory dedicated to a given server.
AbstractConnectionFactory(java.lang.String host, int port)
          Constructs a ConnectionFactory dedicated to a given server.
 
Method Summary
 java.util.Hashtable code()
          Codes a ConnectionFactory as a Hashtable for traveling through the SOAP protocol.
 java.util.Hashtable code(java.util.Hashtable h, java.lang.String prefix)
           
 javax.jms.Connection createConnection()
          API method, creates a connection with the default user identity.
 javax.jms.Connection createConnection(java.lang.String name, java.lang.String password)
          API method, creates a connection with the specified user identity.
 javax.jms.QueueConnection createQueueConnection()
          API method, creates a queue connection with the default user identity.
 javax.jms.QueueConnection createQueueConnection(java.lang.String name, java.lang.String password)
          API method, creates a queue connection with the specified user identity.
protected abstract  RequestChannel createRequestChannel(FactoryParameters params, Identity identity, java.lang.String reliableClass)
          Creates the RequestChannel object specific to the protocol used.
 javax.jms.TopicConnection createTopicConnection()
          API method, creates a topic connection with the default user identity.
 javax.jms.TopicConnection createTopicConnection(java.lang.String name, java.lang.String password)
          API method, creates a topic connection with the specified user identity.
 javax.jms.XAConnection createXAConnection()
          API method, creates an XA connection with the default user identity.
 javax.jms.XAConnection createXAConnection(java.lang.String name, java.lang.String password)
          API method, creates an XA connection with the specified user identity.
 javax.jms.XAQueueConnection createXAQueueConnection()
          API method, creates an XA queue connection with the default user identity.
 javax.jms.XAQueueConnection createXAQueueConnection(java.lang.String name, java.lang.String password)
          API method, creates an XA queue connection with the specified user identity.
 javax.jms.XATopicConnection createXATopicConnection()
          API method, creates an XA topic connection with the default user identity.
 javax.jms.XATopicConnection createXATopicConnection(java.lang.String name, java.lang.String password)
          API method, creates an XA topic connection with the specified user identity.
 void decode(java.util.Hashtable h)
          Implements the decode abstract method defined in the fr.dyade.aaa.jndi2.soap.SoapObjectItf interface.
 void decode(java.util.Hashtable h, java.lang.String prefix)
           
 void fromReference(javax.naming.Reference ref)
          Restores the administered object from a naming reference.
 void fromReference(javax.naming.Reference ref, java.lang.String prefix)
          Restores the administered object from a clustered naming reference.
static java.lang.String getDefaultLogin()
          Returns default login name for connection.
static java.lang.String getDefaultPassword()
          Returns the default login password for connection.
static java.lang.String getDefaultRootLogin()
          Returns default administrator login name for connection.
static java.lang.String getDefaultRootPassword()
          Returns the default administrator login password for connection.
static java.lang.String getDefaultServerHost()
          Returns default server's hostname for connection.
static int getDefaultServerPort()
          Returns default server's port for connection.
 FactoryParameters getParameters()
          Returns the factory's configuration parameters.
protected  void initIdentity(java.lang.String user, java.lang.String passwd)
          initialize the user identity.
 void setIdentityClassName(java.lang.String identityClassName)
          set indentity class name
 void setReliableClass(java.lang.String reliableClass)
           
 void toReference(javax.naming.Reference ref)
          Sets the naming reference of an administered object.
 void toReference(javax.naming.Reference ref, java.lang.String prefix)
          Sets the clustered naming reference of a connection factory.
 
Methods inherited from class org.objectweb.joram.client.jms.admin.AdministeredObject
getReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.objectweb.util.monolog.api.Logger logger

params

protected FactoryParameters params
Object containing the factory's parameters.


reliableClass

protected java.lang.String reliableClass
Reliable class name, for example use by ssl.


identity

protected Identity identity
Authentication identity.


identityClassName

protected java.lang.String identityClassName

isSetIdentityClassName

private boolean isSetIdentityClassName

dfltServerHost

static final java.lang.String dfltServerHost
Default server's hostname for connection, default value is "localhost". This value can be adjusted through the JoramDfltServerHost property.

See Also:
Constant Field Values

dfltServerPort

static final int dfltServerPort
Default server's port for connection, default value is 16010. This value can be adjusted through the JoramDfltServerPort property.

See Also:
Constant Field Values

dfltRootLogin

static final java.lang.String dfltRootLogin
Default administrator login name for connection, default value is "root". This value can be adjusted through the JoramDfltRootLogin property.

See Also:
Constant Field Values

dfltRootPassword

static final java.lang.String dfltRootPassword
Default administrator login password for connection, default value is "root". This value can be adjusted through the JoramDfltRootPassword property.

See Also:
Constant Field Values

dfltLogin

static final java.lang.String dfltLogin
Default login name for connection, default value is "anonymous". This value can be adjusted through the JoramDfltLogin property.

See Also:
Constant Field Values

dfltPassword

static final java.lang.String dfltPassword
Default login password for connection, default value is "anonymous". This value can be adjusted through the JoramDfltPassword property.

See Also:
Constant Field Values
Constructor Detail

AbstractConnectionFactory

public AbstractConnectionFactory(java.lang.String host,
                                 int port)
Constructs a ConnectionFactory dedicated to a given server.

Parameters:
host - Name or IP address of the server's host.
port - Server's listening port.

AbstractConnectionFactory

public AbstractConnectionFactory(java.lang.String url)
Constructs a ConnectionFactory dedicated to a given server.

Parameters:
url - joram ha url.

AbstractConnectionFactory

public AbstractConnectionFactory()
Constructs an empty ConnectionFactory. Needed by ObjectFactory.

Method Detail

setIdentityClassName

public void setIdentityClassName(java.lang.String identityClassName)
set indentity class name

Parameters:
identityClassName - default Identity.SIMPLE_IDENTITY_CLASS (user/passwd).

initIdentity

protected void initIdentity(java.lang.String user,
                            java.lang.String passwd)
                     throws javax.jms.JMSException
initialize the user identity.

Parameters:
user - user name
passwd - user password
Throws:
javax.jms.JMSException

setReliableClass

public void setReliableClass(java.lang.String reliableClass)

getDefaultServerHost

public static java.lang.String getDefaultServerHost()
Returns default server's hostname for connection. Default value "localhost" can be adjusted by setting the JoramDfltServerHost property.


getDefaultServerPort

public static int getDefaultServerPort()
Returns default server's port for connection. Default value 16010 can be adjusted by setting the JoramDfltServerPort property.


getDefaultRootLogin

public static java.lang.String getDefaultRootLogin()
Returns default administrator login name for connection. Default value "root" can be adjusted by setting the JoramDfltRootLogin property.


getDefaultRootPassword

public static java.lang.String getDefaultRootPassword()
Returns the default administrator login password for connection. Default value "root" can be adjusted by setting the JoramDfltRootPassword property.


getDefaultLogin

public static java.lang.String getDefaultLogin()
Returns default login name for connection. Default value "anonymous" can be adjusted by setting the JoramDfltLogin property.


getDefaultPassword

public static java.lang.String getDefaultPassword()
Returns the default login password for connection. Default value "anonymous" can be adjusted by setting the JoramDfltPassword property.


getParameters

public FactoryParameters getParameters()
Returns the factory's configuration parameters.


createRequestChannel

protected abstract RequestChannel createRequestChannel(FactoryParameters params,
                                                       Identity identity,
                                                       java.lang.String reliableClass)
                                                throws javax.jms.JMSException
Creates the RequestChannel object specific to the protocol used.

Parameters:
params - Connection configuration parameters.
identity - Client's identity.
reliableClass - The protocol specific class.
Returns:
The RequestChannel object specific to the protocol used.
Throws:
javax.jms.JMSException - A problem occurs during the connection.

createConnection

public javax.jms.Connection createConnection()
                                      throws javax.jms.JMSException
API method, creates a connection with the default user identity. The connection is created in stopped mode.

Returns:
a newly created connection.
Throws:
javax.jms.JMSSecurityException - If the default identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
ConnectionFactory.createConnection()

createConnection

public javax.jms.Connection createConnection(java.lang.String name,
                                             java.lang.String password)
                                      throws javax.jms.JMSException
API method, creates a connection with the specified user identity. The connection is created in stopped mode.

Parameters:
name - the caller's user name.
password - the caller's password.
Returns:
a newly created connection.
Throws:
javax.jms.JMSSecurityException - If the user identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
ConnectionFactory.createConnection(String, String)

createQueueConnection

public javax.jms.QueueConnection createQueueConnection()
                                                throws javax.jms.JMSException
API method, creates a queue connection with the default user identity. The connection is created in stopped mode.

Returns:
a newly created queue connection.
Throws:
javax.jms.JMSSecurityException - If the default identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
QueueConnectionFactory.createQueueConnection()

createQueueConnection

public javax.jms.QueueConnection createQueueConnection(java.lang.String name,
                                                       java.lang.String password)
                                                throws javax.jms.JMSException
API method, creates a queue connection with the specified user identity. The connection is created in stopped mode.

Parameters:
name - the caller's user name.
password - the caller's password.
Returns:
a newly created queue connection.
Throws:
javax.jms.JMSSecurityException - If the user identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
QueueConnectionFactory.createQueueConnection(String, String)

createTopicConnection

public javax.jms.TopicConnection createTopicConnection()
                                                throws javax.jms.JMSException
API method, creates a topic connection with the default user identity. The connection is created in stopped mode.

Returns:
a newly created topic connection.
Throws:
javax.jms.JMSSecurityException - If the default identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
TopicConnectionFactory.createTopicConnection()

createTopicConnection

public javax.jms.TopicConnection createTopicConnection(java.lang.String name,
                                                       java.lang.String password)
                                                throws javax.jms.JMSException
API method, creates a topic connection with the specified user identity. The connection is created in stopped mode.

Parameters:
name - the caller's user name.
password - the caller's password.
Returns:
a newly created topic connection.
Throws:
javax.jms.JMSSecurityException - If the user identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
TopicConnectionFactory.createTopicConnection(String, String)

createXAConnection

public javax.jms.XAConnection createXAConnection()
                                          throws javax.jms.JMSException
API method, creates an XA connection with the default user identity. The connection is created in stopped mode.

Returns:
a newly created XA connection..
Throws:
javax.jms.JMSSecurityException - If the default identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
XAConnectionFactory.createXAConnection()

createXAConnection

public javax.jms.XAConnection createXAConnection(java.lang.String name,
                                                 java.lang.String password)
                                          throws javax.jms.JMSException
API method, creates an XA connection with the specified user identity. The connection is created in stopped mode.

Parameters:
name - the caller's user name.
password - the caller's password.
Returns:
a newly created XA connection.
Throws:
javax.jms.JMSSecurityException - If the user identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
XAConnectionFactory.createXAConnection(String, String)

createXAQueueConnection

public javax.jms.XAQueueConnection createXAQueueConnection()
                                                    throws javax.jms.JMSException
API method, creates an XA queue connection with the default user identity. The connection is created in stopped mode.

Returns:
a newly created XA queue connection..
Throws:
javax.jms.JMSSecurityException - If the default identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
XAQueueConnectionFactory.createXAQueueConnection()

createXAQueueConnection

public javax.jms.XAQueueConnection createXAQueueConnection(java.lang.String name,
                                                           java.lang.String password)
                                                    throws javax.jms.JMSException
API method, creates an XA queue connection with the specified user identity. The connection is created in stopped mode.

Parameters:
name - the caller's user name.
password - the caller's password.
Returns:
a newly created XA queue connection.
Throws:
javax.jms.JMSSecurityException - If the user identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
XAQueueConnectionFactory.createXAQueueConnection(String, String)

createXATopicConnection

public javax.jms.XATopicConnection createXATopicConnection()
                                                    throws javax.jms.JMSException
API method, creates an XA topic connection with the default user identity. The connection is created in stopped mode.

Returns:
a newly created XA topic connection..
Throws:
javax.jms.JMSSecurityException - If the default identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
XATopicConnectionFactory.createXATopicConnection()

createXATopicConnection

public javax.jms.XATopicConnection createXATopicConnection(java.lang.String name,
                                                           java.lang.String password)
                                                    throws javax.jms.JMSException
API method, creates an XA topic connection with the specified user identity. The connection is created in stopped mode.

Parameters:
name - the caller's user name.
password - the caller's password.
Returns:
a newly created XA topic connection.
Throws:
javax.jms.JMSSecurityException - If the user identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException
See Also:
XATopicConnectionFactory.createXATopicConnection(String, String)

toReference

public final void toReference(javax.naming.Reference ref)
                       throws javax.naming.NamingException
Sets the naming reference of an administered object.

Specified by:
toReference in class AdministeredObject
Throws:
javax.naming.NamingException

toReference

public void toReference(javax.naming.Reference ref,
                        java.lang.String prefix)
Sets the clustered naming reference of a connection factory.


fromReference

public final void fromReference(javax.naming.Reference ref)
                         throws javax.naming.NamingException
Restores the administered object from a naming reference.

Specified by:
fromReference in class AdministeredObject
Throws:
javax.naming.NamingException

fromReference

public void fromReference(javax.naming.Reference ref,
                          java.lang.String prefix)
Restores the administered object from a clustered naming reference.


code

public java.util.Hashtable code()
Codes a ConnectionFactory as a Hashtable for traveling through the SOAP protocol.


code

public java.util.Hashtable code(java.util.Hashtable h,
                                java.lang.String prefix)

decode

public void decode(java.util.Hashtable h)
Implements the decode abstract method defined in the fr.dyade.aaa.jndi2.soap.SoapObjectItf interface.


decode

public void decode(java.util.Hashtable h,
                   java.lang.String prefix)


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.