public class EdnJcaConnection extends BaseEdnConnection
Constructor and Description |
---|
EdnJcaConnection(Map<String,javax.resource.cci.ConnectionFactory> factories, UserTransaction userTransaction, Map<QName,Set<JmsConfig>> mapping)
Construct a remote Connection to EDN via SOA JMS Adapter.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection
|
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 |
subscribe(QName eventName, ConsistencyLevel qos, XPathFilter filter, BusinessEventHandler handler, boolean runAsPublisher, long timeout, String durableSubscriptionName)
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 durableSubscriptionName)
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, setXPathFilter
public EdnJcaConnection(Map<String,javax.resource.cci.ConnectionFactory> factories, UserTransaction userTransaction, Map<QName,Set<JmsConfig>> mapping)
factories
- - cci connection factory per JMS adapter conn factory (a total of 4)userTransaction
- - UserTranaction objectmapping
- - Event type to JMS mapping configured in EDNpublic void close() throws oracle.fabric.common.FabricException
BusinessEventConnection
close
in interface BusinessEventConnection
close
in class BaseEdnConnection
oracle.fabric.common.FabricException
- if fabric exception occurspublic void publishEvent(BusinessEvent event) throws oracle.fabric.common.FabricException
EdnConnection
publishEvent
in interface EdnConnection
publishEvent
in class BaseEdnConnection
event
- 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
BusinessEventConnection
publishEvent
in interface BusinessEventConnection
publishEvent
in class BaseEdnConnection
event
- - 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
EdnConnection
publishEvent
in interface EdnConnection
publishEvent
in class BaseEdnConnection
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 contentoracle.fabric.common.FabricException
- If it fails to publish the event with specified options.public void unsubscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnection
unsubscribe
in interface EdnConnection
unsubscribe
in class BaseEdnConnection
eventName
- Event QName to unsubscribe todurableSubscriptionName
- 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.public void subscribe(QName eventName, String durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnection
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.
subscribe
in interface EdnConnection
subscribe
in class BaseEdnConnection
eventName
- 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 durableSubscriptionName) throws oracle.fabric.common.FabricException
EdnConnection
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.
subscribe
in interface EdnConnection
subscribe
in class BaseEdnConnection
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.durableSubscriptionName
- Durable subscription name.oracle.fabric.common.FabricException
- If it fails to subscribe to events with specified options.