public final class EdnJmsConnection extends BaseEdnConnection
| Modifier and Type | Field and Description |
|---|---|
static String |
JNDI_DEFAULT_AQJMS_LOCALTX_CONN_FACTORY |
static String |
JNDI_DEFAULT_AQJMS_XA_CONN_FACTORY |
static String |
JNDI_DEFAULT_WLJMS_LOCALTX_CONN_FACTORY |
static String |
JNDI_DEFAULT_WLJMS_XA_CONN_FACTORY |
| Constructor and Description |
|---|
EdnJmsConnection(Context ctx)
Construct a remote JMS Connection to EDN.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getClientID() |
Context |
getContext()
get the JNDI context
|
javax.jms.TopicConnectionFactory |
getTopicConnectionFactory()
Get non-XA TopicConnectionFactory instance.
|
UserTransaction |
getUserTransaction()
Get UserTranasction instance for XA.
|
javax.jms.TopicConnectionFactory |
getXaTopicConnectionFactory()
Get XA TopicConnectionFactory instance.
|
void |
publishEvent(BusinessEvent event)
Publish an event with default persistent, priority, time to live, and EDL as input source.
|
void |
publishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI)
Publish an event with specified delivery mode, priority, time to live, and EDL URI.
|
void |
publishEvent(BusinessEvent event, int priority)
Publish an event with indicated priority
|
void |
setClientID(String clientID) |
void |
setJmsConfig(JmsConfig config)
Custom JmsConfig for all the events to be published and subscribed via this Event Connection.
|
void |
setTopicConnectionFactory(javax.jms.TopicConnectionFactory topicConnectionFactory)
Set a non-XA TopicConnectionFactory instance.
|
void |
setUserTransaction(UserTransaction userTransaction) |
void |
setXaTopicConnectionFactory(javax.jms.TopicConnectionFactory xaTopicConnectionFactory)
Set a XA TopicConnectionFactory instance.
|
void |
subscribe(EdnSubscribeContext subscriptionContext)
Subscribe to EDN JMS topic for EDN event and start receiving events immediately, parameters for subscription are included in and specified as
subscriptionContext; |
void |
subscribe(QName eventName, ConsistencyLevel eventDeliverConsistencyLvl, XPathFilter eventFilter, BusinessEventHandler eventHandler, boolean runAsPublisher, long eventRecvTimeout, String durableSubscriberName)
Subscribe to the EDN JMS topic for the specified event (specified as
eventName), and start receiving events (consuming) immediately. |
void |
subscribe(QName eventName, String durableSubscriberName)
Subscribe to the EDN JMS topic for the specified event (specified as
eventName), and start receiving events (consuming) immediately. |
EdnJmsEventSubscriber |
subscribeOnly(EdnSubscribeContext subscriptionContex)
Subscribe to EDN JMS topic for the event (specified as
eventName), and return an instance of (EdnJmsEventSubscriber), allowing fine grained event consuming (switch on/off event delivery in-flow, read event etc.) through EdnJmsEventSubscriber and EdnJmsEventReader (the event reader can be obtained by EdnJmsEventSubscriber.getEventReader()). |
EdnJmsEventSubscriber |
subscribeOnly(QName eventName, ConsistencyLevel eventDeliverConsistencyLvl, XPathFilter eventFilter, BusinessEventHandler eventHandler, boolean runAsPublisher, long eventRecvTimeout, String durableSubscriberName)
Subscribe to EDN JMS topic for the event (specified as
eventName), and return an instance of (EdnJmsEventSubscriber), allowing fine grained event consuming (switch on/off event delivery in-flow, read event etc.) through EdnJmsEventSubscriber and EdnJmsEventReader (the event reader can be obtained by EdnJmsEventSubscriber.getEventReader()). |
EdnJmsEventSubscriber |
subscribeOnly(QName eventName, String durableSubscriberName)
Subscribe to EDN JMS topic for the event (specified as
eventName), and return an instance of (EdnJmsEventSubscriber), allowing fine grained event consuming (switch on/off event delivery in-flow, read event etc.) through EdnJmsEventSubscriber and EdnJmsEventReader (the event reader can be obtained by EdnJmsEventSubscriber.getEventReader()). |
void |
unsubscribe(EdnSubscribeContext subscriptionContex)
Unsubscribe using parameter of
EdnSubscribeContext; |
void |
unsubscribe(QName eventName, String durableSubscriberName)
Unsubscribe (remove) the event subscriber indicated by
durableSubscriberName. |
close, getConsistencyLevel, getContextProvider, getEDL, getEDN, getEventHandler, getEventToJmsMapping, getPriority, getTimeout, getTimeToLive, getXPathFilter, isPersistent, isRunAsPublisher, setConsistencyLevel, setContextProvider, setEDL, setEDN, setEventHandler, setEventToJmsMapping, setPersistent, setPriority, setRunAsPublisher, setTimeout, setTimeToLive, setXPathFilterpublic static final String JNDI_DEFAULT_WLJMS_XA_CONN_FACTORY
public static final String JNDI_DEFAULT_WLJMS_LOCALTX_CONN_FACTORY
public static final String JNDI_DEFAULT_AQJMS_XA_CONN_FACTORY
public static final String JNDI_DEFAULT_AQJMS_LOCALTX_CONN_FACTORY
public EdnJmsConnection(Context ctx)
ctx - - JNDI Context.public javax.jms.TopicConnectionFactory getTopicConnectionFactory()
public void setTopicConnectionFactory(javax.jms.TopicConnectionFactory topicConnectionFactory)
topicConnectionFactory - - non-XA TopicConnectionFactory instance.public javax.jms.TopicConnectionFactory getXaTopicConnectionFactory()
public void setXaTopicConnectionFactory(javax.jms.TopicConnectionFactory xaTopicConnectionFactory)
xaTopicConnectionFactory - - XA TopicConnectionFactory instance.public UserTransaction getUserTransaction()
public void setUserTransaction(UserTransaction userTransaction)
public String getClientID()
public void setClientID(String clientID)
public void publishEvent(BusinessEvent event) throws oracle.fabric.common.FabricException
EdnConnectionpublishEvent in interface EdnConnectionpublishEvent in class BaseEdnConnectionevent - Business Event to be publishedoracle.fabric.common.FabricException - If it fails to publish the event with default options.public void publishEvent(BusinessEvent event, int priority) throws oracle.fabric.common.FabricException
BusinessEventConnectionpublishEvent in interface BusinessEventConnectionpublishEvent in class BaseEdnConnectionevent - - Business Event to be publishedpriority - - event priorityoracle.fabric.common.FabricException - if fabric exception occurspublic void publishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI) throws oracle.fabric.common.FabricException
EdnConnectionpublishEvent in interface EdnConnectionpublishEvent in class BaseEdnConnectionevent - Business Event to be publishedpersistent - Persistent (or non persistent) delivery modepriority - Event prioritytimeToLive - Time to live in millisecondsedlURI - URI with "oramds" referencing Event definition contentoracle.fabric.common.FabricException - If it fails to publish the event with specified options.public void subscribe(QName eventName, ConsistencyLevel eventDeliverConsistencyLvl, XPathFilter eventFilter, BusinessEventHandler eventHandler, boolean runAsPublisher, long eventRecvTimeout, String durableSubscriberName) throws oracle.fabric.common.FabricException
eventName), and start receiving events (consuming) immediately. Note, the JMS client ID of the corresponding durable subscriber will use the class instance level property EdnJmsConnection.getClientID()subscribe in interface EdnConnectionsubscribe in class BaseEdnConnectioneventName - - full name of event subscribe toeventDeliverConsistencyLvl - - event delivery consistency level: OAOO or GUARANTEEDeventFilter - - xpath used to filter received eventeventHandler - - event handler for processing received event (filtered)runAsPublisher - - a hint for EDN delivery security policy, when true, the event publisher's subject will be used when deliver event to further processing;eventRecvTimeout - - timeout (in millisecond) for event receivingdurableSubscriberName - - name of durable subscriber to be created if presents, otherwise, non-durable subscriber will be created.oracle.fabric.common.FabricException - - Error during subscription.BaseEdnConnection.subscribe(javax.xml.namespace.QName, java.lang.String)public void subscribe(QName eventName, String durableSubscriberName) throws oracle.fabric.common.FabricException
eventName), and start receiving events (consuming) immediately. Note, the JMS client ID of the corresponding durable subscriber will use the class instance level property EdnJmsConnection.getClientID() EDN consistency level : default to class instance consistency level EDN event filter: default to class instance event filter EDN event handler: default to class instance event handler EDN run as publisher: default to class instance value of run as publisher EDN event receiving (read) timeout (in millisecond) : default to class instance timeout valuesubscribe in interface EdnConnectionsubscribe in class BaseEdnConnectioneventName - - full name of event subscribe todurableSubscriberName - - name of durable subscriber to be created if presents, otherwise, non-durable subscriber will be created.oracle.fabric.common.FabricException - - Error during subscription. Internally, this method delegates to below subscribe(...) with full parameters with those parameters not present taken from defaults:subscribeOnly(QName, ConsistencyLevel, XPathFilter, BusinessEventHandler, boolean, long, String)public void subscribe(EdnSubscribeContext subscriptionContext)
subscriptionContext;subscriptionContext - - subscribe context encapsulating parameters for creating EDN subscriber; Internally, this method delegates to below subscribe(...) with full parameters where the individual parameters obtained from the subscriptionContext.subscribe(QName, ConsistencyLevel, XPathFilter, BusinessEventHandler, boolean, long, String)public EdnJmsEventSubscriber subscribeOnly(QName eventName, ConsistencyLevel eventDeliverConsistencyLvl, XPathFilter eventFilter, BusinessEventHandler eventHandler, boolean runAsPublisher, long eventRecvTimeout, String durableSubscriberName) throws Exception
eventName), and return an instance of (EdnJmsEventSubscriber), allowing fine grained event consuming (switch on/off event delivery in-flow, read event etc.) through EdnJmsEventSubscriber and EdnJmsEventReader (the event reader can be obtained by EdnJmsEventSubscriber.getEventReader()).eventName - - full name of event subscribe toeventDeliverConsistencyLvl - - event delivery consistency level: OAOO or GUARANTEEDeventFilter - - xpath used to filter received eventeventHandler - - event handler for processing received event (filtered)runAsPublisher - - a hint for EDN delivery security policy, when true, the event publisher's subject will be used when deliver event to further processingeventRecvTimeout - - timeout (in millisecond) for event receivingdurableSubscriberName - - name of durable subscriber to be created if presents, otherwise, non-durable subscriber will be createdException - - Error during subscriptionpublic EdnJmsEventSubscriber subscribeOnly(QName eventName, String durableSubscriberName) throws Exception
eventName), and return an instance of (EdnJmsEventSubscriber), allowing fine grained event consuming (switch on/off event delivery in-flow, read event etc.) through EdnJmsEventSubscriber and EdnJmsEventReader (the event reader can be obtained by EdnJmsEventSubscriber.getEventReader()). EDN consistency level : default to class instance consistency level EDN event filter: default to class instance event filter EDN event handler: default to class instance event handler EDN run as publisher: default to class instance value of run as publisher EDN event receiving (read) timeout (in millisecond) : default to class instance timeout valueeventName - - full event name to subscribe todurableSubscriberName - - durable subscriber name if presents, otherwise, a non-durable subscriber will be createdException - error during subscription Internally, this method delegates to the subscribeOnly(...) as shown below with parameters not present taking defaults:subscribeOnly(QName, ConsistencyLevel, XPathFilter, BusinessEventHandler, boolean, long, String)public EdnJmsEventSubscriber subscribeOnly(EdnSubscribeContext subscriptionContex) throws Exception
eventName), and return an instance of (EdnJmsEventSubscriber), allowing fine grained event consuming (switch on/off event delivery in-flow, read event etc.) through EdnJmsEventSubscriber and EdnJmsEventReader (the event reader can be obtained by EdnJmsEventSubscriber.getEventReader()).subscriptionContex - - subscribe context encapsulating parameters for creating EDN subscriber;Exception - - Error during subscription. Internally, this method delegates to the subscribeOnly(...) as shown below with parameters not present taking defaults:subscribeOnly(QName, ConsistencyLevel, XPathFilter, BusinessEventHandler, boolean, long, String)public void unsubscribe(QName eventName, String durableSubscriberName) throws oracle.fabric.common.FabricException
durableSubscriberName.unsubscribe in interface EdnConnectionunsubscribe in class BaseEdnConnectioneventName - - the event type of the subscriptiondurableSubscriberName - - the durable subscriber nameoracle.fabric.common.FabricException - - Error during unsubscribeBaseEdnConnection.unsubscribe(QName, String)public void unsubscribe(EdnSubscribeContext subscriptionContex) throws oracle.fabric.common.FabricException
EdnSubscribeContext;subscriptionContex - - the EDN subscribe context, internally parameter eventName and durableSubscriberName will be obtained from the context and invoke unsubscribe(eventName, durableSubscriberName)oracle.fabric.common.FabricException - - Error occurred during removing the subscriber; Internally, this method delegates to unsubscribe(...) as shown below where eventName and durableSubscriberName are obtained from the subscriptionContext:unsubscribe(QName, String)public void setJmsConfig(JmsConfig config)
config - - JmsConfig object to setpublic Context getContext()