Package net.officefloor.frame.util
Class ManagedObjectSourceStandAlone
java.lang.Object
net.officefloor.frame.util.ManagedObjectSourceStandAlone
Loads
ManagedObjectSource for stand-alone use.- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of theOfficemanaging theManagedObjectSourcebeing loaded. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProfile(String profile) Adds a profile.voidaddProperty(String name, String value) Adds a property for theManagedObjectSource.Obtains theManagingOfficeBuilder.<O extends Enum<O>,F extends Enum<F>, MS extends ManagedObjectSource<O, F>>
MSinitManagedObjectSource(Class<MS> managedObjectSourceClass) Instantiates and initialises theManagedObjectSource.<O extends Enum<O>,F extends Enum<F>, MS extends ManagedObjectSource<O, F>>
MSinitManagedObjectSource(MS managedObjectSource) Instantiates and initialises theManagedObjectSource.<O extends Enum<O>,F extends Enum<F>, MS extends ManagedObjectSource<O, F>>
MSloadManagedObjectSource(Class<MS> managedObjectSourceClass) Loads (init and start) theManagedObjectSource.<O extends Enum<O>,F extends Enum<F>, MS extends ManagedObjectSource<O, F>>
MSloadManagedObjectSource(MS managedObjectSource) Loads (init and start) theManagedObjectSource.voidregisterExecutionStrategy(int strategyIndex, ThreadFactory[] threadFactories) Registers anExecutionStrategy.voidregisterInvokeProcessFunction(int processIndex, ManagedFunction<?, ?> function, ManagedFunctionContext<?, ?> functionContext) Registers the initialManagedFunctionfor the invokedProcessState.voidregisterInvokeProcessFunction(Enum<?> processKey, ManagedFunction<?, ?> function, ManagedFunctionContext<?, ?> functionContext) Registers the initialManagedFunctionfor the invokedProcessState.voidregisterInvokeProcessServicer(int processIndex, InvokedProcessServicer servicer) Registers anInvokedProcessServicerfor the invokedProcessState.voidregisterInvokeProcessServicer(Enum<?> processKey, InvokedProcessServicer servicer) Registers anInvokedProcessServicerfor the invokedProcessState.voidsetClockFactory(ClockFactory clockFactory) Specifies theClockFactory.<O extends Enum<O>,F extends Enum<F>, MS extends ManagedObjectSource<O, F>>
voidstartManagedObjectSource(MS managedObjectSource) Starts theManagedObjectSource.
-
Field Details
-
STAND_ALONE_MANAGING_OFFICE_NAME
Name of theOfficemanaging theManagedObjectSourcebeing loaded.- See Also:
-
-
Constructor Details
-
ManagedObjectSourceStandAlone
public ManagedObjectSourceStandAlone()
-
-
Method Details
-
addProfile
Adds a profile.- Parameters:
profile- Profile.
-
addProperty
Adds a property for theManagedObjectSource.- Parameters:
name- Name of the property.value- Value for the property.
-
setClockFactory
Specifies theClockFactory.- Parameters:
clockFactory-ClockFactory.
-
getManagingOffice
Obtains theManagingOfficeBuilder.- Returns:
ManagingOfficeBuilder.
-
initManagedObjectSource
public <O extends Enum<O>,F extends Enum<F>, MS initManagedObjectSourceMS extends ManagedObjectSource<O, F>> (Class<MS> managedObjectSourceClass) throws Exception Instantiates and initialises theManagedObjectSource.- Type Parameters:
O- Dependency key type.F- Flow key type.MS-ManagedObjectSourcetype.- Parameters:
managedObjectSourceClass- Class of theManagedObjectSource.- Returns:
- Initialised
ManagedObjectSource. - Throws:
Exception- If fails to initialiseManagedObjectSource.
-
initManagedObjectSource
public <O extends Enum<O>,F extends Enum<F>, MS initManagedObjectSourceMS extends ManagedObjectSource<O, F>> (MS managedObjectSource) throws Exception Instantiates and initialises theManagedObjectSource.- Type Parameters:
O- Dependency key type.F- Flow key type.MS-ManagedObjectSourcetype.- Parameters:
managedObjectSource-ManagedObjectSourceinstance.- Returns:
- Initialised
ManagedObjectSource. - Throws:
Exception- If fails to initialiseManagedObjectSource.
-
startManagedObjectSource
public <O extends Enum<O>,F extends Enum<F>, void startManagedObjectSourceMS extends ManagedObjectSource<O, F>> (MS managedObjectSource) throws Exception Starts theManagedObjectSource.- Type Parameters:
O- Dependency key type.F- Flow key type.MS-ManagedObjectSourcetype.- Parameters:
managedObjectSource-ManagedObjectSource.- Throws:
Exception- If fails to start theManagedObjectSource.
-
loadManagedObjectSource
public <O extends Enum<O>,F extends Enum<F>, MS loadManagedObjectSourceMS extends ManagedObjectSource<O, F>> (Class<MS> managedObjectSourceClass) throws Exception Loads (init and start) theManagedObjectSource.- Type Parameters:
O- Dependency key type.F- Flow key type.MS-ManagedObjectSourcetype.- Parameters:
managedObjectSourceClass-ManagedObjectSourceclass.- Returns:
- Loaded
ManagedObjectSource. - Throws:
Exception- If fails to init and start theManagedObjectSource.
-
loadManagedObjectSource
public <O extends Enum<O>,F extends Enum<F>, MS loadManagedObjectSourceMS extends ManagedObjectSource<O, F>> (MS managedObjectSource) throws Exception Loads (init and start) theManagedObjectSource.- Type Parameters:
O- Dependency key type.F- Flow key type.MS-ManagedObjectSourcetype.- Parameters:
managedObjectSource-ManagedObjectSourceinstance.- Returns:
- Loaded
ManagedObjectSource. - Throws:
Exception- If fails to init and start theManagedObjectSource.
-
registerInvokeProcessFunction
public void registerInvokeProcessFunction(Enum<?> processKey, ManagedFunction<?, ?> function, ManagedFunctionContext<?, ?> functionContext) Registers the initialManagedFunctionfor the invokedProcessState.- Parameters:
processKey- Key of theProcessState.function- InitialManagedFunctionfor theProcessState.functionContext-ManagedFunctionContextfor theManagedFunction. Allows for mocking theManagedFunctionContextto validate functionality for theManagedFunction.
-
registerInvokeProcessFunction
public void registerInvokeProcessFunction(int processIndex, ManagedFunction<?, ?> function, ManagedFunctionContext<?, ?> functionContext) Registers the initialManagedFunctionfor the invokedProcessState.- Parameters:
processIndex- Index of theProcessState.function- InitialManagedFunctionfor theProcessState.functionContext-ManagedFunctionContextfor theManagedFunction. Allows for mocking theManagedFunctionContextto validate functionality for theManagedFunction.
-
registerInvokeProcessServicer
Registers anInvokedProcessServicerfor the invokedProcessState.- Parameters:
processKey- Key of theProcessState.servicer-InvokedProcessServicer.
-
registerInvokeProcessServicer
Registers anInvokedProcessServicerfor the invokedProcessState.- Parameters:
processIndex- Index of theProcessState.servicer-InvokedProcessServicer.
-
registerExecutionStrategy
Registers anExecutionStrategy.- Parameters:
strategyIndex- Index of theExecutionStrategy.threadFactories-ThreadFactoryinstances for theExecutionStrategy.
-