|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
Represents a clustered session.
A Session is created by a SessionManager and is uniquely identified by its sessionId. More accurately, this sessionId is unique within the set of SessionManagers from which this Session has been sourced. If two Sessions have the same sessionId, then a client can be sure that they have been created from two distinct set of SessionManagers.
A Session provides Map like contracts to manipulate state information. State information must be Serializable as it may be marshalled automatically by the underpinning local SessionManager. At any given point of time, a Session is uniquely "instantiated" once cluster wide. Also, cluster wide accesses to a given Session are ensured to be serialized by the set of SessionManagers from which the Session has been sourced. The interposition of a ClusteredInvocation between a client and the Session this client would like to access enforces unique instantiation and access serialization cluster wide for a given Session.
Method Summary | |
---|---|
Object |
addState(String key,
Object value)
Map like contract to manipulate state information. |
String |
getSessionId()
Gets the sessionId. |
Map |
getState()
Map like contract to manipulate state information. |
Object |
getState(String key)
Map like contract to manipulate state information. |
void |
onEndAccess()
Notifies the session that state accesses are now completed. |
void |
release()
Releases the session. |
Object |
removeState(String key)
Map like contract to manipulate state information. |
Method Detail |
---|
String getSessionId()
Object addState(String key, Object value)
Object getState(String key)
Object removeState(String key)
Map getState()
The returned Map is mutable and is backed by the session.
void release()
When a Session is released, it is released from the underlying set of SessionManagers. In other words, its sessionId is unknown and its state is permanently lost. After the release of a Session, the behavior of the other methods is undefined.
void onEndAccess()
When state accesses end, the underlying local SessionManager may decide to replicate synchronously or asynchronously the current state to remote SessionManagers.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |