Interface OfficeBuilder
-
- All Known Implementing Classes:
OfficeBuilderImpl
public interface OfficeBuilderBuilder of anOffice.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddEscalation(java.lang.Class<? extends java.lang.Throwable> typeOfCause, java.lang.String functionName)Adds anEscalationFlowfor issues not handled within theOffice.<E,F extends java.lang.Enum<F>>
GovernanceBuilder<F>addGovernance(java.lang.String governanceName, java.lang.Class<E> extensionInterface, GovernanceFactory<? super E,F> governanceFactory)AddsGovernancewithin theOffice.<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
ManagedFunctionBuilder<O,F>addManagedFunction(java.lang.String functionName, ManagedFunctionFactory<O,F> mangedFunctionFactory)Adds aManagedFunctionto be executed within theOffice.voidaddOfficeEnhancer(OfficeEnhancer officeEnhancer)AddsOfficeEnhancerfor thisOffice.ThreadDependencyMappingBuilderaddProcessManagedObject(java.lang.String processManagedObjectName, java.lang.String officeManagedObjectName)voidaddStartupFunction(java.lang.String functionName)Adds aManagedFunctionto invoke on start up of theOffice.ThreadDependencyMappingBuilderaddThreadManagedObject(java.lang.String threadManagedObjectName, java.lang.String officeManagedObjectName)voidaddThreadSynchroniser(ThreadSynchroniserFactory threadSynchroniserFactory)voidregisterManagedObjectSource(java.lang.String officeManagedObjectName, java.lang.String officeFloorManagedObjectSourceName)Registers theManagedObjectwithin thisOffice.voidregisterTeam(java.lang.String officeTeamName, java.lang.String officeFloorTeamName)voidsetBoundInputManagedObject(java.lang.String inputManagedObjectName, java.lang.String managedObjectSourceName)Specifies the inputManagedObjectto be bound to theProcessStateshould there be multiple instances and it was not input.voidsetDefaultAsynchronousFlowTimeout(long timeout)Specifies the default timeout forAsynchronousFlowinstances.voidsetDefaultTeam(java.lang.String officeTeamName)voidsetManuallyManageGovernance(boolean isManuallyManageGovernance)Flags whether to manually manageGovernanceviaAdministrationinstances.voidsetMaximumFunctionStateChainLength(int maximumFunctionStateChainLength)Specifies the maximumFunctionStatechain length.voidsetMonitorClock(MonitorClock clock)Allows providing anMonitorClockimplementation to obtain the current time.voidsetMonitorOfficeInterval(long monitorOfficeInterval)Specifies the interval in milli-seconds between each time theOfficeManagermonitors theOffice.voidsetProfiler(Profiler profiler)
-
-
-
Method Detail
-
setMonitorClock
void setMonitorClock(MonitorClock clock)
Allows providing an
MonitorClockimplementation to obtain the current time.Should no
MonitorClockbe provided, a default implementation will be used.Typically this is useful in testing to fix to a deterministic time. However, should there be native implementations of keeping time that is efficient, this enables overriding the default implementation.
- Parameters:
clock-MonitorClock.
-
setMonitorOfficeInterval
void setMonitorOfficeInterval(long monitorOfficeInterval)
Specifies the interval in milli-seconds between each time theOfficeManagermonitors theOffice.- Parameters:
monitorOfficeInterval- Interval in milli-seconds between each time theOfficeManagermonitors theOffice.
-
setMaximumFunctionStateChainLength
void setMaximumFunctionStateChainLength(int maximumFunctionStateChainLength)
Specifies the maximum
FunctionStatechain length.This value is a trade off between limiting
Threadstack calls and performance. Setting this value low runs the risk ofStackOverflowErroroccurring in having recursively call into theFunctionStatechain. Setting this value high, has moreThreadoverheads in breaking the recursive chain, slowing performance.- Parameters:
maximumFunctionStateChainLength- MaximumFunctionStatechain length.
-
setDefaultAsynchronousFlowTimeout
void setDefaultAsynchronousFlowTimeout(long timeout)
Specifies the default timeout forAsynchronousFlowinstances.- Parameters:
timeout- Default timeout.
-
registerTeam
void registerTeam(java.lang.String officeTeamName, java.lang.String officeFloorTeamName)- Parameters:
officeTeamName- Name of theTeamto be referenced locally by thisOffice.officeFloorTeamName- Name of theTeamwithin theOfficeFloor.
-
setDefaultTeam
void setDefaultTeam(java.lang.String officeTeamName)
-
registerManagedObjectSource
void registerManagedObjectSource(java.lang.String officeManagedObjectName, java.lang.String officeFloorManagedObjectSourceName)Registers theManagedObjectwithin thisOffice.- Parameters:
officeManagedObjectName- Name of theManagedObjectto be referenced locally by thisOffice.officeFloorManagedObjectSourceName- Name of theManagedObjectSourcewithin theOfficeFloor.
-
setBoundInputManagedObject
void setBoundInputManagedObject(java.lang.String inputManagedObjectName, java.lang.String managedObjectSourceName)Specifies the inputManagedObjectto be bound to theProcessStateshould there be multiple instances and it was not input.- Parameters:
inputManagedObjectName- InputManagedObjectname.managedObjectSourceName-ManagedObjectSourcename.
-
addProcessManagedObject
ThreadDependencyMappingBuilder addProcessManagedObject(java.lang.String processManagedObjectName, java.lang.String officeManagedObjectName)
Adds a
ProcessStateboundManagedObjectto thisOffice.Dependency scope:
- Other
ManagedObjectinstances added via this method.
- Parameters:
processManagedObjectName- Name to link theManagedObjectforManagedFunctioninstances.officeManagedObjectName- Name of theManagedObjectregistered within thisOffice.- Returns:
ThreadDependencyMappingBuilderto build any necessary dependencies for theManagedObject. See scope above.
- Other
-
addThreadManagedObject
ThreadDependencyMappingBuilder addThreadManagedObject(java.lang.String threadManagedObjectName, java.lang.String officeManagedObjectName)
Adds a
ThreadStateboundManagedObjectto thisOffice.Dependency scope:
- Other
ManagedObjectinstances added via this method. ProcessStateboundManagedObjectinstances.
- Parameters:
threadManagedObjectName- Name to link theManagedObjectforManagedFunctioninstances.officeManagedObjectName- Name of theManagedObjectregistered within thisOffice.- Returns:
ThreadDependencyMappingBuilderto build any necessary dependencies for theManagedObject. See scope above.
- Other
-
setManuallyManageGovernance
void setManuallyManageGovernance(boolean isManuallyManageGovernance)
Flags whether to manually manageGovernanceviaAdministrationinstances.- Parameters:
isManuallyManageGovernance-trueto manually manageGovernanceviaAdministrationinstances.
-
addGovernance
<E,F extends java.lang.Enum<F>> GovernanceBuilder<F> addGovernance(java.lang.String governanceName, java.lang.Class<E> extensionInterface, GovernanceFactory<? super E,F> governanceFactory)
AddsGovernancewithin theOffice.- Type Parameters:
E- Extension interface type.F- Flow key type.- Parameters:
governanceName- Name of theGovernanceto be referenced locally by thisOffice.extensionInterface- Extension interface.governanceFactory-GovernanceFactoryclass.- Returns:
GovernanceBuilder.
-
addManagedFunction
<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> ManagedFunctionBuilder<O,F> addManagedFunction(java.lang.String functionName, ManagedFunctionFactory<O,F> mangedFunctionFactory)
Adds aManagedFunctionto be executed within theOffice.- Type Parameters:
O- Dependency key type.F- Flow key type.- Parameters:
functionName- Name of theManagedFunction.mangedFunctionFactory-ManagedFunctionFactoryto create theManagedFunction.- Returns:
ManagedFunctionBuilderfor theManagedFunction.
-
addEscalation
void addEscalation(java.lang.Class<? extends java.lang.Throwable> typeOfCause, java.lang.String functionName)Adds anEscalationFlowfor issues not handled within theOffice.- Parameters:
typeOfCause- Type of cause handled by thisEscalationFlow.functionName- Name ofManagedFunctionto handle theEscalationFlow.
-
addStartupFunction
void addStartupFunction(java.lang.String functionName)
Adds aManagedFunctionto invoke on start up of theOffice.- Parameters:
functionName- Name ofManagedFunction.
-
addOfficeEnhancer
void addOfficeEnhancer(OfficeEnhancer officeEnhancer)
Adds
OfficeEnhancerfor thisOffice.This enables enhancing the
Officeafter theManagedObjectSourceinstances are registered.- Parameters:
officeEnhancer-OfficeEnhancer.
-
addThreadSynchroniser
void addThreadSynchroniser(ThreadSynchroniserFactory threadSynchroniserFactory)
- Parameters:
threadSynchroniserFactory-ThreadSynchroniserFactoryto create theThreadSynchroniser.
-
-