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
ManagedObjectSourcefor theHttpRequestState.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext
-
-
Constructor Summary
Constructors Constructor Description HttpApplicationStateManagedObjectSource(java.lang.String contextPath)Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcreateApplicationClientPath(java.lang.String path)Creates the client path for this application.java.lang.StringcreateApplicationClientUrl(boolean isSecure, java.lang.String path, ServerHttpConnection connection)Creates the client URL for this application.java.lang.StringextractApplicationPath(ServerHttpConnection connection)Extracts the application path from theHttpRequest.java.lang.ObjectgetAttribute(java.lang.String name)Obtains theObjectthat is bound to the name.java.util.Iterator<java.lang.String>getAttributeNames()Obtains anIteratorto the names of the boundObjectinstances.java.lang.StringgetContextPath()Obtains the context path for the application.protected ManagedObjectgetManagedObject()Synchronously obtains theManagedObject.java.lang.ObjectgetObject()Obtains the object being managed.protected voidloadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,None> context)Overridden to load meta-data.protected voidloadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)Overridden to load specifications.voidremoveAttribute(java.lang.String name)Removes the boundObjectby the name.voidsetAttribute(java.lang.String name, java.lang.Object object)Binds theObjectto the name.-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObject
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, start, stop
-
-
-
-
Method Detail
-
loadSpecification
protected void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
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 java.lang.Exception
Description copied from class:AbstractAsyncManagedObjectSourceOverridden to load meta-data.- Specified by:
loadMetaDatain classAbstractAsyncManagedObjectSource<None,None>- Parameters:
context- Meta-data.- Throws:
java.lang.Exception- If fails to load the meta-data.
-
getManagedObject
protected ManagedObject getManagedObject() throws java.lang.Throwable
Description copied from class:AbstractManagedObjectSourceSynchronously obtains theManagedObject.- Specified by:
getManagedObjectin classAbstractManagedObjectSource<None,None>- Returns:
ManagedObject.- Throws:
java.lang.Throwable- If fails to obtain theManagedObject.
-
getObject
public java.lang.Object getObject() throws java.lang.ThrowableDescription copied from interface:ManagedObjectObtains the object being managed.- Specified by:
getObjectin interfaceManagedObject- Returns:
- Object being managed.
- Throws:
java.lang.Throwable- Indicating failed to obtain the object for use.
-
getContextPath
public java.lang.String getContextPath()
Description copied from interface:HttpApplicationStateObtains the context path for the application.- Specified by:
getContextPathin interfaceHttpApplicationState- Returns:
- Context path for the application.
-
createApplicationClientUrl
public java.lang.String createApplicationClientUrl(boolean isSecure, java.lang.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
public java.lang.String createApplicationClientPath(java.lang.String path)
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
public java.lang.String extractApplicationPath(ServerHttpConnection connection) throws HttpException
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
public java.lang.Object getAttribute(java.lang.String name)
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
public java.util.Iterator<java.lang.String> getAttributeNames()
Description copied from interface:HttpApplicationStateObtains anIteratorto the names of the boundObjectinstances.- Specified by:
getAttributeNamesin interfaceHttpApplicationState- Returns:
Iteratorto the names of the boundObjectinstances.
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object object)Description copied from interface:HttpApplicationStateBinds theObjectto the name.- Specified by:
setAttributein interfaceHttpApplicationState- Parameters:
name- Name.object-Object.
-
removeAttribute
public void removeAttribute(java.lang.String name)
Description copied from interface:HttpApplicationStateRemoves the boundObjectby the name.- Specified by:
removeAttributein interfaceHttpApplicationState- Parameters:
name- Name of boundObjectto remove.
-
-