|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.sessions.impl.SimpleSessionCoordinator
A thread-safe SessionCoordinator
that can be used for
joining and releasing concurrent requests to and from their
sessions.
SessionCoordinator
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
|
private static DAILogger |
LOG
|
private SessionManager |
mSessionManager
|
Constructor Summary | |
SimpleSessionCoordinator(SessionManager manager)
Creates a new session coordinator that uses the specified session manager for creating, accessing and destroying sessions. |
Method Summary | |
SessionManager |
getSessionManager()
Returns a reference to the SessionManager that is
being used for creating, retrieving and terminating sessions. |
void |
join(SessionParticipant participant)
Joins the specified session participant to a session that matches its requirments. |
void |
release(SessionParticipant participant)
Releases the specified session participant from the session to which it is joined. |
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 static final DAILogger LOG
private final SessionManager mSessionManager
Constructor Detail |
public SimpleSessionCoordinator(SessionManager manager)
manager
- The SessionManager
to use.
IllegalArguementException
- if manager
is
null
.Method Detail |
public void join(SessionParticipant participant) throws SessionNotFoundException, SessionJoinDeniedException, SessionJoinException
SessionCoordinator
A session participant encapsulates its requirements inside the
SessionStrategy
object returned by its
createSessionStrategy
method.
After this method returns the session participant will be able to interact with the session that it has joined.
join
in interface SessionCoordinator
participant
- The SessionParticipant
.
SessionJoinException
- if there is an internal problem that
occurs during the join.
SessionNotFoundException
- if the session specified by the
participant does not exist.
SessionJoinDeniedException
- if there is an
application-specific reason why the participant is not allowed
to join.public void release(SessionParticipant participant) throws SessionNotFoundException, SessionReleaseException
SessionCoordinator
This should be invoked when the session participant has no further need to interact with the session.
release
in interface SessionCoordinator
participant
- the SessionParticipant
to release
SessionNotFoundException
- if the session specified by the
participant does not exist.
SessionReleaseException
- if there is an internal problem that
occurs during the release.public SessionManager getSessionManager()
SessionCoordinator
SessionManager
that is
being used for creating, retrieving and terminating sessions.
getSessionManager
in interface SessionCoordinator
SessionManager
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |