Class NativeEventManager<E,L>

java.lang.Object
uk.co.caprica.vlcj.support.eventmanager.NativeEventManager<E,L>
Type Parameters:
E - type of the event object
L - type of the event listener
Direct Known Subclasses:
MediaListPlayerNativeEventManager

public abstract class NativeEventManager<E,L> extends Object
Common implementation for a component that deals with a native LibVlc event manager.

Native events will only be delivered if there is at least one event listener.

  • Method Details

    • addEventListener

      public final void addEventListener(L listener)
      Add a component to be notified of events.
      Parameters:
      listener - component to notify
    • removeEventListener

      public final void removeEventListener(L listener)
      Remove a component that was previously interested in notifications of events.
      Parameters:
      listener - component to stop notifying
    • raiseEvent

      public final void raiseEvent(EventNotification<L> event)
      Raise a new event (dispatch it to listeners).

      Events are processed on the native callback thread, so must execute quickly and certainly must never block.

      It is also generally forbidden for an event handler to call back into LibVLC.

      Parameters:
      event - event to raise, may be null and if so will be ignored
    • release

      public final void release()
      Release this component.