Package net.officefloor.frame.util
Class ManagedObjectSourceStandAlone
- java.lang.Object
-
- net.officefloor.frame.util.ManagedObjectSourceStandAlone
-
public class ManagedObjectSourceStandAlone extends java.lang.ObjectLoadsManagedObjectSourcefor stand-alone use.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSTAND_ALONE_MANAGING_OFFICE_NAMEName of theOfficemanaging theManagedObjectSourcebeing loaded.
-
Constructor Summary
Constructors Constructor Description ManagedObjectSourceStandAlone()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProfile(java.lang.String profile)Adds a profile.voidaddProperty(java.lang.String name, java.lang.String value)Adds a property for theManagedObjectSource.<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>>
MSinitManagedObjectSource(java.lang.Class<MS> managedObjectSourceClass)Instantiates and initialises theManagedObjectSource.<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>>
MSinitManagedObjectSource(MS managedObjectSource)Instantiates and initialises theManagedObjectSource.<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>>
MSloadManagedObjectSource(java.lang.Class<MS> managedObjectSourceClass)Loads (init and start) theManagedObjectSource.<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>>
MSloadManagedObjectSource(MS managedObjectSource)Loads (init and start) theManagedObjectSource.voidregisterExecutionStrategy(int strategyIndex, java.util.concurrent.ThreadFactory[] threadFactories)Registers anExecutionStrategy.voidregisterInvokeProcessFunction(int processIndex, ManagedFunction<?,?> function, ManagedFunctionContext<?,?> functionContext)Registers the initialManagedFunctionfor the invokedProcessState.voidregisterInvokeProcessFunction(java.lang.Enum<?> processKey, ManagedFunction<?,?> function, ManagedFunctionContext<?,?> functionContext)Registers the initialManagedFunctionfor the invokedProcessState.voidregisterInvokeProcessServicer(int processIndex, InvokedProcessServicer servicer)Registers anInvokedProcessServicerfor the invokedProcessState.voidregisterInvokeProcessServicer(java.lang.Enum<?> processKey, InvokedProcessServicer servicer)Registers anInvokedProcessServicerfor the invokedProcessState.voidsetClockFactory(ClockFactory clockFactory)Specifies theClockFactory.<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>>
voidstartManagedObjectSource(MS managedObjectSource)Starts theManagedObjectSource.
-
-
-
Field Detail
-
STAND_ALONE_MANAGING_OFFICE_NAME
public static final java.lang.String STAND_ALONE_MANAGING_OFFICE_NAME
Name of theOfficemanaging theManagedObjectSourcebeing loaded.- See Also:
- Constant Field Values
-
-
Method Detail
-
addProfile
public void addProfile(java.lang.String profile)
Adds a profile.- Parameters:
profile- Profile.
-
addProperty
public void addProperty(java.lang.String name, java.lang.String value)Adds a property for theManagedObjectSource.- Parameters:
name- Name of the property.value- Value for the property.
-
setClockFactory
public void setClockFactory(ClockFactory clockFactory)
Specifies theClockFactory.- Parameters:
clockFactory-ClockFactory.
-
initManagedObjectSource
public <O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>> MS initManagedObjectSource(java.lang.Class<MS> managedObjectSourceClass) throws java.lang.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:
java.lang.Exception- If fails to initialiseManagedObjectSource.
-
initManagedObjectSource
public <O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>> MS initManagedObjectSource(MS managedObjectSource) throws java.lang.Exception
Instantiates and initialises theManagedObjectSource.- Type Parameters:
O- Dependency key type.F- Flow key type.MS-ManagedObjectSourcetype.- Parameters:
managedObjectSource-ManagedObjectSourceinstance.- Returns:
- Initialised
ManagedObjectSource. - Throws:
java.lang.Exception- If fails to initialiseManagedObjectSource.
-
startManagedObjectSource
public <O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>> void startManagedObjectSource(MS managedObjectSource) throws java.lang.Exception
Starts theManagedObjectSource.- Type Parameters:
O- Dependency key type.F- Flow key type.MS-ManagedObjectSourcetype.- Parameters:
managedObjectSource-ManagedObjectSource.- Throws:
java.lang.Exception- If fails to start theManagedObjectSource.
-
loadManagedObjectSource
public <O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>> MS loadManagedObjectSource(java.lang.Class<MS> managedObjectSourceClass) throws java.lang.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:
java.lang.Exception- If fails to init and start theManagedObjectSource.
-
loadManagedObjectSource
public <O extends java.lang.Enum<O>,F extends java.lang.Enum<F>,MS extends ManagedObjectSource<O,F>> MS loadManagedObjectSource(MS managedObjectSource) throws java.lang.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:
java.lang.Exception- If fails to init and start theManagedObjectSource.
-
registerInvokeProcessFunction
public void registerInvokeProcessFunction(java.lang.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
public void registerInvokeProcessServicer(java.lang.Enum<?> processKey, InvokedProcessServicer servicer)Registers anInvokedProcessServicerfor the invokedProcessState.- Parameters:
processKey- Key of theProcessState.servicer-InvokedProcessServicer.
-
registerInvokeProcessServicer
public void registerInvokeProcessServicer(int processIndex, InvokedProcessServicer servicer)Registers anInvokedProcessServicerfor the invokedProcessState.- Parameters:
processIndex- Index of theProcessState.servicer-InvokedProcessServicer.
-
registerExecutionStrategy
public void registerExecutionStrategy(int strategyIndex, java.util.concurrent.ThreadFactory[] threadFactories)Registers anExecutionStrategy.- Parameters:
strategyIndex- Index of theExecutionStrategy.threadFactories-ThreadFactoryinstances for theExecutionStrategy.
-
-