|
||||||||||
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 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(Collection<EventSubject> localSubjects,
String externalSubject)
|
|
JMSBridge(EventSubject localSubject,
String externalSubject)
|
Method Summary | |
---|---|
protected Serializable |
eventToMessageObject(CayenneEvent event)
Converts CayenneEvent to a serializable object that will be sent via JMS. |
String |
getTopicConnectionFactoryName()
|
protected CayenneEvent |
messageObjectToEvent(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(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(Context jndiContext,
NamingException ex)
Attempts to create missing Topic. |
Methods inherited from class org.apache.cayenne.event.EventBridge |
---|
convertToExternalSubject, getEventManager, getExternalEventSource, getExternalSubject, getLocalSubjects, isRunning, onExternalEvent, 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 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, String externalSubject)
public JMSBridge(Collection<EventSubject> localSubjects, String externalSubject)
Method Detail |
---|
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
public String getTopicConnectionFactoryName()
public void setTopicConnectionFactoryName(String name)
protected void startupExternal() throws Exception
startupExternal
in class EventBridge
Exception
protected javax.jms.Topic topicNotFound(Context jndiContext, NamingException ex) throws Exception
Exception
protected void shutdownExternal() throws Exception
shutdownExternal
in class EventBridge
Exception
protected void sendExternalEvent(CayenneEvent localEvent) throws Exception
EventBridge
sendExternalEvent
in class EventBridge
Exception
protected Serializable eventToMessageObject(CayenneEvent event) throws Exception
Exception
protected CayenneEvent messageObjectToEvent(Serializable object) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |