public class ClusterConnectionFactory extends AdministeredObject implements ConnectionFactory
Modifier and Type | Field and Description |
---|---|
protected Hashtable |
cluster |
private static Logger |
logger |
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
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. |
Connection |
createConnection()
Creates a connection with the default user identity.
|
Connection |
createConnection(String name,
String password)
Creates a connection with the specified user identity.
|
JMSContext |
createContext() |
JMSContext |
createContext(int sessionMode) |
JMSContext |
createContext(String userName,
String password) |
JMSContext |
createContext(String userName,
String password,
int sessionMode) |
void |
fromReference(Reference ref)
Restores the administered object from a naming reference.
|
Hashtable |
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.
|
getReference
private static final long serialVersionUID
private static Logger logger
protected Hashtable 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 Connection createConnection() throws JMSException
ConnectionFactory
depending of the
location property, then creates the related Connection
.
API method, see javax.jms.ConnectionFactory.createConnection
in interface ConnectionFactory
JMSSecurityException
- If the default identification is
incorrect.IllegalStateException
- If the server is not listening.JMSException
public final Connection createConnection(String name, String password) throws JMSException
ConnectionFactory
depending of the
location property, then creates the related Connection
.
API method, see javax.jms.ConnectionFactory.createConnection
in interface ConnectionFactory
name
- the caller's user namepassword
- the caller's passwordJMSSecurityException
- If the user identification is incorrect.IllegalStateException
- If the server is not listening.JMSException
public String toString()
public Hashtable getCluster()
public void toReference(Reference ref) throws NamingException
toReference
in class AdministeredObject
NamingException
public void fromReference(Reference ref) throws NamingException
fromReference
in class AdministeredObject
NamingException
public JMSContext createContext()
public JMSContext createContext(String userName, String password)
public JMSContext createContext(String userName, String password, int sessionMode)
public JMSContext createContext(int sessionMode)
Copyright © 2023 ScalAgent D.T.. All rights reserved.