net.officefloor.plugin.servlet.web.http.application
Class ServletHttpRequestStateManagedObjectSource.ServletHttpRequestStateManagedObject

java.lang.Object
  extended by net.officefloor.plugin.servlet.web.http.application.ServletHttpRequestStateManagedObjectSource.ServletHttpRequestStateManagedObject
All Implemented Interfaces:
CoordinatingManagedObject<ServletHttpRequestStateManagedObjectSource.Dependencies>, ManagedObject, HttpRequestState
Enclosing class:
ServletHttpRequestStateManagedObjectSource

public static class ServletHttpRequestStateManagedObjectSource.ServletHttpRequestStateManagedObject
extends Object
implements CoordinatingManagedObject<ServletHttpRequestStateManagedObjectSource.Dependencies>, HttpRequestState

ManagedObject for the ServletBridge.


Constructor Summary
ServletHttpRequestStateManagedObjectSource.ServletHttpRequestStateManagedObject()
           
 
Method Summary
 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()
          Obtains an Iterator to the names of the bound Object instances.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletHttpRequestStateManagedObjectSource.ServletHttpRequestStateManagedObject

public ServletHttpRequestStateManagedObjectSource.ServletHttpRequestStateManagedObject()
Method Detail

loadObjects

public void loadObjects(ObjectRegistry<ServletHttpRequestStateManagedObjectSource.Dependencies> registry)
                 throws Throwable
Description copied from interface: 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.

Specified by:
loadObjects in interface CoordinatingManagedObject<ServletHttpRequestStateManagedObjectSource.Dependencies>
Parameters:
registry - Registry of the Objects for the ManagedObject instances.
Throws:
Throwable - Should this CoordinatingManagedObject fail to load the ManagedObject.

getObject

public Object getObject()
                 throws Throwable
Description copied from interface: ManagedObject
Obtains the object being managed.

Specified by:
getObject in interface ManagedObject
Returns:
Object being managed.
Throws:
Throwable - Indicating failed to obtain the object for use.

getAttribute

public Serializable getAttribute(String name)
Description copied from interface: HttpRequestState
Obtains the Object that is bound to the name.

Specified by:
getAttribute in interface HttpRequestState
Parameters:
name - Name.
Returns:
Object bound to the name or null if no Object bound by the name.

getAttributeNames

public Iterator<String> getAttributeNames()
Description copied from interface: HttpRequestState
Obtains an Iterator to the names of the bound Object instances.

Specified by:
getAttributeNames in interface HttpRequestState
Returns:
Iterator to the names of the bound Object instances.

setAttribute

public void setAttribute(String name,
                         Serializable object)
Description copied from interface: HttpRequestState
Binds the Object to the name.

Specified by:
setAttribute in interface HttpRequestState
Parameters:
name - Name.
object - Object. Must be Serializable as this HttpRequestState may be stored in the HttpSession to maintain its state across a redirect.

removeAttribute

public void removeAttribute(String name)
Description copied from interface: HttpRequestState
Removes the bound Object by the name.

Specified by:
removeAttribute in interface HttpRequestState
Parameters:
name - Name of bound Object to remove.

exportState

public Serializable exportState()
                         throws IOException
Description copied from interface: HttpRequestState
Exports a momento for the current state of this HttpRequestState.

Specified by:
exportState in interface HttpRequestState
Returns:
Momento for the current state of this HttpRequestState.
Throws:
IOException - If fails to export state.

importState

public void importState(Serializable momento)
                 throws IOException,
                        IllegalArgumentException
Description copied from interface: HttpRequestState
Imports the state from the momento.

Specified by:
importState in interface HttpRequestState
Parameters:
momento - Momento containing the state for the HttpRequestState.
Throws:
IOException - If fails to import state.
IllegalArgumentException - If invalid momento.


Copyright © 2005-2013. All Rights Reserved.