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

Version:
$Id: $
Author:
brozow

Constructor Summary
AnnotationBasedEventListenerAdapter()
          Constructor for AnnotationBasedEventListenerAdapter.
AnnotationBasedEventListenerAdapter(Object annotatedListener, EventSubscriptionService subscriptionService)
          Constructor for AnnotationBasedEventListenerAdapter.
AnnotationBasedEventListenerAdapter(String name, Object annotatedListener, EventSubscriptionService subscriptionService)
          Constructor for AnnotationBasedEventListenerAdapter.
 
Method Summary
 void afterPropertiesSet()
          afterPropertiesSet
 void destroy()
          destroy
 String getLogPrefix()
          getLogPrefix
 String getName()
          getName
protected  void handleException(Event event, Throwable cause)
          handleException
 void onEvent(Event event)
          Process a sent event.
protected  void postprocessEvent(Event event)
          postprocessEvent
protected  void preprocessEvent(Event event)
          preprocessEvent
protected  void processEvent(Event event, Method method)
          processEvent
 void setAnnotatedListener(Object annotatedListener)
          setAnnotatedListener
 void setEventSubscriptionService(EventSubscriptionService subscriptionService)
          setEventSubscriptionService
 void setLogPrefix(String logPrefix)
          setLogPrefix
 void setName(String name)
          setName
 void stop()
          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)

Constructor for AnnotationBasedEventListenerAdapter.

Parameters:
name - a String object.
annotatedListener - a Object object.
subscriptionService - a EventSubscriptionService object.

AnnotationBasedEventListenerAdapter

public AnnotationBasedEventListenerAdapter(Object annotatedListener,
                                           EventSubscriptionService subscriptionService)

Constructor for AnnotationBasedEventListenerAdapter.

Parameters:
annotatedListener - a Object object.
subscriptionService - a EventSubscriptionService object.

AnnotationBasedEventListenerAdapter

public AnnotationBasedEventListenerAdapter()

Constructor for AnnotationBasedEventListenerAdapter.

Method Detail

getName

public String getName()

getName

Specified by:
getName in interface EventListener
Returns:
a String object.

setName

public void setName(String name)

setName

Parameters:
name - a String object.

getLogPrefix

public String getLogPrefix()

getLogPrefix

Returns:
the logPrefix

setLogPrefix

public void setLogPrefix(String logPrefix)

setLogPrefix

Parameters:
logPrefix - the logPrefix to set

onEvent

public void onEvent(Event event)
Process a sent event.

Specified by:
onEvent in interface EventListener
Parameters:
event - a Event object.

postprocessEvent

protected void postprocessEvent(Event event)
                         throws IllegalAccessException,
                                InvocationTargetException

postprocessEvent

Parameters:
event - a Event object.
Throws:
IllegalAccessException - if any.
InvocationTargetException - if any.

processEvent

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

processEvent

Parameters:
event - a Event object.
method - a Method object.
Throws:
IllegalAccessException - if any.
InvocationTargetException - if any.

preprocessEvent

protected void preprocessEvent(Event event)
                        throws IllegalAccessException,
                               InvocationTargetException

preprocessEvent

Parameters:
event - a Event object.
Throws:
IllegalAccessException - if any.
InvocationTargetException - if any.

handleException

protected void handleException(Event event,
                               Throwable cause)

handleException

Parameters:
event - a Event object.
cause - a Throwable object.

setAnnotatedListener

public void setAnnotatedListener(Object annotatedListener)

setAnnotatedListener

Parameters:
annotatedListener - a Object object.

afterPropertiesSet

public void afterPropertiesSet()

afterPropertiesSet

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

stop

public void stop()

stop

Specified by:
stop in interface StoppableEventListener

destroy

public void destroy()
             throws Exception

destroy

Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception - if any.

setEventSubscriptionService

public void setEventSubscriptionService(EventSubscriptionService subscriptionService)

setEventSubscriptionService

Parameters:
subscriptionService - a EventSubscriptionService object.


Copyright © 2011. All Rights Reserved.