Class AbstractConnectionFactory
- java.lang.Object
-
- org.objectweb.joram.client.jms.admin.AdministeredObject
-
- org.objectweb.joram.client.jms.admin.AbstractConnectionFactory
-
- All Implemented Interfaces:
Serializable,Referenceable
- Direct Known Subclasses:
ConnectionFactory,QueueConnectionFactory,TopicConnectionFactory,XAConnectionFactory,XAQueueConnectionFactory,XATopicConnectionFactory
public abstract class AbstractConnectionFactory extends AdministeredObject
Implements thejavax.jms.ConnectionFactoryinterface.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private StringcnxJMXBeanBaseName(package private) static StringdfltLoginDefault login name for connection, default value is "anonymous".(package private) static StringdfltPasswordDefault login password for connection, default value is "anonymous".(package private) static StringdfltRootLoginDefault administrator login name for connection, default value is "root".(package private) static StringdfltRootPasswordDefault administrator login password for connection, default value is "root".(package private) static StringdfltServerHostDefault server's hostname for connection, default value is "localhost".(package private) static intdfltServerPortDefault server's port for connection, default value is 16010.protected org.objectweb.joram.shared.security.IdentityidentityAuthentication identity.protected StringidentityClassNameprivate booleanisSetIdentityClassNameprivate static org.objectweb.util.monolog.api.Loggerloggerprotected FactoryParametersparamsObject containing the factory's parameters.protected StringreliableClassReliable class name, for example use by ssl.private static longserialVersionUIDdefine serialVersionUID for interoperability, fix with 5.15.0 value-
Fields inherited from class org.objectweb.joram.client.jms.admin.AdministeredObject
rand
-
-
Constructor Summary
Constructors Constructor Description AbstractConnectionFactory()Constructs an emptyConnectionFactory.AbstractConnectionFactory(String url)Constructs aConnectionFactorydedicated to a given server.AbstractConnectionFactory(String host, int port)Constructs aConnectionFactorydedicated to a given server.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ConnectioncreateConnection()API method, creates a connection with the default user identity.ConnectioncreateConnection(String name, String password)API method, creates a connection with the specified user identity.JMSContextcreateContext()JMS2.0 API method.JMSContextcreateContext(int mode)JMS2.0 API method.JMSContextcreateContext(String userName, String password)JMS2.0 API method.JMSContextcreateContext(String userName, String password, int mode)JMS2.0 API method.QueueConnectioncreateQueueConnection()API method, creates a queue connection with the default user identity.QueueConnectioncreateQueueConnection(String name, String password)API method, creates a queue connection with the specified user identity.protected abstract RequestChannelcreateRequestChannel(FactoryParameters params, org.objectweb.joram.shared.security.Identity identity, String reliableClass)Creates theRequestChannelobject specific to the protocol used.TopicConnectioncreateTopicConnection()API method, creates a topic connection with the default user identity.TopicConnectioncreateTopicConnection(String name, String password)API method, creates a topic connection with the specified user identity.XAConnectioncreateXAConnection()API method, creates an XA connection with the default user identity.XAConnectioncreateXAConnection(String name, String password)API method, creates an XA connection with the specified user identity.XAJMSContextcreateXAContext()JMS2.0 API method.XAJMSContextcreateXAContext(String userName, String password)JMS2.0 API method.XAQueueConnectioncreateXAQueueConnection()API method, creates an XA queue connection with the default user identity.XAQueueConnectioncreateXAQueueConnection(String name, String password)API method, creates an XA queue connection with the specified user identity.XATopicConnectioncreateXATopicConnection()API method, creates an XA topic connection with the default user identity.XATopicConnectioncreateXATopicConnection(String name, String password)API method, creates an XA topic connection with the specified user identity.voidfromReference(Reference ref)Restores the administered object from a naming reference.voidfromReference(Reference ref, String prefix)Restores the administered object from a clustered naming reference.static StringgetDefaultLogin()Returns default login name for connection.static StringgetDefaultPassword()Returns the default login password for connection.static StringgetDefaultRootLogin()Returns default administrator login name for connection.static StringgetDefaultRootPassword()Returns the default administrator login password for connection.static StringgetDefaultServerHost()Returns default server's hostname for connection.static intgetDefaultServerPort()Returns default server's port for connection.FactoryParametersgetParameters()Returns the factory's configuration parameters.protected voidinitIdentity(String user, String passwd)initialize the user identity.voidsetCnxJMXBeanBaseName(String base)voidsetIdentityClassName(String identityClassName)set indentity class namevoidsetReliableClass(String reliableClass)voidtoReference(Reference ref)Sets the naming reference of an administered object.voidtoReference(Reference ref, String prefix)Sets the clustered naming reference of a connection factory.-
Methods inherited from class org.objectweb.joram.client.jms.admin.AdministeredObject
getReference
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability, fix with 5.15.0 value- See Also:
- Constant Field Values
-
logger
private static org.objectweb.util.monolog.api.Logger logger
-
params
protected FactoryParameters params
Object containing the factory's parameters.
-
reliableClass
protected String reliableClass
Reliable class name, for example use by ssl.
-
identity
protected org.objectweb.joram.shared.security.Identity identity
Authentication identity.
-
identityClassName
protected String identityClassName
-
isSetIdentityClassName
private boolean isSetIdentityClassName
-
dfltServerHost
static final 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 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 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 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 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
-
cnxJMXBeanBaseName
private String cnxJMXBeanBaseName
-
-
Constructor Detail
-
AbstractConnectionFactory
public AbstractConnectionFactory(String host, int port)
Constructs aConnectionFactorydedicated to a given server.- Parameters:
host- Name or IP address of the server's host.port- Server's listening port.
-
AbstractConnectionFactory
public AbstractConnectionFactory(String url)
Constructs aConnectionFactorydedicated to a given server.- Parameters:
url- joram ha url.
-
AbstractConnectionFactory
public AbstractConnectionFactory()
Constructs an emptyConnectionFactory. Needed by ObjectFactory.
-
-
Method Detail
-
setIdentityClassName
public void setIdentityClassName(String identityClassName)
set indentity class name- Parameters:
identityClassName- default Identity.SIMPLE_IDENTITY_CLASS (user/passwd).
-
initIdentity
protected void initIdentity(String user, String passwd) throws JMSException
initialize the user identity.- Parameters:
user- user namepasswd- user password- Throws:
JMSException
-
setReliableClass
public void setReliableClass(String reliableClass)
-
getDefaultServerHost
public static 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 String getDefaultRootLogin()
Returns default administrator login name for connection. Default value "root" can be adjusted by setting the JoramDfltRootLogin property.
-
getDefaultRootPassword
public static String getDefaultRootPassword()
Returns the default administrator login password for connection. Default value "root" can be adjusted by setting the JoramDfltRootPassword property.
-
getDefaultLogin
public static String getDefaultLogin()
Returns default login name for connection. Default value "anonymous" can be adjusted by setting the JoramDfltLogin property.
-
getDefaultPassword
public static 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.
-
setCnxJMXBeanBaseName
public void setCnxJMXBeanBaseName(String base)
-
createRequestChannel
protected abstract RequestChannel createRequestChannel(FactoryParameters params, org.objectweb.joram.shared.security.Identity identity, String reliableClass) throws JMSException
Creates theRequestChannelobject specific to the protocol used.- Parameters:
params- Connection configuration parameters.identity- Client's identity.reliableClass- The protocol specific class.- Returns:
- The
RequestChannelobject specific to the protocol used. - Throws:
JMSException- A problem occurs during the connection.
-
createConnection
public Connection createConnection() throws JMSException
API method, creates a connection with the default user identity. The connection is created in stopped mode.- Returns:
- a newly created connection.
- Throws:
JMSSecurityException- If the default identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
ConnectionFactory.createConnection()
-
createConnection
public Connection createConnection(String name, String password) throws 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:
JMSSecurityException- If the user identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
ConnectionFactory.createConnection(String, String)
-
createQueueConnection
public QueueConnection createQueueConnection() throws 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:
JMSSecurityException- If the default identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
QueueConnectionFactory.createQueueConnection()
-
createQueueConnection
public QueueConnection createQueueConnection(String name, String password) throws 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:
JMSSecurityException- If the user identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
QueueConnectionFactory.createQueueConnection(String, String)
-
createTopicConnection
public TopicConnection createTopicConnection() throws 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:
JMSSecurityException- If the default identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
TopicConnectionFactory.createTopicConnection()
-
createTopicConnection
public TopicConnection createTopicConnection(String name, String password) throws 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:
JMSSecurityException- If the user identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
TopicConnectionFactory.createTopicConnection(String, String)
-
createXAConnection
public XAConnection createXAConnection() throws 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:
JMSSecurityException- If the default identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
XAConnectionFactory.createXAConnection()
-
createXAConnection
public XAConnection createXAConnection(String name, String password) throws 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:
JMSSecurityException- If the user identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
XAConnectionFactory.createXAConnection(String, String)
-
createXAQueueConnection
public XAQueueConnection createXAQueueConnection() throws 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:
JMSSecurityException- If the default identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
XAQueueConnectionFactory.createXAQueueConnection()
-
createXAQueueConnection
public XAQueueConnection createXAQueueConnection(String name, String password) throws 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:
JMSSecurityException- If the user identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
XAQueueConnectionFactory.createXAQueueConnection(String, String)
-
createXATopicConnection
public XATopicConnection createXATopicConnection() throws 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:
JMSSecurityException- If the default identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
XATopicConnectionFactory.createXATopicConnection()
-
createXATopicConnection
public XATopicConnection createXATopicConnection(String name, String password) throws 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:
JMSSecurityException- If the user identification is incorrect.IllegalStateException- If the server is not listening.JMSException- See Also:
XATopicConnectionFactory.createXATopicConnection(String, String)
-
toReference
public final void toReference(Reference ref) throws NamingException
Sets the naming reference of an administered object.- Specified by:
toReferencein classAdministeredObject- Throws:
NamingException
-
toReference
public void toReference(Reference ref, String prefix)
Sets the clustered naming reference of a connection factory.
-
fromReference
public final void fromReference(Reference ref) throws NamingException
Restores the administered object from a naming reference.- Specified by:
fromReferencein classAdministeredObject- Throws:
NamingException
-
fromReference
public void fromReference(Reference ref, String prefix)
Restores the administered object from a clustered naming reference.
-
createContext
public JMSContext createContext()
JMS2.0 API method.
-
createContext
public JMSContext createContext(int mode)
JMS2.0 API method.
-
createContext
public JMSContext createContext(String userName, String password)
JMS2.0 API method.
-
createContext
public JMSContext createContext(String userName, String password, int mode)
JMS2.0 API method.
-
createXAContext
public XAJMSContext createXAContext()
JMS2.0 API method.
-
createXAContext
public XAJMSContext createXAContext(String userName, String password)
JMS2.0 API method.
-
-