Package org.opennms.netmgt.eventd
Class DefaultEventHandlerImpl
- java.lang.Object
-
- org.opennms.netmgt.eventd.DefaultEventHandlerImpl
-
- All Implemented Interfaces:
EventHandler
,org.springframework.beans.factory.InitializingBean
public final class DefaultEventHandlerImpl extends java.lang.Object implements org.springframework.beans.factory.InitializingBean, EventHandler
The EventHandler builds Runnables that essentially do all the work on an incoming event. Operations done on an incoming event are handled by the List of injected EventProcessors, in the order in which they are given in the list. If any of them throw an exception, further processing of that event Log is stopped.- Author:
- Sowmya Nataraj , OpenNMS.org
-
-
Constructor Summary
Constructors Constructor Description DefaultEventHandlerImpl(com.codahale.metrics.MetricRegistry registry)
Constructor for DefaultEventHandlerImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
afterPropertiesSetorg.opennms.netmgt.eventd.DefaultEventHandlerImpl.EventHandlerRunnable
createRunnable(Log eventLog)
Create a Runnable to handle the passed-in event Log.org.opennms.netmgt.eventd.DefaultEventHandlerImpl.EventHandlerRunnable
createRunnable(Log eventLog, boolean synchronous)
Create a Runnable to handle the passed-in event Log.java.util.List<EventProcessor>
getEventProcessors()
getEventProcessorsboolean
getLogEventSummaries()
NodeDao
getNodeDao()
void
setEventProcessors(java.util.List<EventProcessor> eventProcessors)
setEventProcessorsvoid
setLogEventSummaries(boolean logEventSummaries)
void
setNodeDao(NodeDao nodeDao)
-
-
-
Method Detail
-
createRunnable
public org.opennms.netmgt.eventd.DefaultEventHandlerImpl.EventHandlerRunnable createRunnable(Log eventLog)
Description copied from interface:EventHandler
Create a Runnable to handle the passed-in event Log.- Specified by:
createRunnable
in interfaceEventHandler
- Parameters:
eventLog
- events to be processed- Returns:
- a ready-to-run Runnable that will process the events
-
createRunnable
public org.opennms.netmgt.eventd.DefaultEventHandlerImpl.EventHandlerRunnable createRunnable(Log eventLog, boolean synchronous)
Description copied from interface:EventHandler
Create a Runnable to handle the passed-in event Log.- Specified by:
createRunnable
in interfaceEventHandler
- Parameters:
eventLog
- events to be processedsynchronous
- Whether the runnable should wait for all processors to finish processing before returning- Returns:
- a ready-to-run Runnable that will process the events
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.IllegalStateException
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.IllegalStateException
- if any.
-
getEventProcessors
public java.util.List<EventProcessor> getEventProcessors()
getEventProcessors
- Returns:
- a
List
object.
-
setEventProcessors
public void setEventProcessors(java.util.List<EventProcessor> eventProcessors)
setEventProcessors
- Parameters:
eventProcessors
- aList
object.
-
getLogEventSummaries
public boolean getLogEventSummaries()
-
setLogEventSummaries
public void setLogEventSummaries(boolean logEventSummaries)
-
setNodeDao
public void setNodeDao(NodeDao nodeDao)
-
getNodeDao
public NodeDao getNodeDao()
-
-