public class JMSBridge extends EventBridge implements javax.jms.MessageListener
| Modifier and Type | Field and Description |
|---|---|
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 |
eventManager, externalEventSource, externalSubject, localSubjects, mode, RECEIVE_EXTERNAL, RECEIVE_LOCAL, RECEIVE_LOCAL_EXTERNAL| Constructor and Description |
|---|
JMSBridge(Collection<EventSubject> localSubjects,
String externalSubject) |
JMSBridge(EventSubject localSubject,
String externalSubject) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
convertToExternalSubject, getEventManager, getExternalEventSource, getExternalSubject, getLocalSubjects, isRunning, onExternalEvent, receivesExternalEvents, receivesLocalEvents, shutdown, startup, startup, startupprotected 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
public JMSBridge(EventSubject localSubject, String externalSubject)
public JMSBridge(Collection<EventSubject> localSubjects, String externalSubject)
public void onMessage(javax.jms.Message message)
onMessage in interface javax.jms.MessageListenerpublic String getTopicConnectionFactoryName()
public void setTopicConnectionFactoryName(String name)
protected void startupExternal()
throws Exception
startupExternal in class EventBridgeExceptionprotected javax.jms.Topic topicNotFound(Context jndiContext, NamingException ex) throws Exception
Exceptionprotected void shutdownExternal()
throws Exception
shutdownExternal in class EventBridgeExceptionprotected void sendExternalEvent(CayenneEvent localEvent) throws Exception
EventBridgesendExternalEvent in class EventBridgeExceptionprotected Serializable eventToMessageObject(CayenneEvent event) throws Exception
Exceptionprotected CayenneEvent messageObjectToEvent(Serializable object) throws Exception
ExceptionCopyright © 2001–2018 Apache Cayenne. All rights reserved.