net.officefloor.plugin.woof
Class WoofOfficeFloorSource

java.lang.Object
  extended by net.officefloor.compile.spi.officefloor.source.impl.AbstractOfficeFloorSource
      extended by net.officefloor.autowire.impl.AutoWireOfficeFloorSource
          extended by net.officefloor.plugin.web.http.application.WebApplicationAutoWireOfficeFloorSource
              extended by net.officefloor.plugin.web.http.server.HttpServerAutoWireOfficeFloorSource
                  extended by net.officefloor.plugin.woof.WoofOfficeFloorSource
All Implemented Interfaces:
AutoWireApplication, PropertyConfigurable, OfficeFloorSource, WebAutoWireApplication, HttpServerAutoWireApplication, WoofContextConfigurable

public class WoofOfficeFloorSource
extends HttpServerAutoWireOfficeFloorSource
implements WoofContextConfigurable

main class to run a WoofModel on a HttpServerAutoWireApplication.

Author:
Daniel Sagenschneider

Nested Class Summary
 
Nested classes/interfaces inherited from class net.officefloor.compile.spi.officefloor.source.impl.AbstractOfficeFloorSource
AbstractOfficeFloorSource.SpecificationContext
 
Field Summary
static String DEFAULT_OBJECTS_CONFIGURATION_LOCATION
          Default Objects configuration location.
static String DEFAULT_TEAMS_CONFIGURATION_LOCATION
          Default Teams configuration location.
static String DEFAULT_WOOF_CONFIGUARTION_LOCATION
          Default WoOF configuration location.
static String PROPERTY_HTTP_PORT
          Property to specify the HTTP port.
static String PROPERTY_OBJECTS_CONFIGURATION_LOCATION
          Property for the location of the Objects configuration for the application.
static String PROPERTY_TEAMS_CONFIGURATION_LOCATION
          Property for the location of the Teams configuration for the application.
static String PROPERTY_WEBAPP_LOCATION
          Property to override the default location of the webapp directory within a Maven project.
static String PROPERTY_WOOF_CONFIGURATION_LOCATION
          Property for the location of the WoOF configuration for the application.
static String WEBAPP_PATH
          Default path within a Maven project to the webapp directory.
static String WEBXML_FILE_PATH
          Path within WEBAPP_PATH for the web.xml file.
static String WOOF_TEMPLATE_URI_SUFFIX
          WoOF HttpTemplate URI suffix.
 
Fields inherited from interface net.officefloor.plugin.web.http.application.WebAutoWireApplication
HANDLER_INPUT_NAME, HANDLER_SECTION_NAME, WEB_PUBLIC_RESOURCES_CLASS_PATH_PREFIX
 
Constructor Summary
WoofOfficeFloorSource()
          Initiate.
 
Method Summary
 void addProperty(String name, String value)
          Adds a Property to configure the item.
 void addResources(ResourceSource resourceSource)
          Adds a ResourceSource.
protected  void configure(HttpServerAutoWireOfficeFloorSource application)
          Allows overriding to provide additional configuration.
protected  void initOfficeFloor(OfficeFloorDeployer deployer, OfficeFloorSourceContext context)
          Allows overriding for initialising the OfficeFloor before auto-wiring.
static void loadOptionalConfiguration(AutoWireApplication application, String objectsLocation, String teamsLocation, ConfigurationContext configurationContext)
          Loads the optional configuration.
static void loadWebApplicationExtensions(WebAutoWireApplication application, SourceProperties properties, ClassLoader classLoader, ResourceSource... resourceSources)
          Loads extension functionality from the WoofApplicationExtensionService instances.
static void loadWebResources(WoofContextConfigurable contextConfigurable, File webAppDir, File... resourceDirectories)
          Loads the web application resources for WoOF within a Maven project.
static void loadWebResourcesFromMavenProject(WoofContextConfigurable contextConfigurable, File projectDirectory)
          Loads the web application resources for WoOF within a Maven project.
static void main(String... args)
          main to run the WoofModel.
static void run(WoofOfficeFloorSource application)
          Configures and runs the HttpServerAutoWireApplication.
 void setWebAppDirectory(File webappDirectory)
           Provides location of the webapp directory.
static void start(String... args)
           Starts the WoofOfficeFloorSource for unit testing.
static void stop()
          Stops the WoofOfficeFloorSource for unit testing.
 
