Joram 4.3.32

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

java.lang.Object
  extended by org.objectweb.joram.client.jms.admin.AdministeredObject
      extended by org.objectweb.joram.client.jms.admin.ClusterConnectionFactory
All Implemented Interfaces:
fr.dyade.aaa.jndi2.soap.SoapObjectItf, java.io.Serializable, javax.jms.ConnectionFactory, javax.naming.Referenceable

public class ClusterConnectionFactory
extends AdministeredObject
implements javax.jms.ConnectionFactory

A base class for clustered connection factories.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable cluster
           
 
Constructor Summary
ClusterConnectionFactory()
          Constructs an empty clustered connection factory.
 
Method Summary
 void addConnectionFactory(ConnectionFactory cf)
          Adds a connection factory to the cluster.
 void addConnectionFactory(java.lang.String location, ConnectionFactory cf)
          Adds a connection factory to the cluster with the specified location key.
 java.util.Hashtable code()
          Codes a ConnectionFactory as a Hashtable for travelling through the SOAP protocol.
 javax.jms.Connection createConnection()
          Creates a connection with the default user identity.
 javax.jms.Connection createConnection(java.lang.String name, java.lang.String password)
          Creates a 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 fromReference(javax.naming.Reference ref)
          Restores the administered object from a naming reference.
protected  ConnectionFactory getConnectionFactory()
          Chooses a connection factory from the cluster definition.
 void toReference(javax.naming.Reference ref)
          Sets the naming reference of an administered object.
 java.lang.String toString()
          Returns a String image of the object.
 
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, wait, wait, wait
 

Field Detail

cluster

protected java.util.Hashtable cluster
Constructor Detail

ClusterConnectionFactory

public ClusterConnectionFactory()
Constructs an empty clustered connection factory.

Method Detail

addConnectionFactory

public void addConnectionFactory(ConnectionFactory cf)
Adds a connection factory to the cluster. The object will be added with a key equals to the location property. By default, the location value is set to the hostname of corresponding server. Be careful, the object should be rebind after modification.

Parameters:
cf - the ConnectionFactory

addConnectionFactory

public void addConnectionFactory(java.lang.String location,
                                 ConnectionFactory cf)
Adds a connection factory to the cluster with the specified location key. Be careful, the object should be rebind after modification.

Parameters:
location - the location key
cf - the ConnectionFactory

getConnectionFactory

protected ConnectionFactory getConnectionFactory()
                                          throws javax.jms.JMSException
Chooses a connection factory from the cluster definition.

Throws:
javax.jms.JMSException

createConnection

public final javax.jms.Connection createConnection()
                                            throws javax.jms.JMSException
Creates a connection with the default user identity. It chooses a ConnectionFactory depending of the location property, then creates the related Connection. API method, see javax.jms.ConnectionFactory.

Specified by:
createConnection in interface javax.jms.ConnectionFactory
Throws:
JMSSecurityException - If the default identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException

createConnection

public final javax.jms.Connection createConnection(java.lang.String name,
                                                   java.lang.String password)
                                            throws javax.jms.JMSException
Creates a connection with the specified user identity. It chooses a ConnectionFactory depending of the location property, then creates the related Connection. API method, see javax.jms.ConnectionFactory.

Specified by:
createConnection in interface javax.jms.ConnectionFactory
Parameters:
name - the caller's user name
password - the caller's password
Throws:
JMSSecurityException - If the user identification is incorrect.
java.lang.IllegalStateException - If the server is not listening.
javax.jms.JMSException

toString

public java.lang.String toString()
Returns a String image of the object.

Overrides:
toString in class java.lang.Object

toReference

public 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

fromReference

public 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

code

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

Specified by:
code in interface fr.dyade.aaa.jndi2.soap.SoapObjectItf

decode

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

Actual implementation of the method is located in the tcp and soap sub classes.

Specified by:
decode in interface fr.dyade.aaa.jndi2.soap.SoapObjectItf

Joram 4.3.32

Copyright © 2005 Scalagent - All rights reserved