|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.mom.util.BridgeUnifiedModule
The BridgeUnifiedModule
class is a bridge module based on the
JMS 1.1 unified semantics and classes.
Nested Class Summary | |
protected class |
BridgeUnifiedModule.ConsumerDaemon
The ConsumerDaemon thread allows to call
MessageConsumer.receive() for requesting a foreign JMS
message without blocking the JORAM server. |
protected class |
BridgeUnifiedModule.ReconnectionDaemon
The ReconnectionDaemon thread is responsible for reconnecting
the bridge module with the foreign JMS server in case of disconnection. |
protected class |
BridgeUnifiedModule.StartupDaemon
The StartupDaemon thread is responsible for retrieving
the needed JMS administered objects from the JNDI server. |
Field Summary | |
protected AgentId |
agentId
Identifier of the agent using this module. |
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.MessageConsumer |
consumer
Consumer object. |
protected BridgeUnifiedModule.ConsumerDaemon |
consumerDaemon
Daemon used for requesting messages. |
protected javax.jms.Session |
consumerSession
Session for getting messages from the foreign JMS destination. |
protected javax.jms.Destination |
dest
Foreign JMS destination object. |
protected java.lang.String |
destName
Destination JNDI name. |
protected java.lang.String |
jndiFactory
Name of the JNDI factory class to use. |
protected java.lang.String |
jndiUrl
JNDI URL. |
protected boolean |
listener
true if a listener has been set on the JMS consumer. |
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 javax.jms.MessageProducer |
producer
Producer object. |
protected javax.jms.Session |
producerSession
Session for sending messages to the foreign JMS destination. |
protected java.util.Vector |
qout
Vector holding the pending messages to send after reconnection. |
protected BridgeUnifiedModule.ReconnectionDaemon |
reconnectionDaemon
Daemon used for the reconnection process. |
protected java.lang.String |
selector
Selector for filtering messages. |
protected boolean |
usable
true if the module is fully usable. |
protected java.lang.String |
userName
User identification for connecting to the foreign JMS server. |
Constructor Summary | |
BridgeUnifiedModule()
Constructs a BridgeUnifiedModule module. |
Method Summary | |
protected void |
acknowledge(Message message)
Acknowledges a message successfuly delivered to the foreign JMS server. |
void |
close()
Interrupts the daemons and closes the connection. |
void |
connect()
Launches the connection process to the foreign JMS server. |
protected void |
doConnect()
Opens a connection with the foreign JMS server and creates the JMS resources for interacting with the foreign JMS destination. |
void |
init(AgentId agentId,
java.util.Properties prop)
Initializes the module's parameters. |
void |
onException(javax.jms.JMSException exc)
Implements the javax.jms.ExceptionListener interface for
catching the failures of the connection to the remote JMS server. |
void |
onMessage(javax.jms.Message jmsMessage)
Implements the javax.jms.MessageListener interface for
processing the asynchronous deliveries coming from the foreign JMS
server. |
void |
receive()
Asynchronous method requesting a delivery from the foreign JMS destination. |
Message |
receiveNoWait()
Synchronous method requesting an immediate delivery from the foreign JMS destination. |
void |
send(Message message)
Sends a message to the foreign JMS destination. |
protected void |
setConsumer()
Sets the JMS consumer on the foreign destination. |
void |
setMessageListener()
Sets a message listener on the foreign JMS destination. |
protected void |
unsetConsumer()
Unsets the JMS consumer. |
void |
unsetMessageListener()
Unsets the set message listener on the foreign JMS destination. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected AgentId agentId
protected java.lang.String jndiFactory
protected java.lang.String jndiUrl
protected java.lang.String cnxFactName
protected java.lang.String destName
protected javax.jms.ConnectionFactory cnxFact
protected javax.jms.Destination dest
protected java.lang.String userName
protected java.lang.String password
protected java.lang.String clientID
protected java.lang.String selector
protected boolean usable
true
if the module is fully usable.
protected java.lang.String notUsableMessage
protected transient javax.jms.Connection cnx
protected transient javax.jms.Session producerSession
protected transient javax.jms.Session consumerSession
protected transient javax.jms.MessageProducer producer
protected transient javax.jms.MessageConsumer consumer
protected transient boolean listener
true
if a listener has been set on the JMS consumer.
protected transient java.util.Vector qout
protected transient BridgeUnifiedModule.ConsumerDaemon consumerDaemon
protected transient BridgeUnifiedModule.ReconnectionDaemon reconnectionDaemon
Constructor Detail |
public BridgeUnifiedModule()
BridgeUnifiedModule
module.
Method Detail |
public void init(AgentId agentId, java.util.Properties prop)
agentId
- Identifier of the agent using the module.prop
- JMS properties required for establishing the link with the
foreign JMS server.
java.lang.IllegalArgumentException
- If the provided properties are
invalid.public void connect() throws javax.jms.JMSException
javax.jms.IllegalStateException
- If the module can't access
the foreign JMS server.
javax.jms.JMSException
- If the needed JMS resources can't be
created.public void setMessageListener() throws javax.jms.IllegalStateException
javax.jms.IllegalStateException
- If the module state does
not allow to set a listener.public void unsetMessageListener()
public Message receiveNoWait() throws javax.jms.IllegalStateException
null
if no message is available or if the request
fails.
javax.jms.IllegalStateException
- If the module state does
not allow to request a message.public void receive() throws javax.jms.IllegalStateException
javax.jms.IllegalStateException
- If the module state does
not allow to request a message.public void send(Message message) throws javax.jms.JMSException
javax.jms.IllegalStateException
- If the module's state does
not permit message sendings.
javax.jms.MessageFormatException
- If the MOM message could not
be converted into a foreign JMS message.
javax.jms.JMSException
public void close()
public void onException(javax.jms.JMSException exc)
javax.jms.ExceptionListener
interface for
catching the failures of the connection to the remote JMS server.
Reacts by launching a reconnection process.
onException
in interface javax.jms.ExceptionListener
public void onMessage(javax.jms.Message jmsMessage)
javax.jms.MessageListener
interface for
processing the asynchronous deliveries coming from the foreign JMS
server.
onMessage
in interface javax.jms.MessageListener
protected void doConnect() throws javax.jms.JMSException
javax.jms.JMSException
- If the needed JMS resources could not be created.protected void setConsumer() throws javax.jms.JMSException
javax.jms.JMSException
- If the JMS consumer could not be created.protected void unsetConsumer()
protected void acknowledge(Message message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |