|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.turbine.services.BaseInitable
org.apache.turbine.services.BaseService
org.apache.turbine.services.TurbineBaseService
org.apache.jetspeed.services.statemanager.BaseStateManagerService
BaseStateManagerService is a Turbine Service implementation of the StateManagerService.
Each SessionState is stored in a Map, storing the names and values of the state attributes.
The set of states managed is stored in some specific way by extension classes.
See the proposal: jakarta-jetspeed/proposals/StateManager.txt for more details.
StateManagerService,
SessionState| Field Summary | |
protected java.util.Map |
m_httpSessions
map of thread to http session for that thread. |
| Fields inherited from class org.apache.turbine.services.BaseService |
configuration, name, properties, serviceBroker |
| Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
| Fields inherited from interface org.apache.jetspeed.services.statemanager.StateManagerService |
SERVICE_NAME |
| Fields inherited from interface org.apache.turbine.services.Service |
SERVICE_NAME |
| Constructor Summary | |
BaseStateManagerService()
|
|
| Method Summary | |
protected abstract void |
addState(java.lang.String key,
java.util.Map state)
Add a new state to the states we are managing. |
protected void |
bindAttributeValue(java.lang.String stateKey,
java.lang.String attributeName,
java.lang.Object attribute)
If the object is a SessionStateBindingListener, bind it |
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. |
protected abstract java.util.Map |
getState(java.lang.String key)
Access the Map which is the set of attributes for a state. |
protected abstract java.lang.String[] |
getStateKeys(java.lang.String start)
Access an array of the keys of all states managed, those that start with the parameter. |
void |
init()
Performs late initialization. |
void |
init(org.apache.turbine.util.RunData data)
Performs early initialization. |
void |
init(javax.servlet.ServletConfig config)
Performs early initialization. |
protected abstract void |
initStates()
Initialize the states storage. |
void |
removeAttribute(java.lang.String key,
java.lang.String name)
Remove the named state attribute of the keyed state, if it exists. |
protected abstract void |
removeState(java.lang.String key)
Remove a state from the states we are managing. |
protected void |
retireAttributes(java.lang.String key,
java.util.Map state)
retire the attributes of the state. |
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. |
void |
shutdown()
Returns to uninitialized state. |
protected abstract void |
shutdownStates()
Cleanup the states storage. |
protected void |
unBindAttributeValue(java.lang.String stateKey,
java.lang.String attributeName,
java.lang.Object attribute)
If the object is a SessionStateBindingListener, unbind it |
| Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init |
| Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
| Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.turbine.services.Initable |
getInit, setInitableBroker |
| Field Detail |
protected java.util.Map m_httpSessions
| Constructor Detail |
public BaseStateManagerService()
| Method Detail |
protected abstract void initStates()
protected abstract void shutdownStates()
protected abstract java.util.Map getState(java.lang.String key)
key - The state key.
protected abstract void addState(java.lang.String key,
java.util.Map state)
key - The state key.state - The Map which is the set of attributes for the state.protected abstract void removeState(java.lang.String key)
key - The state key.protected abstract java.lang.String[] getStateKeys(java.lang.String start)
start - The starting string used to select the keys.
protected void retireAttributes(java.lang.String key,
java.util.Map state)
key - The state key.state - The Map of attributes to retire.
protected void unBindAttributeValue(java.lang.String stateKey,
java.lang.String attributeName,
java.lang.Object attribute)
stateKey - The state key.attributeName - The attribute name.attribute - The attribute object
protected void bindAttributeValue(java.lang.String stateKey,
java.lang.String attributeName,
java.lang.Object attribute)
stateKey - The state key.attributeName - The attribute name.attribute - The attribute object
public void init(javax.servlet.ServletConfig config)
throws org.apache.turbine.services.InitializationException
config - A ServletConfing to use for initialization
activities.
InitializationException, - if initialization of this
class was not successful.
org.apache.turbine.services.InitializationException
public void init(org.apache.turbine.util.RunData data)
throws org.apache.turbine.services.InitializationException
data - An RunData to use for initialization activities.
InitializationException, - if initialization of this
class was not successful.
org.apache.turbine.services.InitializationException
public void init()
throws org.apache.turbine.services.InitializationException
init in interface org.apache.turbine.services.InitableInitializationException, - if initialization of this
class was not successful.
org.apache.turbine.services.InitializationExceptionpublic void shutdown()
shutdown in interface org.apache.turbine.services.Initable
public java.lang.Object getAttribute(java.lang.String key,
java.lang.String name)
getAttribute in interface StateManagerServicekey - The state key.name - The attribute name.
public void setAttribute(java.lang.String key,
java.lang.String name,
java.lang.Object value)
setAttribute in interface StateManagerServicekey - 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)
removeAttribute in interface StateManagerServicekey - The state key.name - The attribute name.public void clear(java.lang.String key)
clear in interface StateManagerServicekey - The state key.public java.lang.String[] getAttributeNames(java.lang.String key)
getAttributeNames in interface StateManagerServicekey - The state key.
public SessionState getSessionState(java.lang.String key)
getSessionState in interface StateManagerServicekey - The SessionState key.
public SessionState getCurrentSessionState()
getCurrentSessionState in interface StateManagerServicepublic SessionState getCurrentSessionState(java.lang.String key)
getCurrentSessionState in interface StateManagerServicekey - The string to add to the session id to form the SessionState key.
public void retireState(java.lang.String keyStart)
retireState in interface StateManagerServicekeyStart - The beginning of the key of the states to clean up.public void setCurrentContext(javax.servlet.http.HttpSession session)
setCurrentContext in interface StateManagerServicesession - the HttpSession of the current request.public void clearCurrentContext()
clearCurrentContext in interface StateManagerService
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||