Class EventHandlerSupport

java.lang.Object
net.solarnetwork.central.scheduler.EventHandlerSupport
All Implemented Interfaces:
org.osgi.service.event.EventHandler

public abstract class EventHandlerSupport extends Object implements org.osgi.service.event.EventHandler
Base implementation of EventHandler.

This class traps all Exceptions and logs an error message. This helps prevent the event handler from becoming black-listed by the EventAdmin service, as the Apache Felix implementation does.

  • Field Details

    • log

      protected final org.slf4j.Logger log
      A class-level logger.
  • Constructor Details

    • EventHandlerSupport

      public EventHandlerSupport()
  • Method Details

    • handleEvent

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

      protected abstract void handleEventInternal(org.osgi.service.event.Event event) throws Exception
      Execute the event handler.
      Parameters:
      event - the event
      Throws:
      Exception - if any error occurs