Methods inherited from class net.officefloor.plugin.web.http.server.HttpServerAutoWireOfficeFloorSource
addHttpServerSocket, addHttpsServerSocket, getHttpSessionAutoWireObject
 
Methods inherited from class net.officefloor.plugin.web.http.application.WebApplicationAutoWireOfficeFloorSource
addHttpApplicationObject, addHttpApplicationObject, addHttpRequestObject, addHttpRequestObject, addHttpSessionObject, addHttpSessionObject, addHttpTemplate, chainServicer, getHttpSecurity, getTemplateSectionName, getURIs, linkEscalation, linkEscalation, linkToHttpTemplate, linkToResource, linkToSendResponse, linkUri, setDefaultHttpTemplateUriSuffix, setHttpSecurity
 
Methods inherited from class net.officefloor.autowire.impl.AutoWireOfficeFloorSource
addGovernance, addManagedObject, addObject, addSection, addSection, addSectionTransformer, addStartupFlow, addSupplier, assignDefaultTeam, assignTeam, getAppropriateAutoWire, getOfficeFloorCompiler, getSection, isLinked, isObjectAvailable, link, linkEscalation, loadSpecification, openOfficeFloor, setProfiler, sourceOfficeFloor, specifyConfigurationProperties
 
Methods inherited from class net.officefloor.compile.spi.officefloor.source.impl.AbstractOfficeFloorSource
getSpecification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.officefloor.plugin.web.http.application.WebAutoWireApplication
addHttpApplicationObject, addHttpApplicationObject, addHttpRequestObject, addHttpRequestObject, addHttpSessionObject, addHttpSessionObject, addHttpTemplate, chainServicer, getHttpSecurity, getURIs, linkEscalation, linkEscalation, linkToHttpTemplate, linkToResource, linkToSendResponse, linkUri, setDefaultHttpTemplateUriSuffix, setHttpSecurity
 
Methods inherited from interface net.officefloor.autowire.AutoWireApplication
addGovernance, addManagedObject, addObject, addSection, addSection, addSectionTransformer, addStartupFlow, addSupplier, assignDefaultTeam, assignTeam, getOfficeFloorCompiler, getSection, isLinked, isObjectAvailable, link, linkEscalation, openOfficeFloor, setProfiler
 

Field Detail

PROPERTY_WOOF_CONFIGURATION_LOCATION

public static final String PROPERTY_WOOF_CONFIGURATION_LOCATION
Property for the location of the WoOF configuration for the application.

See Also:
Constant Field Values

DEFAULT_WOOF_CONFIGUARTION_LOCATION

public static final String DEFAULT_WOOF_CONFIGUARTION_LOCATION
Default WoOF configuration location.

See Also:
Constant Field Values

PROPERTY_OBJECTS_CONFIGURATION_LOCATION

public static final String PROPERTY_OBJECTS_CONFIGURATION_LOCATION
Property for the location of the Objects configuration for the application.

See Also:
Constant Field Values

DEFAULT_OBJECTS_CONFIGURATION_LOCATION

public static final String DEFAULT_OBJECTS_CONFIGURATION_LOCATION
Default Objects configuration location.

See Also:
Constant Field Values

PROPERTY_TEAMS_CONFIGURATION_LOCATION

public static final String PROPERTY_TEAMS_CONFIGURATION_LOCATION
Property for the location of the Teams configuration for the application.

See Also:
Constant Field Values

DEFAULT_TEAMS_CONFIGURATION_LOCATION

public static final String DEFAULT_TEAMS_CONFIGURATION_LOCATION
Default Teams configuration location.

See Also:
Constant Field Values

PROPERTY_WEBAPP_LOCATION

public static final String PROPERTY_WEBAPP_LOCATION
Property to override the default location of the webapp directory within a Maven project.

See Also:
Constant Field Values

WEBAPP_PATH

public static final String WEBAPP_PATH
Default path within a Maven project to the webapp directory.

See Also:
Constant Field Values

WEBXML_FILE_PATH

public static final String WEBXML_FILE_PATH
Path within WEBAPP_PATH for the web.xml file.

See Also:
Constant Field Values

PROPERTY_HTTP_PORT

public static final String PROPERTY_HTTP_PORT
Property to specify the HTTP port.

See Also:
Constant Field Values

WOOF_TEMPLATE_URI_SUFFIX

public static final String WOOF_TEMPLATE_URI_SUFFIX
WoOF HttpTemplate URI suffix.

