Class EventProcessor

java.lang.Object
org.bgerp.app.event.EventProcessor
Direct Known Subclasses:
EventProcessor

public class EventProcessor extends Object
Event processor, implementing Singleton and Observable patterns.
  • Constructor Details

    • EventProcessor

      public EventProcessor()
  • Method Details

    • subscribe

      public static <E extends Event> void subscribe(EventListener<? super E> l, Class<E> clazz)
      Subscribes a listener to events of a class.
      Parameters:
      l - the listener.
      clazz - the event class.
    • subscribe

      public static <E extends Event> void subscribe(EventListener<? super E> l, Class<E> clazz, int priority)
      Subscribes a listener to events of a class.
      Parameters:
      l - the listener.
      clazz - the event class.
      priority - the listener's priority, high priority listeners process events earlier.
    • unsubscribe

      public static void unsubscribe(EventListener<?> l)
      Unsubscribes a listener from all events.
      Parameters:
      l - the listener.
    • processEvent

      public static void processEvent(Event event, ConnectionSet conSet) throws Exception
      Processes an event with registered listeners.
      Parameters:
      event - the event.
      conSet - a DB connections set.
      Throws:
      BGMessageException
      Exception