public class ClusterConnectionFactory extends AdministeredObject implements javax.jms.ConnectionFactory
Modifier and Type | Field and Description |
---|---|
protected Hashtable |
cluster |
private static org.objectweb.util.monolog.api.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. |
javax.jms.Connection |
createConnection()
Creates a connection with the default user identity.
|
javax.jms.Connection |
createConnection(String name,
String password)
Creates a connection with the specified user identity.
|
javax.jms.JMSContext |
createContext() |
javax.jms.JMSContext |
createContext(int sessionMode) |
javax.jms.JMSContext |
createContext(String userName,
String password) |
javax.jms.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 org.objectweb.util.monolog.api.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 javax.jms.Connection createConnection() throws javax.jms.JMSException
ConnectionFactory
depending of the
location property, then creates the related Connection
.
API method, see javax.jms.ConnectionFactory.createConnection
in interface javax.jms.ConnectionFactory
javax.jms.JMSSecurityException
- If the default identification is
incorrect.IllegalStateException
- If the server is not listening.javax.jms.JMSException
public final javax.jms.Connection createConnection(String name, String password) throws javax.jms.JMSException
ConnectionFactory
depending of the
location property, then creates the related Connection
.
API method, see javax.jms.ConnectionFactory.createConnection
in interface javax.jms.ConnectionFactory
name
- the caller's user namepassword
- the caller's passwordjavax.jms.JMSSecurityException
- If the user identification is incorrect.IllegalStateException
- If the server is not listening.javax.jms.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 javax.jms.JMSContext createContext()
public javax.jms.JMSContext createContext(String userName, String password, int sessionMode)
public javax.jms.JMSContext createContext(int sessionMode)
Copyright © 2018 ScalAgent D.T.. All Rights Reserved.