Class BaseEventHandler

java.lang.Object
org.adempiere.base.event.annotations.BaseEventHandler
All Implemented Interfaces:
org.osgi.service.event.EventHandler
Direct Known Subclasses:
ImportEventHandler, ModelEventHandler, ProcessEventHandler, SimpleEventHandler

public abstract class BaseEventHandler extends Object implements org.osgi.service.event.EventHandler
Base class for event handler that works with annotation driven event delegate (EventTopicDelegate). The implementation of event delegate doesn't have to be thread safe as a new instance of delegate is created for each event call.
Author:
hengsin
  • Field Details

    • eventTopicMap

      protected final Map<String,Method> eventTopicMap
      event topic:method
  • Constructor Details

    • BaseEventHandler

      public BaseEventHandler(Class<? extends EventDelegate> delegateClass)
      Parameters:
      delegateClass -
  • Method Details

    • createTopicMap

      protected void createTopicMap(Class<?> delegateClass)
      create event topic to method mapping from annotations
      Parameters:
      delegateClass -
    • getTopics

      public String[] getTopics()
      Returns:
      arrays of event topic
    • getFilter

      public String getFilter()
      Returns:
      event filter
    • setFilter

      public void setFilter(String filter)
      set event filter
      Parameters:
      filter -
    • setEventPropertyFilter

      public void setEventPropertyFilter(String propertyName, String value)
      Parameters:
      propertyName -
      value -
    • handleEvent

      public void handleEvent(org.osgi.service.event.Event event)
      Specified by:
      handleEvent in interface org.osgi.service.event.EventHandler
    • newEventDelegate

      protected abstract EventDelegate newEventDelegate(org.osgi.service.event.Event event)
      create new instance of event delegate
      Parameters:
      event -
      Returns:
      new EventDelegate instance
    • getDelegateClass

      public Class<? extends EventDelegate> getDelegateClass()
      Returns:
      event delegate class