Class EdnJmsConnection
- All Implemented Interfaces:
BusinessEventConnection,EdnConnection
- Since:
- 12.1.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the connectionvoidjavax.jms.TopicConnectionFactoryGet non-XA TopicConnectionFactory instance.Get UserTranasction instance for XA.javax.jms.TopicConnectionFactoryGet XA TopicConnectionFactory instance.booleancheck if the receiver is receiving events.voidpublishEvent(BusinessEvent event) Publish an event with default persistent, priority, time to live, and EDL as input source.voidpublishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI) Publish an event with specified delivery mode, priority, time to live, and EDL URI.voidpublishEvent(BusinessEvent event, int priority) Publish an event with indicated priorityvoidsetClientID(String clientID) voidsetJmsConfig(JmsConfig config) Custom JmsConfig for all the events to be published and subscribed via this Event Connection.voidsetTopicConnectionFactory(javax.jms.TopicConnectionFactory topicConnectionFactory) Set a non-XA TopicConnectionFactory instance.voidsetUserTransaction(UserTransaction userTransaction) voidsetXaTopicConnectionFactory(javax.jms.TopicConnectionFactory xaTopicConnectionFactory) Set a XA TopicConnectionFactory instance.voidrequest that receiver stop receiving events (exit the while loop - next time it checked the flag: stopReceivingRequested)voidSubscribe to events with specified event name (QName) and default consistency level, XPath filter (if a default one exists), timeout, and event handler that consumes subscribed events.oracle.integration.platform.blocks.event.jms2.EdnJmsEventReadersubscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, boolean runAsPublisher, long timeout, String durableSubName) voidsubscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubName) Subscribe to events with specified event name (QName), consistency level, XPath filter, and event handler that consumes subscribed events.oracle.integration.platform.blocks.event.jms2.EdnJmsEventReadersubscribeOnly(QName eventName, String durableSubscriptionName) voidunsubscribe(QName eventName, String durableSubName) remove the subscribevoidalternative for client sync with event receiving thread (long running)voidwaitOnReceiver(long millis) alternative for client sync with event receiving thread (long running)voidblock on the latch until latch zero'dbooleanwaitSubscriberCreationComplete(long timeout, TimeUnit unit) block on the latch with a timeout;Methods inherited from class oracle.integration.platform.blocks.event.jms2.BaseEdnConnection
getConsistencyLevel, getContextProvider, getEDL, getEDN, getEventHandler, getEventToJmsMapping, getPriority, getTimeout, getTimeToLive, getXPathFilter, isPersistent, isRunAsPublisher, setConsistencyLevel, setContextProvider, setEDL, setEDN, setEventHandler, setEventToJmsMapping, setPersistent, setPriority, setRunAsPublisher, setTimeout, setTimeToLive, setXPathFilter
-
Field Details
-
JNDI_DEFAULT_WLJMS_XA_CONN_FACTORY
- See Also:
-
JNDI_DEFAULT_WLJMS_LOCALTX_CONN_FACTORY
- See Also:
-
JNDI_DEFAULT_AQJMS_XA_CONN_FACTORY
- See Also:
-
JNDI_DEFAULT_AQJMS_LOCALTX_CONN_FACTORY
- See Also:
-
-
Constructor Details
-
EdnJmsConnection
Construct a remote JMS Connection to EDN.- Parameters:
ctx- - JNDI Context.
-
-
Method Details
-
getTopicConnectionFactory
public javax.jms.TopicConnectionFactory getTopicConnectionFactory()Get non-XA TopicConnectionFactory instance.- Returns:
- non-XA TopicConnectionFactory instance.
-
setTopicConnectionFactory
public void setTopicConnectionFactory(javax.jms.TopicConnectionFactory topicConnectionFactory) Set a non-XA TopicConnectionFactory instance.- Parameters:
topicConnectionFactory- - non-XA TopicConnectionFactory instance.
-
getXaTopicConnectionFactory
public javax.jms.TopicConnectionFactory getXaTopicConnectionFactory()Get XA TopicConnectionFactory instance.- Returns:
- XA TopicConnectionFactory instance.
-
setXaTopicConnectionFactory
public void setXaTopicConnectionFactory(javax.jms.TopicConnectionFactory xaTopicConnectionFactory) Set a XA TopicConnectionFactory instance.- Parameters:
xaTopicConnectionFactory- - XA TopicConnectionFactory instance.
-
getUserTransaction
Get UserTranasction instance for XA.- Returns:
- UserTranasction instance for XA.
-
setUserTransaction
-
getClientID
-
setClientID
-
close
public void close()Description copied from interface:BusinessEventConnectionClose the connection- Specified by:
closein interfaceBusinessEventConnection- Overrides:
closein classBaseEdnConnection
-
forceClose
public void forceClose() -
publishEvent
Description copied from interface:EdnConnectionPublish an event with default persistent, priority, time to live, and EDL as input source.- Specified by:
publishEventin interfaceEdnConnection- Overrides:
publishEventin classBaseEdnConnection- Parameters:
event- Business Event to be published- Throws:
oracle.fabric.common.FabricException- If it fails to publish the event with default options.
-
publishEvent
public void publishEvent(BusinessEvent event, int priority) throws oracle.fabric.common.FabricException Description copied from interface:BusinessEventConnectionPublish an event with indicated priority- Specified by:
publishEventin interfaceBusinessEventConnection- Overrides:
publishEventin classBaseEdnConnection- Parameters:
event- - Business Event to be publishedpriority- - event priority- Throws:
oracle.fabric.common.FabricException- if fabric exception occurs
-
publishEvent
public void publishEvent(BusinessEvent event, boolean persistent, int priority, long timeToLive, String edlURI) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionPublish an event with specified delivery mode, priority, time to live, and EDL URI.- Specified by:
publishEventin interfaceEdnConnection- Overrides:
publishEventin classBaseEdnConnection- Parameters:
event- Business Event to be publishedpersistent- Persistent (or non persistent) delivery modepriority- Event prioritytimeToLive- Time to live in millisecondsedlURI- URI with "oramds" referencing Event definition content- Throws:
oracle.fabric.common.FabricException- If it fails to publish the event with specified options.
-
subscribe
public void subscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSubscribe to events with specified event name (QName) and default consistency level, XPath filter (if a default one exists), timeout, and event handler that consumes subscribed events.Whether or not the subscription is durable depends on if the durableSubscriptionName is specified. Passing null or empty string as durableSubscriptionName indicates non-durable subscription.
If durableSubscriptionName is specified, it first creates a durable subscription if the subscription has not been created previously. Then it attempts to receive an event.
Note that the event receiving call blocks until an event arrives, or the timeout expires, or the connection is closed. A timeout value of 0 never expires, and the receive call blocks indefinitely. A negative timeout value means to receive the next event if one is immediately available without blocking.
- Specified by:
subscribein interfaceEdnConnection- Overrides:
subscribein classBaseEdnConnection- Parameters:
eventName- Event QName to subscribe todurableSubscriptionName- Durable subscription name.- Throws:
oracle.fabric.common.FabricException- If it fails to subscribe to events with specified options.
-
subscribe
public void subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubName) throws oracle.fabric.common.FabricException Description copied from interface:EdnConnectionSubscribe to events with specified event name (QName), consistency level, XPath filter, and event handler that consumes subscribed events.Whether or not the subscription is durable depends on if the durableSubscriptionName is specified. Passing null or empty string as durableSubscriptionName indicates non-durable subscription.
If durableSubscriptionName is specified, it first creates a durable subscription if the subscription has not been created previously. Then it attempts to receive an event.
Note that the event receiving call blocks until an event arrives, or the timeout expires, or the connection is closed. A timeout value of 0 never expires, and the receive call blocks indefinitely. A negative timeout value means to receive the next event if one is immediately available without blocking.
- Specified by:
subscribein interfaceEdnConnection- Overrides:
subscribein classBaseEdnConnection- Parameters:
eventName- Event QName to subscribe toqos- Delivery guarantee, either ConsistencyLevel.ONE_AND_ONLY_ONE or ConsistencyLevel.GUARANTEED_DELIVERYfilter- XPath filter to limit events. This filter is convertible into JMS message selector to apply on eventshandler- Event handler to consume subscribed events.runAsPublisher- Whether or not to consume events as publisher's identity.timeout- Timeout value (in milliseconds). A value of 0 never expires, and this call blocks indefinitely. A negative value means to receive the next event if one is immediately available without blocking.durableSubName- Durable subscription name.- Throws:
oracle.fabric.common.FabricException- If it fails to subscribe to events with specified options.
-
waitSubscriberCreationComplete
block on the latch until latch zero'd- Throws:
InterruptedException
-
waitSubscriberCreationComplete
public boolean waitSubscriberCreationComplete(long timeout, TimeUnit unit) throws InterruptedException block on the latch with a timeout;- Parameters:
timeout-unit-- Returns:
- Throws:
InterruptedException
-
subscribeOnly
public oracle.integration.platform.blocks.event.jms2.EdnJmsEventReader subscribeOnly(QName eventName, String durableSubscriptionName) throws Exception - Throws:
Exception
-
subscribe
public oracle.integration.platform.blocks.event.jms2.EdnJmsEventReader subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, boolean runAsPublisher, long timeout, String durableSubName) throws Exception - Throws:
Exception
-
unsubscribe
public void unsubscribe(QName eventName, String durableSubName) throws oracle.fabric.common.FabricException remove the subscribe- Specified by:
unsubscribein interfaceEdnConnection- Overrides:
unsubscribein classBaseEdnConnection- Parameters:
eventName- Event QName to unsubscribe todurableSubName- Durable subscription name whose subscription is to be removed.- Throws:
oracle.fabric.common.FabricException- if it fails to remove the durable subscription due to some internal error, or the subscription name is invalid.
-
setJmsConfig
Custom JmsConfig for all the events to be published and subscribed via this Event Connection.- Parameters:
config- - JmsConfig object to set
-
isReceiving
public boolean isReceiving()check if the receiver is receiving events.- Returns:
- true - receiver is receiving events (in the receiving loop), false - receiver has been stopped or no receiver (no receiver created yet).
-
stopReceiving
public void stopReceiving()request that receiver stop receiving events (exit the while loop - next time it checked the flag: stopReceivingRequested) -
waitOnReceiver
alternative for client sync with event receiving thread (long running)- Throws:
InterruptedException
-
waitOnReceiver
alternative for client sync with event receiving thread (long running)- Parameters:
millis-- Throws:
InterruptedException
-