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
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
ConstructorsModifierConstructorDescriptionprotectedCreates a new SessionEvent with bubbling enabled.protectedSessionEvent(boolean bubbles) Creates a new SessionEvent with the specified bubbling behavior.protectedSessionEvent(int id) Creates a new SessionEvent with the specified ID.protectedSessionEvent(int id, boolean bubbles) Creates a new SessionEvent with the specified ID and bubbling behavior. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatch()Dispatches this event to all pages within the current session.voiddispatchTo(T listener) Dispatches this event to the specified listener.intgetId()Returns the event identifier.
-
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-trueif this event should bubble,falseotherwise
-
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 identifierbubbles-trueif this event should bubble,falseotherwise
-
-
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
Dispatches this event to the specified listener.Subclasses implement this method to call the appropriate handler method on the listener interface.
- Specified by:
dispatchToin classEvent<T extends SessionEventListener>- Parameters:
listener- the listener to dispatch this event to
-