Class EventServiceImplementation

java.lang.Object
com.sshtools.common.events.EventServiceImplementation
All Implemented Interfaces:
EventService

public class EventServiceImplementation extends Object implements EventService
Event Service Implementation singleton, that manages J2SSH Event Listeners, and allows events to be fired.
Author:
david
  • Field Details

  • Constructor Details

    • EventServiceImplementation

      protected EventServiceImplementation()
  • Method Details

    • setInstance

      protected static void setInstance(EventService eventService)
      Allow alternative event service to set.
    • getInstance

      public static EventService getInstance()
      Get the event service instance
      Returns:
      EventService
    • registerEventCodeDescriptor

      public void registerEventCodeDescriptor(Class cls)
      Description copied from interface: EventService
      Register an event code descriptor (debug use only)
      Specified by:
      registerEventCodeDescriptor in interface EventService
    • getEventName

      public String getEventName(Integer id)
      Description copied from interface: EventService
      Get an event name from the registered event code descriptors (debug use only)
      Specified by:
      getEventName in interface EventService
    • fireEvent

      public void fireEvent(Event evt)
      Send an SSH Event to each registered listener
      Specified by:
      fireEvent in interface EventService
      Parameters:
      evt - event to fire to all listener
    • setProcessAllEventsOnEventException

      public void setProcessAllEventsOnEventException(boolean processAllEventsOnEventException)
    • addListener

      public void addListener(EventListener listener)
      Description copied from interface: EventService
      Add an EventListener to the list of objects that will be sent Events.
      Specified by:
      addListener in interface EventService
      Parameters:
      listener - listener to add
    • removeListener

      public void removeListener(EventListener listener)
      Description copied from interface: EventService
      Remove an EventListener
      Specified by:
      removeListener in interface EventService