Class CompileOfficeFloor
- java.lang.Object
-
- net.officefloor.compile.spi.officefloor.source.impl.AbstractOfficeFloorSource
-
- net.officefloor.compile.test.officefloor.CompileOfficeFloor
-
- All Implemented Interfaces:
OfficeFloorSource
- Direct Known Subclasses:
WebCompileOfficeFloor
public class CompileOfficeFloor extends AbstractOfficeFloorSource
Provides easier compiling ofOfficeFloor
for testing.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.compile.spi.officefloor.source.impl.AbstractOfficeFloorSource
AbstractOfficeFloorSource.SpecificationContext
-
-
Constructor Summary
Constructors Constructor Description CompileOfficeFloor()
Instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OfficeFloor
compileAndOpenOfficeFloor()
Compiles and opens theOffice
.OfficeFloor
compileOfficeFloor()
Compiles theOfficeFloor
.OfficeFloorCompiler
getOfficeFloorCompiler()
Obtains theOfficeFloorCompiler
.static void
invokeProcess(OfficeFloor officeFloor, java.lang.String functionName, java.lang.Object parameter)
static void
invokeProcess(OfficeFloor officeFloor, java.lang.String functionName, java.lang.Object parameter, long waitTime)
static void
invokeProcess(OfficeFloor officeFloor, java.lang.String officeName, java.lang.String functionName, java.lang.Object parameter, long waitTime)
Convenience method to invoke theProcessState
for theManagedFunction
.OfficeFloorType
loadOfficeFloorType()
Loads theOfficeFloorType
.protected void
loadSpecification(AbstractOfficeFloorSource.SpecificationContext context)
Loads theOfficeFloorSourceSpecification
.void
office(CompileOfficeExtension extension)
Adds aCompileOfficeExtension
.void
officeFloor(CompileOfficeFloorExtension extension)
Adds aCompileOfficeFloorExtension
.void
section(CompileSectionExtension extension)
Adds aCompileSectionExtension
.void
sourceOfficeFloor(OfficeFloorDeployer deployer, OfficeFloorSourceContext context)
Sources theOfficeFloor
by deploying it via the inputOfficeFloorDeployer
.void
specifyConfigurationProperties(RequiredProperties requiredProperties, OfficeFloorSourceContext context)
Obtains from theOfficeFloorSource
any additionalProperty
instances required to source theOfficeFloor
after interrogating the configuration.-
Methods inherited from class net.officefloor.compile.spi.officefloor.source.impl.AbstractOfficeFloorSource
getSpecification
-
-
-
-
Method Detail
-
invokeProcess
public static void invokeProcess(OfficeFloor officeFloor, java.lang.String functionName, java.lang.Object parameter) throws java.lang.Throwable
- Parameters:
officeFloor
-OfficeFloor
.functionName
- Name of theManagedFunction
.parameter
- Parameter to theManagedFunction
.- Throws:
java.lang.Throwable
- If fails to invoke theProcessState
.
-
invokeProcess
public static void invokeProcess(OfficeFloor officeFloor, java.lang.String functionName, java.lang.Object parameter, long waitTime) throws java.lang.Throwable
- Parameters:
officeFloor
-OfficeFloor
.functionName
- Name of theManagedFunction
.parameter
- Parameter to theManagedFunction
.waitTime
- Time in milliseconds to wait forProcessState
to complete.- Throws:
java.lang.Throwable
- If fails to invoke theProcessState
.
-
invokeProcess
public static void invokeProcess(OfficeFloor officeFloor, java.lang.String officeName, java.lang.String functionName, java.lang.Object parameter, long waitTime) throws java.lang.Throwable
Convenience method to invoke theProcessState
for theManagedFunction
.- Parameters:
officeFloor
-OfficeFloor
.officeName
- Name of theOffice
containing theManagedFunction
.functionName
- Name of theManagedFunction
.parameter
- Parameter to theManagedFunction
.waitTime
- Time in milliseconds to wait forProcessState
to complete.- Throws:
java.lang.Throwable
- If fails to invoke theProcessState
.
-
getOfficeFloorCompiler
public OfficeFloorCompiler getOfficeFloorCompiler()
Obtains the
OfficeFloorCompiler
.Note the
OfficeFloorSource
is overridden on compiling to ensure the extensions are available.- Returns:
OfficeFloorCompiler
.
-
officeFloor
public void officeFloor(CompileOfficeFloorExtension extension)
Adds aCompileOfficeFloorExtension
.- Parameters:
extension
-CompileOfficeFloorExtension
.
-
office
public void office(CompileOfficeExtension extension)
Adds aCompileOfficeExtension
.- Parameters:
extension
-CompileOfficeExtension
.
-
section
public void section(CompileSectionExtension extension)
Adds aCompileSectionExtension
.- Parameters:
extension
-CompileSectionExtension
.
-
compileOfficeFloor
public OfficeFloor compileOfficeFloor() throws java.lang.Exception
Compiles theOfficeFloor
.- Returns:
OfficeFloor
.- Throws:
java.lang.Exception
- If fails to compile theOfficeFloor
.
-
compileAndOpenOfficeFloor
public OfficeFloor compileAndOpenOfficeFloor() throws java.lang.Exception
Compiles and opens theOffice
.- Returns:
OfficeFloor
.- Throws:
java.lang.Exception
- If fails to compile and open theOfficeFloor
.
-
loadOfficeFloorType
public OfficeFloorType loadOfficeFloorType()
Loads theOfficeFloorType
.- Returns:
OfficeFloorType
.
-
loadSpecification
protected void loadSpecification(AbstractOfficeFloorSource.SpecificationContext context)
Description copied from class:AbstractOfficeFloorSource
Loads theOfficeFloorSourceSpecification
.- Specified by:
loadSpecification
in classAbstractOfficeFloorSource
- Parameters:
context
-AbstractOfficeFloorSource.SpecificationContext
.
-
specifyConfigurationProperties
public void specifyConfigurationProperties(RequiredProperties requiredProperties, OfficeFloorSourceContext context) throws java.lang.Exception
Description copied from interface:OfficeFloorSource
Obtains from the
OfficeFloorSource
any additionalProperty
instances required to source theOfficeFloor
after interrogating the configuration.This method is a separate initial step from the
OfficeFloorSource.sourceOfficeFloor(OfficeFloorDeployer, OfficeFloorSourceContext)
method to enable specifying any requiredProperty
instances once the necessaryConfigurationItem
instances have been interrogated.Typically this allows environment specific properties to be defined externally so that deployment configuration need not be repeated per environment. In other words, one set of deployment configuration with properties providing the differences between the environments.
This also enables sensitive properties, such as
passwords
, to not be contained in deployment configuration but within a "secure" location.- Parameters:
requiredProperties
- Populated by theOfficeFloorSource
with any additionalProperty
instances required to source theOfficeFloor
.context
-OfficeFloorSourceContext
populated withProperty
instances as per theOfficeFloorSourceSpecification
.- Throws:
java.lang.Exception
- If fails to initialise theOfficeFloorSource
.
-
sourceOfficeFloor
public void sourceOfficeFloor(OfficeFloorDeployer deployer, OfficeFloorSourceContext context) throws java.lang.Exception
Description copied from interface:OfficeFloorSource
Sources theOfficeFloor
by deploying it via the inputOfficeFloorDeployer
.- Parameters:
deployer
-OfficeFloorDeployer
to deploy theOfficeFloor
.context
-OfficeFloorSourceContext
populated with theProperty
instances as per theOfficeFloorSourceSpecification
andRequiredProperties
. Should there be a name clash between the two, theRequiredProperties
Property
will be used.- Throws:
java.lang.Exception
- If fails to source theOfficeFloor
.
-
-