public class JMSEPNManagerImpl extends AbstractEPNManager implements JMSEPNManager
Modifier and Type | Class and Description |
---|---|
protected class |
JMSEPNManagerImpl.JMSEPNContainer
This class provides the JMS implementation of the EPN container.
|
AbstractEPNManager.NetworkList
Modifier and Type | Field and Description |
---|---|
static String |
EPN_DESTINATION_NODES
The EPN Destination Node Names.
|
static String |
EPN_NETWORK
The EPN Network Name.
|
static String |
EPN_NOTIFY_TYPE
The EPN notification type.
|
static String |
EPN_RETRIES_LEFT
The EPN Number of Retries Left.
|
static String |
EPN_SOURCE
The EPN Source Name.
|
static String |
EPN_SUBJECTS
The subscription subjects.
|
static String |
EPN_VERSION
The EPN Version.
|
Constructor and Description |
---|
JMSEPNManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
close()
This method closes the manager.
|
protected void |
dispatch(Network network,
Node node,
String source,
EventList events,
int retriesLeft)
This method dispatches a set of events directly to the supplied
network and node.
|
protected void |
dispatchToNodes(String networkName,
String version,
String nodeList,
String source,
EventList events,
int retriesLeft)
This method dispatches the events to the list of nodes that are associated with
the named network.
|
protected void |
dispatchToSubjects(String subjectList,
EventList events)
This method dispatches the events to any network that has subscribed to any one of
the supplied list of subjects.
|
javax.jms.ConnectionFactory |
getConnectionFactory()
This method returns the connection factory.
|
protected EPNContainer |
getContainer()
This method returns the Event Processor Network Container.
|
javax.jms.Destination |
getEventsDestination()
This method returns the events destination.
|
String |
getEventsDestinationName()
This method returns the events destination name.
|
boolean |
getInitConsumers()
This method determines whether consumers should be initialized.
|
javax.jms.Destination |
getNotificationsDestination()
This method returns the notifications destination.
|
String |
getNotificationsDestinationName()
This method returns the notifications destination name.
|
String |
getPassword()
This method returns the password.
|
String |
getUsername()
This method returns the username.
|
void |
handleEventsMessage(javax.jms.Message message)
This method handles an events message received via JMS.
|
void |
handleNotificationsMessage(javax.jms.Message message)
This method handles a notification message received via JMS.
|
void |
init()
The initialize method.
|
protected void |
initJMS(boolean onInit)
This method initializes the JMS connection and destinations.
|
protected boolean |
isManaged()
This method determines whether the EPNManager is managed.
|
protected void |
notifyListeners(String subject,
EventList events)
This method sends a notification to any registered listeners that
a situation has occurred associated with the specified subject.
|
void |
publish(String subject,
List<? extends Serializable> events)
This method publishes the supplied events to be processed
by any network subscribed to the nominated subject.
|
protected void |
retry(String networkName,
String version,
String nodeName,
String source,
EventList events,
int retriesLeft)
This method handles retrying the supplied set of events, if the number of
retries left is greater than 0.
|
void |
setConnectionFactory(javax.jms.ConnectionFactory cf)
This method sets the connection factory.
|
void |
setEventsDestination(javax.jms.Destination dest)
This method sets the events destination.
|
void |
setEventsDestinationName(String dest)
This method sets the events destination name.
|
void |
setInitConsumers(boolean initConsumers)
This method determines whether consumers should be initialized.
|
void |
setNotificationsDestination(javax.jms.Destination dest)
This method sets the notifications destination.
|
void |
setNotificationsDestinationName(String dest)
This method sets the notifications destination name.
|
void |
setPassword(String password)
This method sets the password.
|
void |
setUsername(String username)
This method sets the username.
|
addNetworkListener, addNotificationListener, currentNetworkChanged, dispatchNotificationToListeners, getNetwork, getNetworksForSubject, getNode, getValidationListener, postProcessEvents, preProcessEvents, preProcessEvents, process, register, registerSubjects, removeNetworkListener, removeNotificationListener, setLastAccessed, setUsePrePostEventListProcessing, unregister, unregisterSubjects
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addNetworkListener, addNotificationListener, register, removeNetworkListener, removeNotificationListener, unregister
public static final String EPN_SUBJECTS
public static final String EPN_NETWORK
public static final String EPN_VERSION
public static final String EPN_DESTINATION_NODES
public static final String EPN_SOURCE
public static final String EPN_RETRIES_LEFT
public static final String EPN_NOTIFY_TYPE
protected boolean isManaged()
isManaged
in class AbstractEPNManager
protected EPNContainer getContainer()
getContainer
in class AbstractEPNManager
public void setConnectionFactory(javax.jms.ConnectionFactory cf)
cf
- The connection factorypublic javax.jms.ConnectionFactory getConnectionFactory()
public void setEventsDestination(javax.jms.Destination dest)
dest
- The destinationpublic javax.jms.Destination getEventsDestination()
public void setNotificationsDestination(javax.jms.Destination dest)
dest
- The destinationpublic javax.jms.Destination getNotificationsDestination()
public void setEventsDestinationName(String dest)
dest
- The destination namepublic String getEventsDestinationName()
public void setNotificationsDestinationName(String dest)
dest
- The destination namepublic String getNotificationsDestinationName()
public boolean getInitConsumers()
public void setInitConsumers(boolean initConsumers)
initConsumers
- Whether to initialize consumerspublic void setUsername(String username)
username
- The usernamepublic String getUsername()
public void setPassword(String password)
password
- The passwordpublic String getPassword()
public void init()
init
in class AbstractEPNManager
protected void initJMS(boolean onInit)
onInit
- Whether being called on service initializatipnpublic void publish(String subject, List<? extends Serializable> events) throws Exception
publish
in interface EPNManager
subject
- The subject upon which to publish the eventsevents
- The list of events to be processedException
- Failed to publish the eventspublic void handleEventsMessage(javax.jms.Message message) throws Exception
handleEventsMessage
in interface JMSEPNManager
message
- The JMS message carrying the eventsException
- Failed to handle messageprotected void dispatchToSubjects(String subjectList, EventList events) throws Exception
subjectList
- The subject listevents
- The list of eventsException
- Failed to dispatch events to the networks associated with the
supplied list of subjectsprotected void dispatchToNodes(String networkName, String version, String nodeList, String source, EventList events, int retriesLeft) throws Exception
networkName
- The name of the networkversion
- The version, or null for currentnodeList
- The list of nodessource
- The source node, or null if sending to rootevents
- The list of events to be processedretriesLeft
- The number of retries left, or -1 if should be max valueException
- Failed to dispatch the events for processingpublic void handleNotificationsMessage(javax.jms.Message message) throws Exception
handleNotificationsMessage
in interface JMSEPNManager
message
- The JMS message carrying the notificationException
- Failed to handle notificationprotected void dispatch(Network network, Node node, String source, EventList events, int retriesLeft) throws Exception
network
- The networknode
- The nodesource
- The source node/subjectevents
- The list of events to be processedretriesLeft
- The number of retries left, or -1 if should be max valueException
- Failed to dispatch the events for processingprotected void retry(String networkName, String version, String nodeName, String source, EventList events, int retriesLeft) throws Exception
networkName
- The name of the networkversion
- The versionnodeName
- The optional node name, or root node if not specifiedsource
- The sourceevents
- The eventsretriesLeft
- The number of retries now remaining after this failure to process themException
- Failed to retry the events processingprotected void notifyListeners(String subject, EventList events) throws Exception
notifyListeners
in class AbstractEPNManager
subject
- The subjectevents
- The list of eventsException
- Failed to notifypublic void close() throws Exception
close
in interface EPNManager
close
in class AbstractEPNManager
Exception
- Failed to close managerCopyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.