|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.nucleus.GenericContext atg.service.event.EventHandlerRegistry
public class EventHandlerRegistry
Central mechanism by which handlers are registered to listen to specific event channels.
The handlerPath property of the registry defines the location of properties files for handlers. The registry looks through that directory for components who extend the GenericHandler class. The registry starts these components and registers them with the event distributor to listen for events on their specified default channels.
The registry is also notified of when a components configuration is deleted or updated and should act accordingly.
Since a handler need only implement the EventChannelListener interface and not extend GenericHandler, the registry also allows other components to register themselves by calling the registerHandler() and unregisterHandler() methods.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected static java.lang.Class |
mBaseHandlerClass
The base class for all registered handlers must be GenericHandler. |
protected atg.service.event.EventDistributor |
mDistributor
The event distributor. |
protected java.lang.String |
mHandlerPath
The Nucleus (or property path) where handlers are configured. |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
EventHandlerRegistry()
Empty constructor. |
Method Summary | |
---|---|
void |
configurationDeleted(atg.nucleus.ConfigurationEvent e)
Called whenever a Nucleus component's configuration is deleted. |
void |
configurationUpdated(atg.nucleus.ConfigurationEvent e)
Called whenever a Nucleus component's configuration is updated. |
void |
doStartService()
Perform any necessary initializations to startup service. |
EventChannelListener[] |
getActiveHandlers()
Returns an array of the currently registered Handlers. |
EventChannelListener[] |
getChannelListeners(java.lang.String pChannelString)
Returns any handlers registered to listen to the given channel. |
java.lang.String[] |
getChannelsForHandler(EventChannelListener pHandler)
Returns a String array of the event channels currently being listened to by the specified handler. |
java.lang.String[] |
getChannelsForHandler(java.lang.String pHandlerName)
Returns a String array of the event channels currently being listened to by the specified handler. |
java.lang.String[] |
getChannelSubTopics(java.lang.String pChannelString)
Returns any sub-topics of the give channel. |
atg.service.event.EventDistributor |
getDistributor()
The event distributor. |
int |
getHandlerCount()
The number of unique registered handlers. |
java.lang.String |
getHandlerPath()
The Nucleus (or property path) where handlers are configured. |
void |
refresh()
Refreshes the list of active handlers, starts any handlers not already started and registers them with the distributor on thier specified default channels. |
void |
registerHandler(java.lang.String pChannel,
EventChannelListener pHandler)
Registers an EventChannelListener to listen to events on the specified event channel. |
void |
setDistributor(atg.service.event.EventDistributor pValue)
The event distributor. |
void |
setHandlerPath(java.lang.String pValue)
The Nucleus (or property path) where handlers are configured. |
void |
unregisterHandler(java.lang.String pChannel,
EventChannelListener pHandler)
Unregisters an EventChannelListener from listening to events on the specified event channel. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface atg.naming.NameContextElement |
---|
getName, getNameContext |
Methods inherited from interface atg.naming.NameContextBindingListener |
---|
nameContextElementBound, nameContextElementUnbound |
Methods inherited from interface atg.naming.NameContextElement |
---|
getName, getNameContext |
Methods inherited from interface atg.naming.NameContextBindingListener |
---|
nameContextElementBound, nameContextElementUnbound |
Methods inherited from interface atg.naming.NameContextElement |
---|
getName, getNameContext |
Methods inherited from interface atg.naming.NameContextBindingListener |
---|
nameContextElementBound, nameContextElementUnbound |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected static final java.lang.Class mBaseHandlerClass
protected atg.service.event.EventDistributor mDistributor
protected java.lang.String mHandlerPath
Constructor Detail |
---|
public EventHandlerRegistry()
Method Detail |
---|
public void setDistributor(atg.service.event.EventDistributor pValue)
public atg.service.event.EventDistributor getDistributor()
public void setHandlerPath(java.lang.String pValue)
public java.lang.String getHandlerPath()
public int getHandlerCount()
public EventChannelListener[] getActiveHandlers()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void refresh()
Note that these handlers must extend GenericHandler, otherwise they will not be started or registered. To register handlers that do not extend GenericHandler, see the registerHandler() and unregisterHandler() methods.
public void registerHandler(java.lang.String pChannel, EventChannelListener pHandler) throws EventException
EventException
public void unregisterHandler(java.lang.String pChannel, EventChannelListener pHandler)
public java.lang.String[] getChannelsForHandler(EventChannelListener pHandler)
public java.lang.String[] getChannelsForHandler(java.lang.String pHandlerName)
public java.lang.String[] getChannelSubTopics(java.lang.String pChannelString)
public EventChannelListener[] getChannelListeners(java.lang.String pChannelString)
public void configurationDeleted(atg.nucleus.ConfigurationEvent e)
configurationDeleted
in interface atg.nucleus.ConfigurationListener
public void configurationUpdated(atg.nucleus.ConfigurationEvent e)
configurationUpdated
in interface atg.nucleus.ConfigurationListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |