Class 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. 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
    • Constructor Detail

      • BaseEventHandler

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

      • createTopicMap

        protected void createTopicMap​(Class<?> delegateClass)
        create event to 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:
        EventDelegate