Class AbstractEventHandler

  • All Implemented Interfaces:
    org.osgi.service.event.EventHandler
    Direct Known Subclasses:
    RequestEventHandler

    public abstract class AbstractEventHandler
    extends Object
    implements org.osgi.service.event.EventHandler
    Author:
    hengsin
    • Constructor Detail

      • AbstractEventHandler

        public AbstractEventHandler()
    • Method Detail

      • handleEvent

        public void handleEvent​(org.osgi.service.event.Event event)
        Specified by:
        handleEvent in interface org.osgi.service.event.EventHandler
        See Also:
        EventHandler.handleEvent(org.osgi.service.event.Event)
      • bindEventManager

        public void bindEventManager​(IEventManager eventManager)
        Parameters:
        eventManager -
      • unbindEventManager

        public void unbindEventManager​(IEventManager eventManager)
        Parameters:
        eventManager -
      • doHandleEvent

        protected abstract void doHandleEvent​(org.osgi.service.event.Event event)
        override this method to handle event
        Parameters:
        event -
      • initialize

        protected abstract void initialize()
        override this method to register event that the class want to listen to
      • registerEvent

        protected void registerEvent​(String eventTopic)
        Parameters:
        eventTopic -
      • registerEvent

        protected void registerEvent​(String topic,
                                     String filter)
        Parameters:
        topic -
        filter -
      • registerTableEvent

        protected void registerTableEvent​(String topic,
                                          String tableName)
        Parameters:
        topic -
        tableName -
      • registerProcessEvent

        protected void registerProcessEvent​(String topic,
                                            String classOrUUID)
        Parameters:
        topic -
        classOrUUID - className or ProcessUUID
      • getPO

        protected PO getPO​(org.osgi.service.event.Event event)
        Parameters:
        event -
        Returns:
        PO
      • getProcessInfo

        protected ProcessInfo getProcessInfo​(org.osgi.service.event.Event event)
        Parameters:
        event -
        Returns:
        ProcessInfo
      • getEventData

        protected <T> T getEventData​(org.osgi.service.event.Event event)
        Type Parameters:
        T -
        Parameters:
        event -
      • getEventProperty

        protected <T> T getEventProperty​(org.osgi.service.event.Event event,
                                         String property)
        Type Parameters:
        T -
        Parameters:
        event -
        property -
      • addError

        protected void addError​(org.osgi.service.event.Event event,
                                Throwable e)
        Parameters:
        event -
        e -
      • addErrorMessage

        protected void addErrorMessage​(org.osgi.service.event.Event event,
                                       String errorMessage)
        Parameters:
        event -
        errorMessage -