|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The StateManagerService is a service that manages SessionState information. Each SessionState is identified by a unique key in this service. The SessionState is composed of name - value sets of attributes, stored under the key by the service.
See the proposal: jakarta-jetspeed/proposals/StateManager.txt for more details.
Attribute values placed into SessionStates may be automatically removed, for example when a SessionState expires in some way, or by means of some other automatic service. These value objects can be notified of their placement into and out of the SessionState. Objects that wish to receive this notification implement the SessionStateBindingListener interface. This is based on and similar to the HttpSessionBindingListener mechanism.
To support the "current" routines; the ability to get a session state based on the current http session, this service must be installed properly into the procssing of each http request. At the start of the request, the HttpSession of the request must be passed into the setCurrentContext() method. At the end of the request, clearCurrentContext() is called. For Jetspeed, this is done in the JetspeedRunDataService, which is always going to be called by Turbine in this way.
SessionState
,
SessionStateBindingListener
Field Summary | |
static java.lang.String |
SERVICE_NAME
The name used to find the service in the service manager. |
Method Summary | |
void |
clear(java.lang.String key)
Remove all state attribute of the keyed state. |
void |
clearCurrentContext()
Clear the "current context for this thread - Call at the end of each request, balanced with calls to setCurrentContext() |
java.lang.Object |
getAttribute(java.lang.String key,
java.lang.String name)
Access the named attribute of the keyed state. |
java.lang.String[] |
getAttributeNames(java.lang.String key)
Access an array of all names of attributes stored in the keyed state. |
SessionState |
getCurrentSessionState()
Access the SessionState object associated with the current request's http session. |
SessionState |
getCurrentSessionState(java.lang.String key)
Access the SessionState object associated with the current request's http session with the given key. |
SessionState |
getSessionState(java.lang.String key)
Access an SessionState object with the given key. |
void |
removeAttribute(java.lang.String key,
java.lang.String name)
Remove the named state attribute of the keyed state, if it exists. |
void |
retireState(java.lang.String keyStart)
Retire, forget about and clean up all states that start with the given key. |
void |
setAttribute(java.lang.String key,
java.lang.String name,
java.lang.Object value)
Set the named state attribute of the keyed state with the provided object. |
void |
setCurrentContext(javax.servlet.http.HttpSession session)
Set the "current" context for this thread - Call this at the start of each request, and call %%% at the end. |
Field Detail |
public static final java.lang.String SERVICE_NAME
Method Detail |
public java.lang.Object getAttribute(java.lang.String key, java.lang.String name)
key
- The state key.name
- The attribute name.
public void setAttribute(java.lang.String key, java.lang.String name, java.lang.Object value)
key
- The state key.name
- The attribute name.value
- The new value of the attribute (any object type).public void removeAttribute(java.lang.String key, java.lang.String name)
key
- The state key.name
- The attribute name.public void clear(java.lang.String key)
key
- The state key.public java.lang.String[] getAttributeNames(java.lang.String key)
key
- The state key.
public SessionState getSessionState(java.lang.String key)
key
- The SessionState key.
public SessionState getCurrentSessionState()
public SessionState getCurrentSessionState(java.lang.String key)
key
- The string to add to the session id to form the SessionState key.
public void retireState(java.lang.String keyStart)
keyStart
- The beginning of the key of the states to clean up.public void setCurrentContext(javax.servlet.http.HttpSession session)
session
- the HttpSession of the current request.public void clearCurrentContext()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |