org.opennms.netmgt.model.events
Class AnnotationBasedEventListenerAdapter

java.lang.Object
  extended by org.opennms.netmgt.model.events.AnnotationBasedEventListenerAdapter
All Implemented Interfaces:
EventListener, StoppableEventListener, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class AnnotationBasedEventListenerAdapter
extends Object
implements StoppableEventListener, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

AnnotationBasedEventListenerAdapter

Author:
brozow

Constructor Summary
AnnotationBasedEventListenerAdapter()
           
AnnotationBasedEventListenerAdapter(Object annotatedListener, EventSubscriptionService subscriptionService)
           
AnnotationBasedEventListenerAdapter(String name, Object annotatedListener, EventSubscriptionService subscriptionService)
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 String getName()
          Return the id of the listener
protected  void handleException(Event event, Throwable cause)
           
 void onEvent(Event event)
          Process a sent event.
protected  void postprocessEvent(Event event)
           
protected  void preprocessEvent(Event event)
           
protected  void processEvent(Event event, Method method)
           
 void setAnnotatedListener(Object annotatedListener)
           
 void setEventSubscriptionService(EventSubscriptionService subscriptionService)
           
 void setName(String name)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationBasedEventListenerAdapter

public AnnotationBasedEventListenerAdapter(String name,
                                           Object annotatedListener,
                                           EventSubscriptionService subscriptionService)

AnnotationBasedEventListenerAdapter

public AnnotationBasedEventListenerAdapter(Object annotatedListener,
                                           EventSubscriptionService subscriptionService)

AnnotationBasedEventListenerAdapter

public AnnotationBasedEventListenerAdapter()
Method Detail

getName

public String getName()
Description copied from interface: EventListener
Return the id of the listener

Specified by:
getName in interface EventListener

setName

public void setName(String name)

onEvent

public void onEvent(Event event)
Description copied from interface: EventListener
Process a sent event.

Specified by:
onEvent in interface EventListener

postprocessEvent

protected void postprocessEvent(Event event)
                         throws IllegalAccessException,
                                InvocationTargetException
Throws:
IllegalAccessException
InvocationTargetException

processEvent

protected void processEvent(Event event,
                            Method method)
                     throws IllegalAccessException,
                            InvocationTargetException
Throws:
IllegalAccessException
InvocationTargetException

preprocessEvent

protected void preprocessEvent(Event event)
                        throws IllegalAccessException,
                               InvocationTargetException
Throws:
IllegalAccessException
InvocationTargetException

handleException

protected void handleException(Event event,
                               Throwable cause)

setAnnotatedListener

public void setAnnotatedListener(Object annotatedListener)

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

stop

public void stop()
Specified by:
stop in interface StoppableEventListener

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception

setEventSubscriptionService

public void setEventSubscriptionService(EventSubscriptionService subscriptionService)


Copyright © 2009. All Rights Reserved.