|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.sessions.SessionEventDispatcher
A thread-safe class for dispatching session events to a collection of session
listeners. This class implements the SessionListener
interface
for the sake of consistency. Each time one of the methods of this interface
is invoked, the corresponding event will be dispatched to each of the
registered listeners.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private java.util.Collection |
mListeners
The session listeners that are attached to this session. |
Constructor Summary | |
SessionEventDispatcher()
|
Method Summary | |
void |
addSessionListener(SessionListener listener)
Registers a session listener which will be notified of subsequent session events. |
void |
sessionCleanedUp(SessionEvent event)
Handles the "session cleaned-up" event by invoking the sessionCleanedUp() method on each session listener. |
void |
sessionJoined(SessionEvent event)
Handles the "session joined" event by invoking the sessionJoined() method on each session listener. |
void |
sessionLeft(SessionEvent event)
Handles the "session left" event by invoking the sessionLeft() method on each session listener. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private final java.util.Collection mListeners
Constructor Detail |
public SessionEventDispatcher()
Method Detail |
public void sessionJoined(SessionEvent event)
sessionJoined()
method on each session listener.
sessionJoined
in interface SessionListener
event
- The session event.public void sessionLeft(SessionEvent event)
sessionLeft()
method on each session listener.
sessionLeft
in interface SessionListener
event
- The session event.public void sessionCleanedUp(SessionEvent event)
sessionCleanedUp()
method on each session listener.
sessionCleanedUp
in interface SessionListener
event
- The session event.public void addSessionListener(SessionListener listener)
listener
- The SessionListener
to register.
java.lang.IllegalArgumentException
- if listener
is null
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |