public abstract class AbstractEPNManager extends Object implements EPNManager
Modifier and Type | Class and Description |
---|---|
class |
AbstractEPNManager.NetworkList
This class represents a list of Network instances
for the same name, but different versions.
|
Constructor and Description |
---|
AbstractEPNManager()
This is the default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addNetworkListener(NetworkListener l)
This method registers a network listener.
|
void |
addNotificationListener(String subject,
NotificationListener l)
This method registers a node listener for the specified network.
|
void |
close()
This method closes the manager.
|
protected void |
currentNetworkChanged(Network oldNet,
Network newNet)
This method is called to handle a change in the current version
of a network, due to a new (more recent) version being registered
or a current version being unregistered.
|
protected void |
dispatchNotificationToListeners(String subject,
EventList events)
This method dispatches the notifications to the registered listeners.
|
protected abstract EPNContainer |
getContainer()
This method returns the Event Processor Network Container.
|
protected Network |
getNetwork(String name,
String version)
This method returns the network associated with the
supplied name.
|
protected List<Network> |
getNetworksForSubject(String subject)
This method returns the list of networks that subscribe to
the supplied subject.
|
protected Node |
getNode(String networkName,
String version,
String nodeName)
This method returns the node associated with the
supplied network and node name.
|
protected EPNValidationListener |
getValidationListener()
This method returns the validation listener.
|
void |
init()
Initialize the EPNManager.
|
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.
|
protected void |
postProcessEvents(EventList events)
This method resets the events, to enable them to be used in the
context of another classloader.
|
protected void |
preProcessEvents(EventList events,
ClassLoader classloader)
This method deserializes the events in the context of the supplied
classloader.
|
protected void |
preProcessEvents(EventList events,
Network network)
This method deserializes the events in the context of the supplied
network.
|
protected EventList |
process(Network network,
Node node,
String source,
EventList events,
int retriesLeft)
This method dispatches a set of events directly to the supplied
node.
|
void |
register(Network network)
This method registers a network.
|
protected void |
registerSubjects(Network network)
This method registers the supplied network against the
subjects it is interested in.
|
void |
removeNetworkListener(NetworkListener l)
This method unregisters a network listener.
|
void |
removeNotificationListener(String subject,
NotificationListener l)
This method unregisters a node listener for the specified network.
|
protected void |
setLastAccessed(Network network,
long timestamp)
This method sets the last accessed timestamp on the supplied
network.
|
protected void |
setUsePrePostEventListProcessing(boolean b)
This method sets whether to use pre/post event list processing.
|
void |
unregister(String networkName,
String version)
This method unregisters a network, associated with
the supplied name and version.
|
protected void |
unregisterSubjects(Network network)
This method unregisters the supplied network from the
subjects it is interested in.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
publish
public void init()
protected abstract EPNContainer getContainer()
protected boolean isManaged()
public void register(Network network) throws Exception
register
in interface EPNManager
network
- The networkException
- Failed to register the networkprotected EPNValidationListener getValidationListener()
public void unregister(String networkName, String version) throws Exception
unregister
in interface EPNManager
networkName
- The network nameversion
- The version, or null if currentException
- Failed to unregister the networkprotected void currentNetworkChanged(Network oldNet, Network newNet)
oldNet
- The old network versionnewNet
- The new network versionprotected void registerSubjects(Network network)
network
- The networkprotected void unregisterSubjects(Network network)
network
- The networkpublic void addNotificationListener(String subject, NotificationListener l)
addNotificationListener
in interface EPNManager
subject
- The network to listen tol
- The listenerpublic void removeNotificationListener(String subject, NotificationListener l)
removeNotificationListener
in interface EPNManager
subject
- The network was listening tol
- The listenerpublic void addNetworkListener(NetworkListener l)
addNetworkListener
in interface EPNManager
l
- The listenerpublic void removeNetworkListener(NetworkListener l)
removeNetworkListener
in interface EPNManager
l
- The listenerprotected void setLastAccessed(Network network, long timestamp)
network
- The networktimestamp
- The timestampprotected Network getNetwork(String name, String version)
name
- The network nameversion
- The version, or null for current versionprotected List<Network> getNetworksForSubject(String subject)
subject
- The subjectprotected Node getNode(String networkName, String version, String nodeName) throws Exception
networkName
- The network nameversion
- The version, or null for currentnodeName
- The node nameException
- Failed to find the specified nodeprotected void setUsePrePostEventListProcessing(boolean b)
b
- Whether to use pre/post event list processingprotected void preProcessEvents(EventList events, Network network)
events
- The eventsnetwork
- The networkprotected void preProcessEvents(EventList events, ClassLoader classloader)
events
- The eventsclassloader
- The classloaderprotected void postProcessEvents(EventList events)
events
- The eventsprotected EventList process(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 leftException
- Failed to dispatch the events for processingprotected void notifyListeners(String subject, EventList events) throws Exception
subject
- The subjectevents
- The list of eventsException
- Failed to notifyprotected void dispatchNotificationToListeners(String subject, EventList events)
subject
- The subjectevents
- The list of eventspublic void close() throws Exception
close
in interface EPNManager
Exception
- Failed to close managerCopyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.