org.objectweb.joram.mom.dest.jms
Class JMSModule

java.lang.Object
  extended by org.objectweb.joram.mom.dest.jms.JMSModule
All Implemented Interfaces:
javax.jms.ExceptionListener
Direct Known Subclasses:
JMSAcquisition, JMSDistribution

public class JMSModule
extends java.lang.Object
implements javax.jms.ExceptionListener


Nested Class Summary
protected  class JMSModule.ReconnectionDaemon
          The ReconnectionDaemon thread is responsible for reconnecting the bridge module with the foreign JMS server in case of disconnection.
protected  class JMSModule.StartupDaemon
          The StartupDaemon thread is responsible for retrieving the needed JMS administered objects from the JNDI server.
protected  class JMSModule.XARecoverDaemon
           
 
Field Summary
protected  java.lang.String clientID
          JMS clientID field.
protected  javax.jms.Connection cnx
          Connection to the foreign JMS server.
protected  javax.jms.ConnectionFactory cnxFact
          Connection factory object for connecting to the foreign JMS server.
protected  java.lang.String cnxFactName
          ConnectionFactory JNDI name.
protected  javax.jms.Destination dest
          Foreign JMS destination object.
protected  java.lang.String destName
          Destination JNDI name.
protected  boolean isXA
          Indicates to use an XAConnection.
protected  java.lang.String jndiFactory
          Name of the JNDI factory class to use.
protected  java.lang.String jndiUrl
          JNDI URL.
protected  java.lang.Object lock
          serializable object for synchronization
protected  java.lang.String notUsableMessage
          Message explaining why the module is not usable.
protected  java.lang.String password
          User password for connecting to the foreign JMS server.
protected  JMSModule.ReconnectionDaemon reconnectionDaemon
          Daemon used for the reconnection process.
protected  javax.jms.Session session
          Session with the foreign JMS destination.
protected  boolean usable
          true if the module is fully usable.
protected  java.lang.String userName
          User identification for connecting to the foreign JMS server.
protected  javax.transaction.xa.XAResource xaRes
          XAResource
 
Constructor Summary
JMSModule()
           
 
Method Summary
 void close()
           
protected  void connectionDone()
           
protected  void doConnect()
          Opens a connection with the foreign JMS server and creates the JMS resources for interacting with the foreign JMS destination.
protected  void doXAConnect()
          Opens a XA connection with the foreign JMS server and creates the XA JMS resources for interacting with the foreign JMS destination.
 void init(java.util.Properties properties)
           
 void onException(javax.jms.JMSException exc)
          Implements the javax.jms.ExceptionListener interface for catching the failures of the connection to the remote JMS server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

usable

protected boolean usable
true if the module is fully usable.


notUsableMessage

protected java.lang.String notUsableMessage
Message explaining why the module is not usable.


reconnectionDaemon

protected JMSModule.ReconnectionDaemon reconnectionDaemon
Daemon used for the reconnection process.


lock

protected java.lang.Object lock
serializable object for synchronization


isXA

protected boolean isXA
Indicates to use an XAConnection. Default is false.


cnx

protected javax.jms.Connection cnx
Connection to the foreign JMS server.


session

protected javax.jms.Session session
Session with the foreign JMS destination.


xaRes

protected javax.transaction.xa.XAResource xaRes
XAResource


userName

protected java.lang.String userName
User identification for connecting to the foreign JMS server.


password

protected java.lang.String password
User password for connecting to the foreign JMS server.


jndiFactory

protected java.lang.String jndiFactory
Name of the JNDI factory class to use.


jndiUrl

protected java.lang.String jndiUrl
JNDI URL.


cnxFactName

protected java.lang.String cnxFactName
ConnectionFactory JNDI name.


destName

protected java.lang.String destName
Destination JNDI name.


dest

protected javax.jms.Destination dest
Foreign JMS destination object.


clientID

protected java.lang.String clientID
JMS clientID field.


cnxFact

protected javax.jms.ConnectionFactory cnxFact
Connection factory object for connecting to the foreign JMS server.

Constructor Detail

JMSModule

public JMSModule()
Method Detail

init

public void init(java.util.Properties properties)

close

public void close()

doConnect

protected void doConnect()
                  throws javax.jms.JMSException
Opens a connection with the foreign JMS server and creates the JMS resources for interacting with the foreign JMS destination.

Throws:
javax.jms.JMSException - If the needed JMS resources could not be created.

doXAConnect

protected void doXAConnect()
                    throws javax.jms.JMSException
Opens a XA connection with the foreign JMS server and creates the XA JMS resources for interacting with the foreign JMS destination.

Throws:
javax.jms.JMSException - If the needed JMS resources could not be created.

onException

public void onException(javax.jms.JMSException exc)
Implements the javax.jms.ExceptionListener interface for catching the failures of the connection to the remote JMS server.

Reacts by launching a reconnection process.

Specified by:
onException in interface javax.jms.ExceptionListener

connectionDone

protected void connectionDone()


Copyright © 2011 ScalAgent D.T.. All Rights Reserved.