public class WebApplicationAutoWireOfficeFloorSource extends AutoWireOfficeFloorSource implements WebAutoWireApplication
AutoWireOfficeFloorSource
providing web application functionality.AbstractOfficeFloorSource.SpecificationContext
Modifier and Type | Field and Description |
---|---|
protected static ManagedObjectSourceWirer |
processScopeWirer
|
HANDLER_INPUT_NAME, HANDLER_SECTION_NAME, WEB_PUBLIC_RESOURCES_CLASS_PATH_PREFIX
Constructor and Description |
---|
WebApplicationAutoWireOfficeFloorSource()
Initiate.
|
Modifier and Type | Method and Description |
---|---|
AutoWireObject |
addHttpApplicationObject(Class<?> objectClass)
Adds an object to be lazily created and stored within the
HttpApplicationState . |
AutoWireObject |
addHttpApplicationObject(Class<?> objectClass,
String bindName)
Adds an object to be lazily created and stored within the
HttpApplicationState . |
AutoWireObject |
addHttpRequestObject(Class<?> objectClass,
boolean isLoadParameters)
Adds an object to be lazily created and stored within the
HttpRequestState . |
AutoWireObject |
addHttpRequestObject(Class<?> objectClass,
boolean isLoadParameters,
String bindName)
Adds an object to be lazily created and stored within the
HttpRequestState . |
AutoWireObject |
addHttpSessionObject(Class<?> objectClass)
Adds an object to be lazily created and stored within the
HttpSession . |
AutoWireObject |
addHttpSessionObject(Class<?> objectClass,
String bindName)
Adds an object to be lazily created and stored within the
HttpSession . |
HttpTemplateAutoWireSection |
addHttpTemplate(String templateUri,
String templateFilePath,
Class<?> templateLogicClass)
Adds a
HttpTemplate available at the specified URI path. |
void |
chainServicer(AutoWireSection section,
String inputName,
String notHandledOutputName)
Chains a
OfficeSectionInput to the end of the servicing chain to
handle a HttpRequest . |
HttpSecurityAutoWireSection |
getHttpSecurity()
Obtains the configured
HttpSecurityAutoWireSection . |
static String |
getTemplateSectionName(String templateUri)
Obtains the
HttpTemplate section name from the
HttpTemplate URI. |
String[] |
getURIs()
Obtains the linked URIs.
|
protected void |
initOfficeFloor(OfficeFloorDeployer deployer,
OfficeFloorSourceContext context)
Allows overriding for initialising the
OfficeFloor before
auto-wiring. |
void |
linkEscalation(Class<? extends Throwable> escalation,
HttpTemplateAutoWireSection template)
Links the
Escalation to be handled by the
HttpTemplateAutoWireSection . |
void |
linkEscalation(Class<? extends Throwable> escalation,
String resourcePath)
Links the
Escalation to be handled by the resource. |
void |
linkToHttpTemplate(AutoWireSection section,
String outputName,
HttpTemplateAutoWireSection template)
Links the
OfficeSectionOutput to render the HttpTemplate . |
void |
linkToResource(AutoWireSection section,
String outputName,
String resourcePath)
Links to a resource.
|
void |
linkToSendResponse(AutoWireSection section,
String outputName)
Links
OfficeSectionOutput to sending the HttpResponse . |
HttpUriLink |
linkUri(String uri,
AutoWireSection section,
String inputName)
Links a URI to an
OfficeSectionInput . |
void |
setDefaultHttpTemplateUriSuffix(String uriSuffix)
Specifies the default URI suffix for the
HttpTemplate URI path
and link URI paths. |
HttpSecurityAutoWireSection |
setHttpSecurity(Class<? extends HttpSecuritySource<?,?,?,?>> httpSecuritySourceClass)
Specifies the
HttpSecuritySource for this
WebAutoWireApplication . |
addGovernance, addManagedObject, addObject, addSection, addSection, addSectionTransformer, addStartupFlow, addSupplier, assignDefaultTeam, assignTeam, getAppropriateAutoWire, getOfficeFloorCompiler, getSection, isLinked, isObjectAvailable, link, linkEscalation, loadSpecification, openOfficeFloor, setProfiler, sourceOfficeFloor, specifyConfigurationProperties
getSpecification
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addGovernance, addManagedObject, addObject, addSection, addSection, addSectionTransformer, addStartupFlow, addSupplier, assignDefaultTeam, assignTeam, getOfficeFloorCompiler, getSection, isLinked, isObjectAvailable, link, linkEscalation, openOfficeFloor, setProfiler
protected static final ManagedObjectSourceWirer processScopeWirer
public WebApplicationAutoWireOfficeFloorSource()
public static String getTemplateSectionName(String templateUri)
HttpTemplate
section name from the
HttpTemplate
URI.templateUri
- HttpTemplate
URI.HttpTemplate
section name.public HttpTemplateAutoWireSection addHttpTemplate(String templateUri, String templateFilePath, Class<?> templateLogicClass)
WebAutoWireApplication
HttpTemplate
available at the specified URI path.addHttpTemplate
in interface WebAutoWireApplication
templateUri
- URI path for the template.templateFilePath
- Path to the template file.templateLogicClass
- Class providing the logic for the template. May be
null
if template does not require logic (e.g.
static page with links).HttpTemplateAutoWireSection
to allow linking flows.public void setDefaultHttpTemplateUriSuffix(String uriSuffix)
WebAutoWireApplication
HttpTemplate
URI path
and link URI paths.setDefaultHttpTemplateUriSuffix
in interface WebAutoWireApplication
uriSuffix
- Default HttpTemplate
URI suffix.public HttpSecurityAutoWireSection setHttpSecurity(Class<? extends HttpSecuritySource<?,?,?,?>> httpSecuritySourceClass)
WebAutoWireApplication
HttpSecuritySource
for this
WebAutoWireApplication
.setHttpSecurity
in interface WebAutoWireApplication
httpSecuritySourceClass
- HttpSecuritySource
Class
.HttpSecurityAutoWireSection
.public HttpSecurityAutoWireSection getHttpSecurity()
WebAutoWireApplication
HttpSecurityAutoWireSection
.getHttpSecurity
in interface WebAutoWireApplication
HttpSecurityAutoWireSection
or
null
if no HttpSecuritySource
is configured.public AutoWireObject addHttpApplicationObject(Class<?> objectClass, String bindName)
WebAutoWireApplication
HttpApplicationState
.addHttpApplicationObject
in interface WebAutoWireApplication
objectClass
- Class of the object.bindName
- Name to bind the object within the
HttpApplicationState
.AutoWireObject
.public AutoWireObject addHttpApplicationObject(Class<?> objectClass)
WebAutoWireApplication
Adds an object to be lazily created and stored within the
HttpApplicationState
.
The bound name is arbitrarily chosen but will be unique for the object.
addHttpApplicationObject
in interface WebAutoWireApplication
objectClass
- Class of the object.AutoWireObject
.public AutoWireObject addHttpSessionObject(Class<?> objectClass, String bindName)
WebAutoWireApplication
HttpSession
.addHttpSessionObject
in interface WebAutoWireApplication
objectClass
- Class of the object.bindName
- Name to bind the object within the HttpSession
.AutoWireObject
.public AutoWireObject addHttpSessionObject(Class<?> objectClass)
WebAutoWireApplication
Adds an object to be lazily created and stored within the
HttpSession
.
The bound name is arbitrarily chosen but will be unique for the object.
addHttpSessionObject
in interface WebAutoWireApplication
objectClass
- Class of the object.AutoWireObject
.public AutoWireObject addHttpRequestObject(Class<?> objectClass, boolean isLoadParameters, String bindName)
WebAutoWireApplication
HttpRequestState
.addHttpRequestObject
in interface WebAutoWireApplication
objectClass
- Class of the object.isLoadParameters
- Indicates whether to load the HTTP parameters to instantiated
objects.bindName
- Name to bind the object within the HttpRequestState
.AutoWireObject
.public AutoWireObject addHttpRequestObject(Class<?> objectClass, boolean isLoadParameters)
WebAutoWireApplication
Adds an object to be lazily created and stored within the
HttpRequestState
.
The bound name is arbitrarily chosen but will be unique for the object.
addHttpRequestObject
in interface WebAutoWireApplication
objectClass
- Class of the object.isLoadParameters
- Indicates whether to load the HTTP parameters to instantiated
objects.AutoWireObject
.public HttpUriLink linkUri(String uri, AutoWireSection section, String inputName)
WebAutoWireApplication
OfficeSectionInput
.linkUri
in interface WebAutoWireApplication
uri
- URI to be linked.section
- AutoWireSection
servicing the URI.inputName
- Name of the OfficeSectionInput
servicing the URI.HttpUriLink
to configure handling the URI.public void linkToHttpTemplate(AutoWireSection section, String outputName, HttpTemplateAutoWireSection template)
WebAutoWireApplication
OfficeSectionOutput
to render the HttpTemplate
.linkToHttpTemplate
in interface WebAutoWireApplication
section
- AutoWireSection
.outputName
- Name of the OfficeSectionOutput
.template
- HttpTemplateAutoWireSection
.public void linkToResource(AutoWireSection section, String outputName, String resourcePath)
WebAutoWireApplication
Links to a resource.
The meaning of resource path is specific to implementation.
linkToResource
in interface WebAutoWireApplication
section
- AutoWireSection
.outputName
- Name of the OfficeSectionOutput
.resourcePath
- Resource path.public void linkEscalation(Class<? extends Throwable> escalation, HttpTemplateAutoWireSection template)
WebAutoWireApplication
Escalation
to be handled by the
HttpTemplateAutoWireSection
.linkEscalation
in interface WebAutoWireApplication
escalation
- Escalation
.template
- HttpTemplateAutoWireSection
.public void linkEscalation(Class<? extends Throwable> escalation, String resourcePath)
WebAutoWireApplication
Escalation
to be handled by the resource.linkEscalation
in interface WebAutoWireApplication
escalation
- Escalation
.resourcePath
- Resource path.public void linkToSendResponse(AutoWireSection section, String outputName)
WebAutoWireApplication
OfficeSectionOutput
to sending the HttpResponse
.linkToSendResponse
in interface WebAutoWireApplication
section
- AutoWireSection
.outputName
- Name of the OfficeSectionOutput
.public void chainServicer(AutoWireSection section, String inputName, String notHandledOutputName)
WebAutoWireApplication
Chains a OfficeSectionInput
to the end of the servicing chain to
handle a HttpRequest
.
The WebAutoWireApplication
functionality is always the first in
the chain to attempt to service the HttpRequest
.
Typically the last in the chain is servicing the HttpRequest
by
sending a static resource by matching URI to resource name - and if no
resource found, a not found error.
chainServicer
in interface WebAutoWireApplication
section
- AutoWireSection
.inputName
- Name of the OfficeSectionInput
.notHandledOutputName
- Name of the OfficeSectionOutput
should this servicer
not handle the HttpRequest
. May be null
if handles all HttpRequest
instances (any services
chained after this will therefore not be used).public String[] getURIs()
WebAutoWireApplication
Obtains the linked URIs.
HttpTemplateAutoWireSection
URIs are not included in this list.
To determine if the HttpTemplateAutoWireSection
is serviced (e.g.
for embedding with a JEE server for Servlet mapping) use the template URI
suffix.
getURIs
in interface WebAutoWireApplication
protected void initOfficeFloor(OfficeFloorDeployer deployer, OfficeFloorSourceContext context) throws Exception
AutoWireOfficeFloorSource
OfficeFloor
before
auto-wiring.initOfficeFloor
in class AutoWireOfficeFloorSource
deployer
- OfficeFloorDeployer
.context
- OfficeFloorSourceContext
.Exception
- If fails to initialise.Copyright © 2005–2016. All rights reserved.