Package net.officefloor.frame.api.build
Interface OfficeFloorBuilder
-
- All Known Implementing Classes:
OfficeFloorBuilderImpl
public interface OfficeFloorBuilder
Builder of anOfficeFloor
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>>
ManagedObjectBuilder<F>addManagedObject(java.lang.String managedObjectSourceName, java.lang.Class<MS> managedObjectSourceClass)
Adds aManagedObjectSource
to thisOfficeFloorBuilder
.<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
ManagedObjectBuilder<F>addManagedObject(java.lang.String managedObjectSourceName, ManagedObjectSource<O,F> managedObjectSource)
Adds aManagedObjectSource
to thisOfficeFloorBuilder
.OfficeBuilder
addOffice(java.lang.String officeName)
Adds anOffice
on theOfficeFloor
.void
addOfficeFloorListener(OfficeFloorListener listener)
Adds anOfficeFloorListener
.void
addOfficeVisitor(OfficeVisitor visitor)
Adds anOfficeVisitor
.void
addProfile(java.lang.String profile)
Adds an active profile for theOfficeFloor
.void
addResources(ResourceSource resourceSource)
Adds aResourceSource
to locate resources.<TS extends TeamSource>
TeamBuilder<TS>addTeam(java.lang.String teamName, java.lang.Class<TS> teamSourceClass)
<TS extends TeamSource>
TeamBuilder<TS>addTeam(java.lang.String teamName, TS teamSource)
OfficeFloor
buildOfficeFloor()
Builds theOfficeFloor
.OfficeFloor
buildOfficeFloor(OfficeFloorIssues issuesListener)
Builds theOfficeFloor
.void
setClassLoader(java.lang.ClassLoader classLoader)
Allows overriding theClassLoader
provided to the sources by theSourceContext
.void
setClockFactory(ClockFactory clockFactory)
void
setEscalationHandler(EscalationHandler escalationHandler)
Specifies theEscalationHandler
for issues escalating out of theOffice
instances.<XS extends ExecutiveSource>
ExecutiveBuilder<XS>setExecutive(java.lang.Class<XS> executiveSourceClass)
<XS extends ExecutiveSource>
ExecutiveBuilder<XS>setExecutive(XS executiveSource)
void
setMaxStartupWaitTime(long maxStartupWaitTime)
Specifies the maximum time in milliseconds to wait forOfficeFloor
to start.void
setThreadDecorator(java.util.function.Consumer<java.lang.Thread> decorator)
Decorates all theThread
instances created by theTeamSourceContext
.
-
-
-
Method Detail
-
addProfile
void addProfile(java.lang.String profile)
Adds an active profile for theOfficeFloor
.- Parameters:
profile
- Active profile for theOfficeFloor
.
-
setClassLoader
void setClassLoader(java.lang.ClassLoader classLoader)
Allows overriding theClassLoader
provided to the sources by theSourceContext
.- Parameters:
classLoader
-ClassLoader
.
-
setClockFactory
void setClockFactory(ClockFactory clockFactory)
- Parameters:
clockFactory
-ClockFactory
.
-
setMaxStartupWaitTime
void setMaxStartupWaitTime(long maxStartupWaitTime)
Specifies the maximum time in milliseconds to wait forOfficeFloor
to start.- Parameters:
maxStartupWaitTime
- Maximum time in milliseconds to wait forOfficeFloor
to start.
-
setThreadDecorator
void setThreadDecorator(java.util.function.Consumer<java.lang.Thread> decorator)
Decorates all theThread
instances created by theTeamSourceContext
.- Parameters:
decorator
- Decorates all theThread
instances created by theTeamSourceContext
.
-
addResources
void addResources(ResourceSource resourceSource)
Adds aResourceSource
to locate resources.- Parameters:
resourceSource
-ResourceSource
.
-
addOfficeVisitor
void addOfficeVisitor(OfficeVisitor visitor)
Adds anOfficeVisitor
.- Parameters:
visitor
-OfficeVisitor
.
-
addOfficeFloorListener
void addOfficeFloorListener(OfficeFloorListener listener)
Adds anOfficeFloorListener
.- Parameters:
listener
-OfficeFloorListener
.
-
addManagedObject
<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>> ManagedObjectBuilder<F> addManagedObject(java.lang.String managedObjectSourceName, java.lang.Class<MS> managedObjectSourceClass)
Adds aManagedObjectSource
to thisOfficeFloorBuilder
.- Type Parameters:
O
- Dependency key type.F
- Flow key type.MS
-ManagedObjectSource
type.- Parameters:
managedObjectSourceName
- Name of theManagedObjectSource
.managedObjectSourceClass
- Class of theManagedObjectSource
.- Returns:
ManagedObjectBuilder
.
-
addManagedObject
<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> ManagedObjectBuilder<F> addManagedObject(java.lang.String managedObjectSourceName, ManagedObjectSource<O,F> managedObjectSource)
Adds aManagedObjectSource
to thisOfficeFloorBuilder
.- Type Parameters:
O
- Dependency key type.F
- Flow key type.- Parameters:
managedObjectSourceName
- Name of theManagedObjectSource
.managedObjectSource
-ManagedObjectSource
instance to use.- Returns:
ManagedObjectBuilder
.
-
addTeam
<TS extends TeamSource> TeamBuilder<TS> addTeam(java.lang.String teamName, java.lang.Class<TS> teamSourceClass)
- Type Parameters:
TS
-TeamSource
type.- Parameters:
teamName
- Name to register theTeam
under.teamSourceClass
-TeamSource
Class
to source theTeam
.- Returns:
TeamBuilder
to build theTeam
.
-
addTeam
<TS extends TeamSource> TeamBuilder<TS> addTeam(java.lang.String teamName, TS teamSource)
- Type Parameters:
TS
-TeamSource
type.- Parameters:
teamName
- Name to register theTeam
under.teamSource
-TeamSource
to source theTeam
.- Returns:
TeamBuilder
to build theTeam
.
-
setExecutive
<XS extends ExecutiveSource> ExecutiveBuilder<XS> setExecutive(java.lang.Class<XS> executiveSourceClass)
- Type Parameters:
XS
-ExecutiveSource
type.- Parameters:
executiveSourceClass
-ExecutiveSource
Class
to source theExecutive
.- Returns:
ExecutiveBuilder
to build theExecutive
.
-
setExecutive
<XS extends ExecutiveSource> ExecutiveBuilder<XS> setExecutive(XS executiveSource)
- Type Parameters:
XS
-ExecutiveSource
type.- Parameters:
executiveSource
-ExecutiveSource
to source theExecutive
.- Returns:
ExecutiveBuilder
to build theExecutive
.
-
addOffice
OfficeBuilder addOffice(java.lang.String officeName)
Adds anOffice
on theOfficeFloor
.- Parameters:
officeName
- Name of theOffice
.- Returns:
OfficeBuilder
to build theOffice
.
-
setEscalationHandler
void setEscalationHandler(EscalationHandler escalationHandler)
Specifies theEscalationHandler
for issues escalating out of theOffice
instances.- Parameters:
escalationHandler
-EscalationHandler
.
-
buildOfficeFloor
OfficeFloor buildOfficeFloor(OfficeFloorIssues issuesListener)
Builds theOfficeFloor
.- Parameters:
issuesListener
-OfficeFloorIssues
to listen for issues in constructing theOfficeFloor
.- Returns:
- Built
OfficeFloor
if successfully built, ornull
if could not constructOfficeFloor
with reasons passed to theOfficeFloorIssues
.
-
buildOfficeFloor
OfficeFloor buildOfficeFloor() throws OfficeFloorBuildException
Builds theOfficeFloor
.- Returns:
- Built
OfficeFloor
. - Throws:
OfficeFloorBuildException
- If fails to build theOfficeFloor
.- See Also:
OfficeFloorBuildException
-
-