Class OfficeFloorCompilerAdapter
- All Implemented Interfaces:
Node,PropertyConfigurable
Adapts the implementing OfficeFloorCompiler to be used when the
OfficeFloorCompiler reference may be from a different
ClassLoader. Typically this occurs within the Eclipse plug-ins but is
useful if wanting to run a different versions of the
OfficeFloorCompiler in the same JVM.
This adapter reflectively calls on the implementation to achieve
compatibility. Also, as this is loaded in the same ClassLoader as the
OfficeFloorCompiler it will always be assignable.
- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested classes/interfaces inherited from class net.officefloor.compile.OfficeFloorCompiler
OfficeFloorCompiler.OfficeFloorCompilerFactory -
Field Summary
Fields inherited from class net.officefloor.compile.OfficeFloorCompiler
IMPLEMENTATION_CLASS_PROPERTY_NAME, TYPE -
Constructor Summary
ConstructorsConstructorDescriptionOfficeFloorCompilerAdapter(Object implementation, ClassLoader clientClassLoader, ClassLoader implClassLoader) Initiate. -
Method Summary
Modifier and TypeMethodDescription<E,F extends Enum<F>, G extends Enum<G>, S extends AdministrationSource<E, F, G>>
voidaddAdministrationSourceAlias(String alias, Class<S> administrationSourceClass) Allows providing an alias name for aAdministrationSource.voidaddAutoWireStateManagerVisitor(AutoWireStateManagerVisitor autoWireStateManagerVisitor) Adds anAutoWireStateManagerVisitor.voidConvenience method to add all thePropertyinstances fromSystem.getenv().<I,F extends Enum<F>, S extends GovernanceSource<I, F>>
voidaddGovernanceSourceAlias(String alias, Class<S> governanceSourceClass) Allows providing an alias name for aGovernanceSource.<S extends ManagedFunctionSource>
voidaddManagedFunctionSourceAlias(String alias, Class<S> managedFunctionSourceClass) Allows providing an alias name for aManagedFunctionSource.<S extends ManagedObjectPoolSource>
voidaddManagedObjectPoolSourceAlias(String alias, Class<S> managedObjectPoolSourceClass) Allows providing an alias name for aManagedObjectPoolSource.<D extends Enum<D>,F extends Enum<F>, S extends ManagedObjectSource<D, F>>
voidaddManagedObjectSourceAlias(String alias, Class<S> managedObjectSourceClass) Allows providing an alias name for aManagedObjectSource.voidaddOfficeFloorListener(OfficeFloorListener officeFloorListener) Adds anOfficeFloorListener.<S extends OfficeSource>
voidaddOfficeSourceAlias(String alias, Class<S> officeSourceClass) Allows providing an alias name for anOfficeSource.voidaddProfile(String profile) Adds a profile.voidaddProfiler(String officeName, Profiler profiler) voidaddProperty(String name, String value) Adds aPropertyto configure the item.voidaddResources(ResourceSource resourceSource) Adds aResourceSource.<S extends SectionSource>
voidaddSectionSourceAlias(String alias, Class<S> sectionSourceClass) Allows providing an alias name for aSectionSource.voidAdds the aliases for the source classes.<S extends SupplierSource>
voidaddSupplierSourceAlias(String alias, Class<S> supplierSourceClass) Allows providing an alias name for aSupplierSource.voidConvenience method to add all thePropertyinstances fromSystem.getProperties().<S extends TeamSource>
voidaddTeamSourceAlias(String alias, Class<S> teamSourceClass) Allows providing an alias name for aTeamSource.Compiles and builds theOfficeFloor.booleanRuns theOfficeFloorCompilerConfigurerinstances to configure thisOfficeFloorCompiler.Creates a new emptyPropertyList.Creates a rootSourceContext.Obtains theAdministrationLoader.Obtains theCompilerIssues.Obtains theExecutiveLoader.Obtains theGovernanceLoader.Obtains theManagedFunctionLoader.Obtains theManagedObjectLoader.Obtains theManagedObjectPoolLoader.Obtains theOfficeFloorLoader.Obtains theOfficeLoader.Obtains theSectionLoader.Obtains theSupplierLoader.Obtains theTeamLoader.Obtains theTypeLoader.<T> Trun(Class<? extends OfficeFloorCompilerRunnable<T>> runnableClass, Object... parameters) Executes theOfficeFloorCompilerRunnableby instantiating it with the sameClassLoaderbeing used by thisOfficeFloorCompiler.voidsetClockFactory(ClockFactory clockFactory) Specifies theClockFactory.voidsetCompilerIssues(CompilerIssues issues) Overrides the defaultCompilerIssuesto use in compiling theOfficeFloor.voidsetEscalationHandler(EscalationHandler escalationHandler) Overrides the defaultEscalationHandler.voidsetMBeanRegistrator(MBeanRegistrator mbeanRegistrator) Specifies theMBeanRegistrator.voidsetOfficeFloorLocation(String officeFloorLocation) Specifies the location of theOfficeFloor.voidsetOfficeFloorSource(OfficeFloorSource officeFloorSource) Specifies theOfficeFloorSourceinstance to use for compiling theOfficeFloor.<S extends OfficeFloorSource>
voidsetOfficeFloorSourceClass(Class<S> officeFloorSourceClass) Overrides the defaultOfficeFloorSourceto source theOfficeFloor.voidsetOfficeFrame(OfficeFrame officeFrame) Overrides the defaultOfficeFramefor building theOfficeFloor.voidsetOverridePropertiesDirectory(File propertiesDirectory) Specifies a directory containing override properties.Methods inherited from class net.officefloor.compile.OfficeFloorCompiler
getChildNodes, getClassLoader, getLocation, getNodeName, getNodeType, getParentNode, getQualifiedName, isInitialised, newOfficeFloorCompiler, newPropertyList, setClassLoader, setFactoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.officefloor.compile.internal.structure.Node
getQualifiedName
-
Constructor Details
-
OfficeFloorCompilerAdapter
public OfficeFloorCompilerAdapter(Object implementation, ClassLoader clientClassLoader, ClassLoader implClassLoader) Initiate.- Parameters:
implementation-OfficeFloorCompilerimplementation.clientClassLoader-ClassLoaderof the client.implClassLoader-ClassLoaderof the implementation.
-
-
Method Details
-
addSourceAliases
public void addSourceAliases()Description copied from class:OfficeFloorCompilerAdds the aliases for the source classes.- Overrides:
addSourceAliasesin classOfficeFloorCompiler
-
addSystemProperties
public void addSystemProperties()Description copied from class:OfficeFloorCompilerConvenience method to add all the
Propertyinstances fromSystem.getProperties().PropertyConfigurable.addProperty(String, String)will be invoked for eachProperty.- Overrides:
addSystemPropertiesin classOfficeFloorCompiler
-
addEnvProperties
public void addEnvProperties()Description copied from class:OfficeFloorCompilerConvenience method to add all the
Propertyinstances fromSystem.getenv().PropertyConfigurable.addProperty(String, String)will be invoked for eachProperty.- Overrides:
addEnvPropertiesin classOfficeFloorCompiler
-
run
public <T> T run(Class<? extends OfficeFloorCompilerRunnable<T>> runnableClass, Object... parameters) throws Exception Description copied from class:OfficeFloorCompilerExecutes the
OfficeFloorCompilerRunnableby instantiating it with the sameClassLoaderbeing used by thisOfficeFloorCompiler.This is typically used by graphical editors that need to use the project class path rather than the editor's class path.
- Overrides:
runin classOfficeFloorCompiler- Type Parameters:
T- Return type.- Parameters:
runnableClass-OfficeFloorCompilerRunnableclass.parameters- Parameters to enable configuration of theOfficeFloorCompilerRunnable. AsProxyinstances are used to bridgeClasscompatibility issues due to differentClassLoader, all parameters should only be access via their implementing interfaces.- Returns:
- Value returned from the
OfficeFloorCompilerRunnable. - Throws:
Exception- If fails to run theOfficeFloorCompilerRunnable.
-
setClockFactory
Description copied from class:OfficeFloorCompilerSpecifies the
ClockFactory.This will be added to the
OfficeFramebefore compiling theOfficeFloorand will be available in theSourceContextfor retrievingClockinstances.- Specified by:
setClockFactoryin classOfficeFloorCompiler- Parameters:
clockFactory-ClockFactory.
-
addResources
Description copied from class:OfficeFloorCompilerAdds a
ResourceSource.This will be added to the
OfficeFramebefore compiling theOfficeFloorand will be available in theSourceContextfor loading the various sources.- Specified by:
addResourcesin classOfficeFloorCompiler- Parameters:
resourceSource-ResourceSource.
-
setEscalationHandler
Description copied from class:OfficeFloorCompilerOverrides the default
EscalationHandler.This will be specified on the
OfficeFramebefore compiling theOfficeFloor.- Specified by:
setEscalationHandlerin classOfficeFloorCompiler- Parameters:
escalationHandler-EscalationHandler.
-
setMBeanRegistrator
Description copied from class:OfficeFloorCompilerSpecifies theMBeanRegistrator.- Specified by:
setMBeanRegistratorin classOfficeFloorCompiler- Parameters:
mbeanRegistrator-MBeanRegistrator.
-
setCompilerIssues
Description copied from class:OfficeFloorCompilerOverrides the default
CompilerIssuesto use in compiling theOfficeFloor.Implementations of
OfficeFloorCompilermust provide a defaultCompilerIssues. Typically this will be an implementation that writes issues toSystem.err.- Specified by:
setCompilerIssuesin classOfficeFloorCompiler- Parameters:
issues-CompilerIssues.
-
setOfficeFrame
Description copied from class:OfficeFloorCompilerOverrides the default
OfficeFramefor building theOfficeFloor.Should this not be called the
OfficeFloorCompilerimplementation should use theOfficeFrame.getInstance()to build theOfficeFloor.- Specified by:
setOfficeFramein classOfficeFloorCompiler- Parameters:
officeFrame-OfficeFrame.
-
setOfficeFloorSourceClass
public <S extends OfficeFloorSource> void setOfficeFloorSourceClass(Class<S> officeFloorSourceClass) Description copied from class:OfficeFloorCompilerOverrides the default
OfficeFloorSourceto source theOfficeFloor.OfficeFloorCompilerimplementations must provide a defaultOfficeFloorSourceimplementation. The choice ofOfficeFloorSourceimplementation is left to theOfficeFloorCompiler, however it should be clearly documented on theOfficeFloorCompilerimplementation whichOfficeFloorSourceimplementation is being used.- Specified by:
setOfficeFloorSourceClassin classOfficeFloorCompiler- Type Parameters:
S-OfficeFloorSourcetype.- Parameters:
officeFloorSourceClass-OfficeFloorSourceClass.
-
setOfficeFloorSource
Description copied from class:OfficeFloorCompilerSpecifies the
OfficeFloorSourceinstance to use for compiling theOfficeFloor.This will take precedence over specifying the
OfficeFloorSourceclass.- Specified by:
setOfficeFloorSourcein classOfficeFloorCompiler- Parameters:
officeFloorSource-OfficeFloorSource.
-
setOfficeFloorLocation
Description copied from class:OfficeFloorCompilerSpecifies the location of theOfficeFloor.- Specified by:
setOfficeFloorLocationin classOfficeFloorCompiler- Parameters:
officeFloorLocation- Location of theOfficeFloor.
-
addProfile
Description copied from class:OfficeFloorCompilerAdds a profile.- Specified by:
addProfilein classOfficeFloorCompiler- Parameters:
profile- Profile.
-
addProperty
Description copied from interface:PropertyConfigurableAdds aPropertyto configure the item. -
addOfficeSourceAlias
Description copied from class:OfficeFloorCompilerAllows providing an alias name for an
OfficeSource.This stops the configuration files from being littered with fully qualified class names of the
OfficeSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
OfficeSourceServiceis the preferred means to provideOfficeSourcealiases.- Specified by:
addOfficeSourceAliasin classOfficeFloorCompiler- Type Parameters:
S-OfficeSourcetype.- Parameters:
alias- Alias name for theOfficeSource.officeSourceClass-OfficeSourceClassfor the alias.
-
addSectionSourceAlias
public <S extends SectionSource> void addSectionSourceAlias(String alias, Class<S> sectionSourceClass) Description copied from class:OfficeFloorCompilerAllows providing an alias name for a
SectionSource.This stops the configuration files from being littered with fully qualified class names of the
SectionSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
SectionSourceServiceis the preferred means to provideSectionSourcealiases.- Specified by:
addSectionSourceAliasin classOfficeFloorCompiler- Type Parameters:
S-SectionSourcetype.- Parameters:
alias- Alias name for theSectionSource.sectionSourceClass-SectionSourceClassfor the alias.
-
addManagedFunctionSourceAlias
public <S extends ManagedFunctionSource> void addManagedFunctionSourceAlias(String alias, Class<S> managedFunctionSourceClass) Description copied from class:OfficeFloorCompilerAllows providing an alias name for a
ManagedFunctionSource.This stops the configuration files from being littered with fully qualified class names of the
ManagedFunctionSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
ManagedFunctionSourceServiceis the preferred means to provideManagedFunctionSourcealiases.- Specified by:
addManagedFunctionSourceAliasin classOfficeFloorCompiler- Type Parameters:
S-ManagedFunctionSourcetype.- Parameters:
alias- Alias name for theManagedFunctionSource.managedFunctionSourceClass-ManagedFunctionSourceClassfor the alias.
-
addManagedObjectSourceAlias
public <D extends Enum<D>,F extends Enum<F>, void addManagedObjectSourceAliasS extends ManagedObjectSource<D, F>> (String alias, Class<S> managedObjectSourceClass) Description copied from class:OfficeFloorCompilerAllows providing an alias name for a
ManagedObjectSource.This stops the configuration files from being littered with fully qualified class names of the
ManagedObjectSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
ManagedObjectSourceServiceis the preferred means to provideManagedObjectSourcealiases.- Specified by:
addManagedObjectSourceAliasin classOfficeFloorCompiler- Type Parameters:
D- Dependency type keys.F-Flowtype keys.S-ManagedObjectSourcetype.- Parameters:
alias- Alias name for theManagedObjectSource.managedObjectSourceClass-ManagedObjectSourceClassfor the alias.
-
addManagedObjectPoolSourceAlias
public <S extends ManagedObjectPoolSource> void addManagedObjectPoolSourceAlias(String alias, Class<S> managedObjectPoolSourceClass) Description copied from class:OfficeFloorCompilerAllows providing an alias name for a
ManagedObjectPoolSource.This stops the configuration files from being littered with fully qualified class names of the
ManagedObjectPoolSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
ManagedObjectSourceServiceis the preferred means to provideManagedObjectSourcealiases.- Specified by:
addManagedObjectPoolSourceAliasin classOfficeFloorCompiler- Type Parameters:
S-ManagedObjectPoolSourcetype.- Parameters:
alias- Alias name for theManagedObjectPoolSource.managedObjectPoolSourceClass-ManagedObjectPoolSourceClassfor the alias.
-
addSupplierSourceAlias
public <S extends SupplierSource> void addSupplierSourceAlias(String alias, Class<S> supplierSourceClass) Description copied from class:OfficeFloorCompilerAllows providing an alias name for a
SupplierSource.This stops the configuration files from being littered with fully qualified class names of the
SupplierSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
SupplierSourceServiceis the preferred means to provideSupplierSourcealiases.- Specified by:
addSupplierSourceAliasin classOfficeFloorCompiler- Type Parameters:
S-SupplierSourcetype.- Parameters:
alias- Alias name for theSupplierSource.supplierSourceClass-SupplierSourceClassfor the alias.
-
addAdministrationSourceAlias
public <E,F extends Enum<F>, void addAdministrationSourceAliasG extends Enum<G>, S extends AdministrationSource<E, F, G>> (String alias, Class<S> administrationSourceClass) Description copied from class:OfficeFloorCompilerAllows providing an alias name for a
AdministrationSource.This stops the configuration files from being littered with fully qualified class names of the
AdministrationSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
AdministrationSourceServiceis the preferred means to provideAdministrationSourcealiases.- Specified by:
addAdministrationSourceAliasin classOfficeFloorCompiler- Type Parameters:
E- Extension interface type.F-Flowkeys for theAdministration.G-Governancekeys for theAdministration.S-AdministrationSourcetype.- Parameters:
alias- Alias name for theAdministrationSource.administrationSourceClass-AdministrationSourceClassfor the alias.
-
addGovernanceSourceAlias
public <I,F extends Enum<F>, void addGovernanceSourceAliasS extends GovernanceSource<I, F>> (String alias, Class<S> governanceSourceClass) Description copied from class:OfficeFloorCompilerAllows providing an alias name for a
GovernanceSource.This stops the configuration files from being littered with fully qualified class names of the
GovernanceSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
GovernanceSourceServiceis the preferred means to provideGovernanceSourcealiases.- Specified by:
addGovernanceSourceAliasin classOfficeFloorCompiler- Type Parameters:
I- Extension interface type.F-Flowtype keys.S-GovernanceSourcetype.- Parameters:
alias- Alias name for theGovernanceSource.governanceSourceClass-GovernanceSourceClassfor the alias.
-
addTeamSourceAlias
Description copied from class:OfficeFloorCompilerAllows providing an alias name for a
TeamSource.This stops the configuration files from being littered with fully qualified class names of the
TeamSourceclasses. This is anticipated to allow flexibility as the functionality evolves so that relocating/renaming classes does not require significant configuration changes.Typically this should not be used directly as the
TeamSourceServiceis the preferred means to provideTeamSourcealiases.- Specified by:
addTeamSourceAliasin classOfficeFloorCompiler- Type Parameters:
S-TeamSourcetype.- Parameters:
alias- Alias name for theTeamSource.teamSourceClass-TeamSourceClassfor the alias.
-
addProfiler
Description copied from class:OfficeFloorCompiler- Specified by:
addProfilerin classOfficeFloorCompiler- Parameters:
officeName- Name ofOfficeto be profiled.profiler-Profilerfor theOffice.
-
setOverridePropertiesDirectory
Description copied from class:OfficeFloorCompilerSpecifies a directory containing override properties.
The files within the directory are properties files with the naming convention: <fully-qualified-name>.properties
- Specified by:
setOverridePropertiesDirectoryin classOfficeFloorCompiler- Parameters:
propertiesDirectory- Directory containing the override properties.
-
addOfficeFloorListener
Description copied from class:OfficeFloorCompilerAdds anOfficeFloorListener.- Specified by:
addOfficeFloorListenerin classOfficeFloorCompiler- Parameters:
officeFloorListener-OfficeFloorListener.
-
addAutoWireStateManagerVisitor
Description copied from class:OfficeFloorCompilerAdds anAutoWireStateManagerVisitor.- Specified by:
addAutoWireStateManagerVisitorin classOfficeFloorCompiler- Parameters:
autoWireStateManagerVisitor-AutoWireStateManagerVisitor.
-
createPropertyList
Description copied from class:OfficeFloorCompilerCreates a new emptyPropertyList.- Specified by:
createPropertyListin classOfficeFloorCompiler- Returns:
- New empty
PropertyList.
-
createRootSourceContext
Description copied from class:OfficeFloorCompilerCreates a rootSourceContext.- Specified by:
createRootSourceContextin classOfficeFloorCompiler- Returns:
- Root
SourceContext.
-
getCompilerIssues
Description copied from class:OfficeFloorCompilerObtains theCompilerIssues.- Specified by:
getCompilerIssuesin classOfficeFloorCompiler- Returns:
CompilerIssues.
-
getTypeLoader
Description copied from class:OfficeFloorCompilerObtains theTypeLoader.- Specified by:
getTypeLoaderin classOfficeFloorCompiler- Returns:
TypeLoader.
-
getOfficeFloorLoader
Description copied from class:OfficeFloorCompilerObtains theOfficeFloorLoader.- Specified by:
getOfficeFloorLoaderin classOfficeFloorCompiler- Returns:
OfficeFloorLoader.
-
getOfficeLoader
Description copied from class:OfficeFloorCompilerObtains theOfficeLoader.- Specified by:
getOfficeLoaderin classOfficeFloorCompiler- Returns:
OfficeLoader.
-
getSectionLoader
Description copied from class:OfficeFloorCompilerObtains theSectionLoader.- Specified by:
getSectionLoaderin classOfficeFloorCompiler- Returns:
SectionLoader.
-
getManagedFunctionLoader
Description copied from class:OfficeFloorCompilerObtains theManagedFunctionLoader.- Specified by:
getManagedFunctionLoaderin classOfficeFloorCompiler- Returns:
ManagedFunctionLoader.
-
getManagedObjectLoader
Description copied from class:OfficeFloorCompilerObtains theManagedObjectLoader.- Specified by:
getManagedObjectLoaderin classOfficeFloorCompiler- Returns:
ManagedObjectLoader.
-
getSupplierLoader
Description copied from class:OfficeFloorCompilerObtains theSupplierLoader.- Specified by:
getSupplierLoaderin classOfficeFloorCompiler- Returns:
SupplierLoader.
-
getGovernanceLoader
Description copied from class:OfficeFloorCompilerObtains theGovernanceLoader.- Specified by:
getGovernanceLoaderin classOfficeFloorCompiler- Returns:
GovernanceLoader.
-
getManagedObjectPoolLoader
Description copied from class:OfficeFloorCompilerObtains theManagedObjectPoolLoader.- Specified by:
getManagedObjectPoolLoaderin classOfficeFloorCompiler- Returns:
ManagedObjectPoolLoader.
-
getAdministrationLoader
Description copied from class:OfficeFloorCompilerObtains theAdministrationLoader.- Specified by:
getAdministrationLoaderin classOfficeFloorCompiler- Returns:
AdministrationLoader.
-
getTeamLoader
Description copied from class:OfficeFloorCompilerObtains theTeamLoader.- Specified by:
getTeamLoaderin classOfficeFloorCompiler- Returns:
TeamLoader.
-
getExecutiveLoader
Description copied from class:OfficeFloorCompilerObtains theExecutiveLoader.- Specified by:
getExecutiveLoaderin classOfficeFloorCompiler- Returns:
ExecutiveLoader.
-
configureOfficeFloorCompiler
public boolean configureOfficeFloorCompiler()Description copied from class:OfficeFloorCompilerRuns the
OfficeFloorCompilerConfigurerinstances to configure thisOfficeFloorCompiler.This is always run before a compile. However, may not be run for loaders. This allows running if just loading types.
- Specified by:
configureOfficeFloorCompilerin classOfficeFloorCompiler- Returns:
trueif configured.falsewith issue reported to theCompilerIssues.
-
compile
Description copied from class:OfficeFloorCompilerCompiles and builds theOfficeFloor.- Specified by:
compilein classOfficeFloorCompiler- Parameters:
officeFloorName- Name of theOfficeFloor.- Returns:
OfficeFloorornullif issues in compiling which are reported to theCompilerIssues.
-