public class ClusterConnectionFactory extends AdministeredObject implements jakarta.jms.ConnectionFactory
| Modifier and Type | Field and Description |
|---|---|
protected Hashtable<String,ConnectionFactory> |
cluster |
private static org.objectweb.util.monolog.api.Logger |
logger |
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
rand| Constructor and Description |
|---|
ClusterConnectionFactory()
Constructs an empty clustered connection factory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionFactory(ConnectionFactory cf)
Adds a connection factory to the cluster.
|
void |
addConnectionFactory(String location,
ConnectionFactory cf)
Adds a connection factory to the cluster with the specified
location key. |
jakarta.jms.Connection |
createConnection()
Creates a connection with the default user identity.
|
jakarta.jms.Connection |
createConnection(String name,
String password)
Creates a connection with the specified user identity.
|
jakarta.jms.JMSContext |
createContext() |
jakarta.jms.JMSContext |
createContext(int sessionMode) |
jakarta.jms.JMSContext |
createContext(String userName,
String password) |
jakarta.jms.JMSContext |
createContext(String userName,
String password,
int sessionMode) |
void |
fromReference(Reference ref)
Restores the administered object from a naming reference.
|
Hashtable<String,ConnectionFactory> |
getCluster() |
protected ConnectionFactory |
getConnectionFactory()
Chooses a connection factory from the cluster definition.
|
void |
toReference(Reference ref)
Sets the naming reference of an administered object.
|
String |
toString()
Returns a String image of the object.
|
getReferenceprivate static final long serialVersionUID
private static final org.objectweb.util.monolog.api.Logger logger
protected Hashtable<String,ConnectionFactory> cluster
public ClusterConnectionFactory()
public void addConnectionFactory(ConnectionFactory cf)
cf - the ConnectionFactorypublic void addConnectionFactory(String location, ConnectionFactory cf)
location key.
Be careful, the object should be rebind after modification.location - the location keycf - the ConnectionFactoryprotected ConnectionFactory getConnectionFactory()
public final jakarta.jms.Connection createConnection()
throws jakarta.jms.JMSException
ConnectionFactory depending of the
location property, then creates the related Connection.
API method, see jakarta.jms.ConnectionFactory.createConnection in interface jakarta.jms.ConnectionFactoryjakarta.jms.JMSSecurityException - If the default identification is
incorrect.IllegalStateException - If the server is not listening.jakarta.jms.JMSExceptionpublic final jakarta.jms.Connection createConnection(String name, String password) throws jakarta.jms.JMSException
ConnectionFactory depending of the
location property, then creates the related Connection.
API method, see jakarta.jms.ConnectionFactory.createConnection in interface jakarta.jms.ConnectionFactoryname - the caller's user namepassword - the caller's passwordjakarta.jms.JMSSecurityException - If the user identification is incorrect.IllegalStateException - If the server is not listening.jakarta.jms.JMSExceptionpublic String toString()
public Hashtable<String,ConnectionFactory> getCluster()
public void toReference(Reference ref) throws NamingException
toReference in class AdministeredObjectNamingExceptionpublic void fromReference(Reference ref) throws NamingException
fromReference in class AdministeredObjectNamingExceptionpublic jakarta.jms.JMSContext createContext()
createContext in interface jakarta.jms.ConnectionFactorypublic jakarta.jms.JMSContext createContext(String userName, String password)
createContext in interface jakarta.jms.ConnectionFactorypublic jakarta.jms.JMSContext createContext(String userName, String password, int sessionMode)
createContext in interface jakarta.jms.ConnectionFactorypublic jakarta.jms.JMSContext createContext(int sessionMode)
createContext in interface jakarta.jms.ConnectionFactoryCopyright © 2023 ScalAgent D.T.. All rights reserved.