Class SessionEvent<T extends SessionEventListener>

java.lang.Object
com.oorian.messaging.events.Event<T>
com.oorian.messaging.events.server.SessionEvent<T>
Type Parameters:
T - the type of listener that handles this event
Direct Known Subclasses:
LocaleChangeEvent

public abstract class SessionEvent<T extends SessionEventListener> extends Event<T>
Abstract base class for session-scoped events dispatched within a single user session.

Session events are dispatched to all pages within the current user's session, making them suitable for intra-session communication such as notifying all open tabs of a data change.

  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a new SessionEvent with bubbling enabled.
    protected
    SessionEvent(boolean bubbles)
    Creates a new SessionEvent with the specified bubbling behavior.
    protected
    SessionEvent(int id)
    Creates a new SessionEvent with the specified ID.
    protected
    SessionEvent(int id, boolean bubbles)
    Creates a new SessionEvent with the specified ID and bubbling behavior.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Dispatches this event to all pages within the current session.
    void
    dispatchTo(T listener)
    Dispatches this event to the specified listener.
    int
    Returns the event identifier.

    Methods inherited from class com.oorian.messaging.events.Event

    bubbles

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SessionEvent

      protected SessionEvent()
      Creates a new SessionEvent with bubbling enabled.
    • SessionEvent

      protected SessionEvent(boolean bubbles)
      Creates a new SessionEvent with the specified bubbling behavior.
      Parameters:
      bubbles - true if this event should bubble, false otherwise
    • SessionEvent

      protected SessionEvent(int id)
      Creates a new SessionEvent with the specified ID.
      Parameters:
      id - the event identifier
    • SessionEvent

      protected SessionEvent(int id, boolean bubbles)
      Creates a new SessionEvent with the specified ID and bubbling behavior.
      Parameters:
      id - the event identifier
      bubbles - true if this event should bubble, false otherwise
  • Method Details

    • getId

      public int getId()
      Returns the event identifier.
      Returns:
      the event ID
    • dispatch

      public void dispatch()
      Dispatches this event to all pages within the current session.
    • dispatchTo

      public void dispatchTo(T listener)
      Dispatches this event to the specified listener.

      Subclasses implement this method to call the appropriate handler method on the listener interface.

      Specified by:
      dispatchTo in class Event<T extends SessionEventListener>
      Parameters:
      listener - the listener to dispatch this event to