Class OfficeFloorBuilderImpl
java.lang.Object
net.officefloor.frame.impl.construct.officefloor.OfficeFloorBuilderImpl
- All Implemented Interfaces:
OfficeFloorBuilder,OfficeFloorConfiguration
public class OfficeFloorBuilderImpl
extends Object
implements OfficeFloorBuilder, OfficeFloorConfiguration
Implementation of
OfficeFloorBuilder.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<D extends Enum<D>,F extends Enum<F>, MS extends ManagedObjectSource<D, F>>
ManagedObjectBuilder<F>addManagedObject(String managedObjectSourceName, Class<MS> managedObjectSourceClass) Adds aManagedObjectSourceto thisOfficeFloorBuilder.<D extends Enum<D>,F extends Enum<F>>
ManagedObjectBuilder<F>addManagedObject(String managedObjectSourceName, ManagedObjectSource<D, F> managedObjectSource) Adds aManagedObjectSourceto thisOfficeFloorBuilder.Adds anOfficeon theOfficeFloor.voidaddOfficeFloorListener(OfficeFloorListener listener) Adds anOfficeFloorListener.voidaddOfficeVisitor(OfficeVisitor visitor) Adds anOfficeVisitor.voidaddProfile(String profile) Adds an active profile for theOfficeFloor.voidaddResources(ResourceSource resourceSource) Adds aResourceSourceto locate resources.<TS extends TeamSource>
TeamBuilder<TS><TS extends TeamSource>
TeamBuilder<TS>Builds theOfficeFloor.buildOfficeFloor(OfficeFloorIssues issues) Builds theOfficeFloor.Obtains theEscalationHandlerfor issues escalating out of theOfficeinstances.Obtains the configuration of theExecutivefor theOfficeFloor.Obtains the configuration of theManagedObjectSourceinstances.longObtains the maximum time in milliseconds to wait forOfficeFloorto start.Obtains the configuration of theOfficeinstances on theOfficeFloor.Obtains the name of theOfficeFloor.Obtains theOfficeVisitorinstances.String[]Obtains the profiles.getSourceContext(String sourceName, Supplier<ClockFactory> clockFactoryProvider) Obtains theSourceContext.TeamConfiguration<?>[]Obtains the configuration of theTeaminstances on theOfficeFloor.Obtains the decorator ofThreadinstances created by theTeamSourceContext.voidsetClassLoader(ClassLoader classLoader) Allows overriding theClassLoaderprovided to the sources by theSourceContext.voidsetClockFactory(ClockFactory clockFactory) voidsetEscalationHandler(EscalationHandler escalationHandler) Specifies theEscalationHandlerfor issues escalating out of theOfficeinstances.<XS extends ExecutiveSource>
ExecutiveBuilder<XS>setExecutive(Class<XS> executiveSourceClass) <XS extends ExecutiveSource>
ExecutiveBuilder<XS>setExecutive(XS executiveSource) voidsetMaxStartupWaitTime(long maxStartupWaitTime) Specifies the maximum time in milliseconds to wait forOfficeFloorto start.voidsetThreadDecorator(Consumer<Thread> decorator) Decorates all theThreadinstances created by theTeamSourceContext.
-
Constructor Details
-
OfficeFloorBuilderImpl
Initiate.- Parameters:
officeFloorName- Name of theOfficeFloor.
-
-
Method Details
-
addProfile
Description copied from interface:OfficeFloorBuilderAdds an active profile for theOfficeFloor.- Specified by:
addProfilein interfaceOfficeFloorBuilder- Parameters:
profile- Active profile for theOfficeFloor.
-
setClassLoader
Description copied from interface:OfficeFloorBuilderAllows overriding theClassLoaderprovided to the sources by theSourceContext.- Specified by:
setClassLoaderin interfaceOfficeFloorBuilder- Parameters:
classLoader-ClassLoader.
-
setClockFactory
Description copied from interface:OfficeFloorBuilder- Specified by:
setClockFactoryin interfaceOfficeFloorBuilder- Parameters:
clockFactory-ClockFactory.
-
setMaxStartupWaitTime
public void setMaxStartupWaitTime(long maxStartupWaitTime) Description copied from interface:OfficeFloorBuilderSpecifies the maximum time in milliseconds to wait forOfficeFloorto start.- Specified by:
setMaxStartupWaitTimein interfaceOfficeFloorBuilder- Parameters:
maxStartupWaitTime- Maximum time in milliseconds to wait forOfficeFloorto start.
-
setThreadDecorator
Description copied from interface:OfficeFloorBuilderDecorates all theThreadinstances created by theTeamSourceContext.- Specified by:
setThreadDecoratorin interfaceOfficeFloorBuilder- Parameters:
decorator- Decorates all theThreadinstances created by theTeamSourceContext.
-
addResources
Description copied from interface:OfficeFloorBuilderAdds aResourceSourceto locate resources.- Specified by:
addResourcesin interfaceOfficeFloorBuilder- Parameters:
resourceSource-ResourceSource.
-
addOfficeFloorListener
Description copied from interface:OfficeFloorBuilderAdds anOfficeFloorListener.- Specified by:
addOfficeFloorListenerin interfaceOfficeFloorBuilder- Parameters:
listener-OfficeFloorListener.
-
addManagedObject
public <D extends Enum<D>,F extends Enum<F>, ManagedObjectBuilder<F> addManagedObjectMS extends ManagedObjectSource<D, F>> (String managedObjectSourceName, Class<MS> managedObjectSourceClass) Description copied from interface:OfficeFloorBuilderAdds aManagedObjectSourceto thisOfficeFloorBuilder.- Specified by:
addManagedObjectin interfaceOfficeFloorBuilder- Type Parameters:
D- Dependency key type.F- Flow key type.MS-ManagedObjectSourcetype.- Parameters:
managedObjectSourceName- Name of theManagedObjectSource.managedObjectSourceClass- Class of theManagedObjectSource.- Returns:
ManagedObjectBuilder.
-
addManagedObject
public <D extends Enum<D>,F extends Enum<F>> ManagedObjectBuilder<F> addManagedObject(String managedObjectSourceName, ManagedObjectSource<D, F> managedObjectSource) Description copied from interface:OfficeFloorBuilderAdds aManagedObjectSourceto thisOfficeFloorBuilder.- Specified by:
addManagedObjectin interfaceOfficeFloorBuilder- Type Parameters:
D- Dependency key type.F- Flow key type.- Parameters:
managedObjectSourceName- Name of theManagedObjectSource.managedObjectSource-ManagedObjectSourceinstance to use.- Returns:
ManagedObjectBuilder.
-
addTeam
Description copied from interface:OfficeFloorBuilder- Specified by:
addTeamin interfaceOfficeFloorBuilder- Type Parameters:
TS-TeamSourcetype.- Parameters:
teamName- Name to register theTeamunder.teamSourceClass-TeamSourceClassto source theTeam.- Returns:
TeamBuilderto build theTeam.
-
addTeam
Description copied from interface:OfficeFloorBuilder- Specified by:
addTeamin interfaceOfficeFloorBuilder- Type Parameters:
TS-TeamSourcetype.- Parameters:
teamName- Name to register theTeamunder.teamSource-TeamSourceto source theTeam.- Returns:
TeamBuilderto build theTeam.
-
setExecutive
public <XS extends ExecutiveSource> ExecutiveBuilder<XS> setExecutive(Class<XS> executiveSourceClass) Description copied from interface:OfficeFloorBuilder- Specified by:
setExecutivein interfaceOfficeFloorBuilder- Type Parameters:
XS-ExecutiveSourcetype.- Parameters:
executiveSourceClass-ExecutiveSourceClassto source theExecutive.- Returns:
ExecutiveBuilderto build theExecutive.
-
setExecutive
Description copied from interface:OfficeFloorBuilder- Specified by:
setExecutivein interfaceOfficeFloorBuilder- Type Parameters:
XS-ExecutiveSourcetype.- Parameters:
executiveSource-ExecutiveSourceto source theExecutive.- Returns:
ExecutiveBuilderto build theExecutive.
-
addOffice
Description copied from interface:OfficeFloorBuilderAdds anOfficeon theOfficeFloor.- Specified by:
addOfficein interfaceOfficeFloorBuilder- Parameters:
officeName- Name of theOffice.- Returns:
OfficeBuilderto build theOffice.
-
addOfficeVisitor
Description copied from interface:OfficeFloorBuilderAdds anOfficeVisitor.- Specified by:
addOfficeVisitorin interfaceOfficeFloorBuilder- Parameters:
visitor-OfficeVisitor.
-
setEscalationHandler
Description copied from interface:OfficeFloorBuilderSpecifies theEscalationHandlerfor issues escalating out of theOfficeinstances.- Specified by:
setEscalationHandlerin interfaceOfficeFloorBuilder- Parameters:
escalationHandler-EscalationHandler.
-
buildOfficeFloor
Description copied from interface:OfficeFloorBuilderBuilds theOfficeFloor.- Specified by:
buildOfficeFloorin interfaceOfficeFloorBuilder- Returns:
- Built
OfficeFloor. - Throws:
OfficeFloorBuildException- If fails to build theOfficeFloor.- See Also:
-
buildOfficeFloor
Description copied from interface:OfficeFloorBuilderBuilds theOfficeFloor.- Specified by:
buildOfficeFloorin interfaceOfficeFloorBuilder- Parameters:
issues-OfficeFloorIssuesto listen for issues in constructing theOfficeFloor.- Returns:
- Built
OfficeFloorif successfully built, ornullif could not constructOfficeFloorwith reasons passed to theOfficeFloorIssues.
-
getOfficeFloorName
Description copied from interface:OfficeFloorConfigurationObtains the name of theOfficeFloor.- Specified by:
getOfficeFloorNamein interfaceOfficeFloorConfiguration- Returns:
OfficeFloor.
-
getMaxStartupWaitTime
public long getMaxStartupWaitTime()Description copied from interface:OfficeFloorConfigurationObtains the maximum time in milliseconds to wait forOfficeFloorto start.- Specified by:
getMaxStartupWaitTimein interfaceOfficeFloorConfiguration- Returns:
- Maximum time in milliseconds to wait for
OfficeFloorto start.
-
getProfiles
Description copied from interface:OfficeFloorConfigurationObtains the profiles.- Specified by:
getProfilesin interfaceOfficeFloorConfiguration- Returns:
- Profiles.
-
getThreadDecorator
Description copied from interface:OfficeFloorConfigurationObtains the decorator ofThreadinstances created by theTeamSourceContext.- Specified by:
getThreadDecoratorin interfaceOfficeFloorConfiguration- Returns:
- Decorator of
Threadinstances created by theTeamSourceContext. May benull.
-
getSourceContext
public SourceContext getSourceContext(String sourceName, Supplier<ClockFactory> clockFactoryProvider) Description copied from interface:OfficeFloorConfigurationObtains theSourceContext.- Specified by:
getSourceContextin interfaceOfficeFloorConfiguration- Parameters:
sourceName- Name of source.clockFactoryProvider- ProvidesClockFactoryif one not configured.- Returns:
SourceContext.
-
getManagedObjectSourceConfiguration
Description copied from interface:OfficeFloorConfigurationObtains the configuration of theManagedObjectSourceinstances.- Specified by:
getManagedObjectSourceConfigurationin interfaceOfficeFloorConfiguration- Returns:
ManagedObjectSourceconfiguration.
-
getTeamConfiguration
Description copied from interface:OfficeFloorConfigurationObtains the configuration of theTeaminstances on theOfficeFloor.- Specified by:
getTeamConfigurationin interfaceOfficeFloorConfiguration- Returns:
TeamConfigurationinstances.
-
getExecutiveConfiguration
Description copied from interface:OfficeFloorConfigurationObtains the configuration of theExecutivefor theOfficeFloor.- Specified by:
getExecutiveConfigurationin interfaceOfficeFloorConfiguration- Returns:
ExecutiveConfiguration.
-
getOfficeConfiguration
Description copied from interface:OfficeFloorConfigurationObtains the configuration of theOfficeinstances on theOfficeFloor.- Specified by:
getOfficeConfigurationin interfaceOfficeFloorConfiguration- Returns:
OfficeConfigurationinstances.
-
getOfficeVisitors
Description copied from interface:OfficeFloorConfigurationObtains theOfficeVisitorinstances.- Specified by:
getOfficeVisitorsin interfaceOfficeFloorConfiguration- Returns:
OfficeVisitorinstances.
-
getEscalationHandler
Description copied from interface:OfficeFloorConfigurationObtains theEscalationHandlerfor issues escalating out of theOfficeinstances.- Specified by:
getEscalationHandlerin interfaceOfficeFloorConfiguration- Returns:
EscalationHandlerfor issues escalating out of theOfficeinstances. May benull.
-