Package net.officefloor.web.state
Class HttpApplicationStateManagedObjectSource
java.lang.Object
net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<None,None>
net.officefloor.web.state.HttpApplicationStateManagedObjectSource
- All Implemented Interfaces:
ManagedObject,ManagedObjectSource<None,,None> HttpApplicationState
@PrivateSource
public class HttpApplicationStateManagedObjectSource
extends AbstractManagedObjectSource<None,None>
implements ManagedObject, HttpApplicationState
ManagedObjectSource for the HttpRequestState.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends Enum<O>,F extends Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates the client path for this application.createApplicationClientUrl(boolean isSecure, String path, ServerHttpConnection connection) Creates the client URL for this application.extractApplicationPath(ServerHttpConnection connection) Extracts the application path from theHttpRequest.getAttribute(String name) Obtains theObjectthat is bound to the name.Obtains the context path for the application.protected ManagedObjectSynchronously obtains theManagedObject.Obtains the object being managed.protected voidOverridden to load meta-data.protected voidOverridden to load specifications.voidremoveAttribute(String name) Removes the boundObjectby the name.voidsetAttribute(String name, Object object) Binds theObjectto the name.Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObjectMethods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, start, stop
-
Constructor Details
-
HttpApplicationStateManagedObjectSource
Instantiate.- Parameters:
contextPath- Context path.
-
-
Method Details
-
loadSpecification
Description copied from class:AbstractAsyncManagedObjectSourceOverridden to load specifications.- Specified by:
loadSpecificationin classAbstractAsyncManagedObjectSource<None,None> - Parameters:
context- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None, None> context) throws ExceptionDescription copied from class:AbstractAsyncManagedObjectSourceOverridden to load meta-data.- Specified by:
loadMetaDatain classAbstractAsyncManagedObjectSource<None,None> - Parameters:
context- Meta-data.- Throws:
Exception- If fails to load the meta-data.
-
getManagedObject
Description copied from class:AbstractManagedObjectSourceSynchronously obtains theManagedObject.- Specified by:
getManagedObjectin classAbstractManagedObjectSource<None,None> - Returns:
ManagedObject.- Throws:
Throwable- If fails to obtain theManagedObject.
-
getObject
Description copied from interface:ManagedObjectObtains the object being managed.- Specified by:
getObjectin interfaceManagedObject- Returns:
- Object being managed.
- Throws:
Throwable- Indicating failed to obtain the object for use.
-
getContextPath
Description copied from interface:HttpApplicationStateObtains the context path for the application.- Specified by:
getContextPathin interfaceHttpApplicationState- Returns:
- Context path for the application.
-
createApplicationClientUrl
public String createApplicationClientUrl(boolean isSecure, String path, ServerHttpConnection connection) Description copied from interface:HttpApplicationStateCreates the client URL for this application.
This includes
protocol,domainandport.- Specified by:
createApplicationClientUrlin interfaceHttpApplicationState- Parameters:
isSecure- Indicates if the URL is secure.path- Path including query string and fragment for the URL.connection-ServerHttpConnection.- Returns:
- Client URL for the application.
-
createApplicationClientPath
Description copied from interface:HttpApplicationStateCreates the client path for this application.
This is the public path on the server, and does NOT
protocol,domainnorport.- Specified by:
createApplicationClientPathin interfaceHttpApplicationState- Parameters:
path- Path including query string and fragment for the path.- Returns:
- Client path for the application.
-
extractApplicationPath
Description copied from interface:HttpApplicationStateExtracts the application path from theHttpRequest.- Specified by:
extractApplicationPathin interfaceHttpApplicationState- Parameters:
connection-ServerHttpConnection.- Returns:
- Application path.
- Throws:
HttpException- If invalid path for this application.
-
getAttribute
Description copied from interface:HttpApplicationStateObtains theObjectthat is bound to the name.- Specified by:
getAttributein interfaceHttpApplicationState- Parameters:
name- Name.- Returns:
Objectbound to the name ornullif noObjectbound by the name.
-
getAttributeNames
Description copied from interface:HttpApplicationState- Specified by:
getAttributeNamesin interfaceHttpApplicationState- Returns:
Iteratorto the names of the boundObjectinstances.
-
setAttribute
Description copied from interface:HttpApplicationStateBinds theObjectto the name.- Specified by:
setAttributein interfaceHttpApplicationState- Parameters:
name- Name.object-Object.
-
removeAttribute
Description copied from interface:HttpApplicationStateRemoves the boundObjectby the name.- Specified by:
removeAttributein interfaceHttpApplicationState- Parameters:
name- Name of boundObjectto remove.
-