Package org.bgerp.app.event

# 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 Summary

  Constructors
  Constructor
  Description
  `EventProcessor()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `processEvent(Event event, ConnectionSet conSet)`
  Processes an event with registered listeners.
  `static <E extends Event>
  void`
  `subscribe(EventListener<? super E> l, Class<E> clazz)`
  Subscribes a listener to events of a class.
  `static <E extends Event>
  void`
  `subscribe(EventListener<? super E> l, Class<E> clazz, int priority)`
  Subscribes a listener to events of a class.
  `static void`
  `unsubscribe(EventListener<?> l)`
  Unsubscribes a listener from all events.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`