|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.event.EventBridge
org.apache.cayenne.event.JMSBridge
public class JMSBridge
Implementation of EventBridge that passes and receives events via JMS (Java Messaging Service). JMSBridge uses "publish/subscribe" model for communication with external agents.
Field Summary | |
---|---|
protected javax.jms.TopicPublisher |
publisher
|
protected javax.jms.TopicConnection |
receivedConnection
|
protected javax.jms.TopicConnection |
sendConnection
|
protected javax.jms.TopicSession |
sendSession
|
protected javax.jms.TopicSubscriber |
subscriber
|
protected java.lang.String |
topicConnectionFactoryName
|
Fields inherited from class org.apache.cayenne.event.EventBridge |
---|
eventManager, externalEventSource, externalSubject, localSubjects, mode, RECEIVE_EXTERNAL, RECEIVE_LOCAL, RECEIVE_LOCAL_EXTERNAL |
Constructor Summary | |
---|---|
JMSBridge(java.util.Collection localSubjects,
java.lang.String externalSubject)
|
|
JMSBridge(EventSubject localSubject,
java.lang.String externalSubject)
|
Method Summary | |
---|---|
protected java.io.Serializable |
eventToMessageObject(CayenneEvent event)
Converts CayenneEvent to a serializable object that will be sent via JMS. |
java.lang.String |
getTopicConnectionFactoryName()
|
protected CayenneEvent |
messageObjectToEvent(java.io.Serializable object)
Converts a Serializable instance to CayenneEvent. |
void |
onMessage(javax.jms.Message message)
JMS MessageListener implementation. |
protected void |
sendExternalEvent(CayenneEvent localEvent)
Sends a Cayenne event over the transport supported by this bridge. |
void |
setTopicConnectionFactoryName(java.lang.String name)
|
protected void |
shutdownExternal()
Closes all resources used to communicate via JMS. |
protected void |
startupExternal()
Starts up JMS machinery for "publish/subscribe" model. |
protected javax.jms.Topic |
topicNotFound(javax.naming.Context jndiContext,
javax.naming.NamingException ex)
Attempts to create missing Topic. |
Methods inherited from class org.apache.cayenne.event.EventBridge |
---|
convertToExternalSubject, getEventManager, getExternalEventSource, getExternalSubject, getLocalSubject, getLocalSubjects, isRunning, onExternalEvent, onLocalEvent, receivesExternalEvents, receivesLocalEvents, shutdown, startup, startup, startup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String topicConnectionFactoryName
protected javax.jms.TopicConnection sendConnection
protected javax.jms.TopicSession sendSession
protected javax.jms.TopicConnection receivedConnection
protected javax.jms.TopicPublisher publisher
protected javax.jms.TopicSubscriber subscriber
Constructor Detail |
---|
public JMSBridge(EventSubject localSubject, java.lang.String externalSubject)
public JMSBridge(java.util.Collection localSubjects, java.lang.String externalSubject)
Method Detail |
---|
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
public java.lang.String getTopicConnectionFactoryName()
public void setTopicConnectionFactoryName(java.lang.String name)
protected void startupExternal() throws java.lang.Exception
startupExternal
in class EventBridge
java.lang.Exception
protected javax.jms.Topic topicNotFound(javax.naming.Context jndiContext, javax.naming.NamingException ex) throws java.lang.Exception
java.lang.Exception
protected void shutdownExternal() throws java.lang.Exception
shutdownExternal
in class EventBridge
java.lang.Exception
protected void sendExternalEvent(CayenneEvent localEvent) throws java.lang.Exception
EventBridge
sendExternalEvent
in class EventBridge
java.lang.Exception
protected java.io.Serializable eventToMessageObject(CayenneEvent event) throws java.lang.Exception
java.lang.Exception
protected CayenneEvent messageObjectToEvent(java.io.Serializable object) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |