public final class EdnJmsConnection extends BaseEdnConnection
| Constructor and Description | 
|---|
EdnJmsConnection(Context ctx)
Construct a remote JMS Connection to EDN. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
close()
Close the connection 
 | 
String | 
getClientID()
Get client ID used for creating durable subscriptions. 
 | 
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)
Set client ID used for creating durable subscriptions. 
 | 
void | 
setTopicConnectionFactory(javax.jms.TopicConnectionFactory topicConnectionFactory)
Set a non-XA TopicConnectionFactory instance. 
 | 
void | 
setUserTransaction(UserTransaction userTransaction)
Set UserTranasction instance for XA. 
 | 
void | 
setXaTopicConnectionFactory(javax.jms.TopicConnectionFactory xaTopicConnectionFactory)
Set a XA TopicConnectionFactory instance. 
 | 
void | 
subscribe(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. 
 | 
void | 
subscribe(QName eventName, String durableSubscriptionName)
Subscribe 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. 
 | 
void | 
unsubscribe(QName eventName, String durableSubName)
Remove a durable subscription that has been created previously. 
 | 
getConsistencyLevel, getContextProvider, getEDL, getEDN, getEventHandler, getEventToJmsMapping, getPriority, getTimeout, getTimeToLive, getXPathFilter, isPersistent, isRunAsPublisher, setConsistencyLevel, setContextProvider, setEDL, setEDN, setEventHandler, setEventToJmsMapping, setPersistent, setPriority, setRunAsPublisher, setTimeout, setTimeToLive, setXPathFilterpublic 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)
userTransaction - - UserTranasction instance for XA.public String getClientID()
public void setClientID(String clientID)
clientID - client ID used for creating durable subscriptions.
public void close()
           throws oracle.fabric.common.FabricException
BusinessEventConnectionclose in interface BusinessEventConnectionclose in class BaseEdnConnectionoracle.fabric.common.FabricExceptionpublic 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.FabricExceptionpublic 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, String durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnectionWhether 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.
subscribe in interface EdnConnectionsubscribe in class BaseEdnConnectioneventName - Event QName to subscribe todurableSubscriptionName - Durable subscription name.oracle.fabric.common.FabricException - If it fails to subscribe to events with specified options.public void subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubName) throws oracle.fabric.common.FabricException
EdnConnectionWhether 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.
subscribe in interface EdnConnectionsubscribe in class BaseEdnConnectioneventName - 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.oracle.fabric.common.FabricException - If it fails to subscribe to events with specified options.public void unsubscribe(QName eventName, String durableSubName) throws oracle.fabric.common.FabricException
EdnConnectionunsubscribe in interface EdnConnectionunsubscribe in class BaseEdnConnectioneventName - Event QName to unsubscribe todurableSubName - Durable subscription name whose subscription is to be removed.oracle.fabric.common.FabricException - if it fails to remove the durable subscription due to some internal error, or the subscription name is invalid.