See Also:
Constant Field Values
Constructor Detail

WoofOfficeFloorSource

public WoofOfficeFloorSource()
Initiate.

Method Detail

start

public static void start(String... args)
                  throws Exception

Starts the WoofOfficeFloorSource for unit testing.

This will attempt to close all existing OfficeFloor instances to have a clean start.

Parameters:
args - Command line arguments which are paired name/values for the Property loaded to the OfficeFloorCompiler for compiling and running.
Throws:
Exception - If fails to start.

stop

public static void stop()
                 throws Exception
Stops the WoofOfficeFloorSource for unit testing.

Throws:
Exception - If fails to stop.

main

public static void main(String... args)
                 throws Exception
main to run the WoofModel.

Parameters:
args - Command line arguments which are paired name/values for the Property loaded to the OfficeFloorCompiler for compiling and running.
Throws:
Exception - If fails to run.

run

public static void run(WoofOfficeFloorSource application)
                throws Exception
Configures and runs the HttpServerAutoWireApplication.

Parameters:
application - WoofOfficeFloorSource.
Throws:
Exception - If fails to run.

loadWebResourcesFromMavenProject

public static void loadWebResourcesFromMavenProject(WoofContextConfigurable contextConfigurable,
                                                    File projectDirectory)
Loads the web application resources for WoOF within a Maven project.

Parameters:
contextConfigurable - WoofContextConfigurable.
projectDirectory - Maven project directory.

loadWebResources

public static void loadWebResources(WoofContextConfigurable contextConfigurable,
                                    File webAppDir,
                                    File... resourceDirectories)
Loads the web application resources for WoOF within a Maven project.

Parameters:
contextConfigurable - WoofContextConfigurable.
webAppDir - webapp directory.
resourceDirectories - Directories to source public resources.

loadWebApplicationExtensions

public static void loadWebApplicationExtensions(WebAutoWireApplication application,
                                                SourceProperties properties,
                                                ClassLoader classLoader,
                                                ResourceSource... resourceSources)
                                         throws Exception
Loads extension functionality from the WoofApplicationExtensionService instances.

Parameters:
application - WebAutoWireApplication.
properties - SourceProperties.
classLoader - ClassLoader.
resourceSources - ResourceSource instances.
Throws:
Exception - If fails to load the extension functionality.

loadOptionalConfiguration

public static void loadOptionalConfiguration(AutoWireApplication application,
                                             String objectsLocation,
                                             String teamsLocation,
                                             ConfigurationContext configurationContext)
                                      throws Exception
Loads the optional configuration.

Parameters:
application - AutoWireApplication.
objectsLocation - Location of the Objects ConfigurationItem.
teamsLocation - Location of the Teams ConfigurationItem.
configurationContext - ConfigurationContext.
Throws:
Exception - If fails to load the optional configuration.

configure

protected void configure(HttpServerAutoWireOfficeFloorSource application)
Allows overriding to provide additional configuration.

Parameters:
application - HttpServerAutoWireOfficeFloorSource.

addProperty

public void addProperty(String name,
                        String value)
Description copied from interface: PropertyConfigurable
Adds a Property to configure the item.

Specified by:
addProperty in interface PropertyConfigurable
Parameters:
name - Name of Property.
value - Value of Property.

setWebAppDirectory

public void setWebAppDirectory(File webappDirectory)
Description copied from interface: WoofContextConfigurable

Provides location of the webapp directory.

Note that this may not be called if the webapp directory is not available.

Specified by:
setWebAppDirectory in interface WoofContextConfigurable
Parameters:
webappDirectory - Location of the webapp directory.

addResources

public void addResources(ResourceSource resourceSource)
Description copied from interface: WoofContextConfigurable
Adds a ResourceSource.

Specified by:
addResources in interface WoofContextConfigurable
Parameters:
resourceSource - ResourceSource.

initOfficeFloor

protected void initOfficeFloor(OfficeFloorDeployer deployer,
                               OfficeFloorSourceContext context)
                        throws Exception
Description copied from class: AutoWireOfficeFloorSource
Allows overriding for initialising the OfficeFloor before auto-wiring.

Overrides:
initOfficeFloor in class HttpServerAutoWireOfficeFloorSource
Parameters:
deployer - OfficeFloorDeployer.
context - OfficeFloorSourceContext.
Throws:
Exception - If fails to initialise.


Copyright © 2005-2013. All Rights Reserved.