public static class ServletHttpRequestStateManagedObjectSource.ServletHttpRequestStateManagedObject extends Object implements CoordinatingManagedObject<ServletHttpRequestStateManagedObjectSource.Dependencies>, HttpRequestState
ManagedObject
for the ServletBridge
.Constructor and Description |
---|
ServletHttpRequestStateManagedObject() |
Modifier and Type | Method and Description |
---|---|
Serializable |
exportState()
Exports a momento for the current state of this
HttpRequestState . |
Serializable |
getAttribute(String name)
Obtains the
Object that is bound to the name. |
Iterator<String> |
getAttributeNames()
|
Object |
getObject()
Obtains the object being managed.
|
void |
importState(Serializable momento)
Imports the state from the momento.
|
void |
loadObjects(ObjectRegistry<ServletHttpRequestStateManagedObjectSource.Dependencies> registry)
Loads the Objects of the
ManagedObject instances to be referenced
by this CoordinatingManagedObject . |
void |
removeAttribute(String name)
Removes the bound
Object by the name. |
void |
setAttribute(String name,
Serializable object)
Binds the
Object to the name. |
public ServletHttpRequestStateManagedObject()
public void loadObjects(ObjectRegistry<ServletHttpRequestStateManagedObjectSource.Dependencies> registry) throws Throwable
CoordinatingManagedObject
Loads the Objects of the ManagedObject
instances to be referenced
by this CoordinatingManagedObject
.
References to the loaded Objects must be released on recycling the
ManagedObject
.
loadObjects
in interface CoordinatingManagedObject<ServletHttpRequestStateManagedObjectSource.Dependencies>
registry
- Registry of the Objects for the ManagedObject
instances.Throwable
- Should this CoordinatingManagedObject
fail to load
the ManagedObject
.public Object getObject() throws Throwable
ManagedObject
getObject
in interface ManagedObject
Throwable
- Indicating failed to obtain the object for use.public Serializable getAttribute(String name)
HttpRequestState
Object
that is bound to the name.getAttribute
in interface HttpRequestState
name
- Name.Object
bound to the name or null
if no
Object
bound by the name.public Iterator<String> getAttributeNames()
HttpRequestState
getAttributeNames
in interface HttpRequestState
Iterator
to the names of the bound Object
instances.public void setAttribute(String name, Serializable object)
HttpRequestState
Object
to the name.setAttribute
in interface HttpRequestState
name
- Name.object
- Object
. Must be Serializable
as this
HttpRequestState
may be stored in the
HttpSession
to maintain its state across a redirect.public void removeAttribute(String name)
HttpRequestState
Object
by the name.removeAttribute
in interface HttpRequestState
name
- Name of bound Object
to remove.public Serializable exportState() throws IOException
HttpRequestState
HttpRequestState
.exportState
in interface HttpRequestState
HttpRequestState
.IOException
- If fails to export state.public void importState(Serializable momento) throws IOException, IllegalArgumentException
HttpRequestState
importState
in interface HttpRequestState
momento
- Momento containing the state for the HttpRequestState
.IOException
- If fails to import state.IllegalArgumentException
- If invalid momento.Copyright © 2005–2016. All rights reserved.