Package net.officefloor.frame.util
Class ManagedObjectSourceStandAlone
- java.lang.Object
-
- net.officefloor.frame.util.ManagedObjectSourceStandAlone
-
public class ManagedObjectSourceStandAlone extends java.lang.Object
LoadsManagedObjectSource
for stand-alone use.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
STAND_ALONE_MANAGING_OFFICE_NAME
Name of theOffice
managing theManagedObjectSource
being loaded.
-
Constructor Summary
Constructors Constructor Description ManagedObjectSourceStandAlone()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProfile(java.lang.String profile)
Adds a profile.void
addProperty(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
.void
registerExecutionStrategy(int strategyIndex, java.util.concurrent.ThreadFactory[] threadFactories)
Registers anExecutionStrategy
.void
registerInvokeProcessFunction(int processIndex, ManagedFunction<?,?> function, ManagedFunctionContext<?,?> functionContext)
Registers the initialManagedFunction
for the invokedProcessState
.void
registerInvokeProcessFunction(java.lang.Enum<?> processKey, ManagedFunction<?,?> function, ManagedFunctionContext<?,?> functionContext)
Registers the initialManagedFunction
for the invokedProcessState
.void
registerInvokeProcessServicer(int processIndex, InvokedProcessServicer servicer)
Registers anInvokedProcessServicer
for the invokedProcessState
.void
registerInvokeProcessServicer(java.lang.Enum<?> processKey, InvokedProcessServicer servicer)
Registers anInvokedProcessServicer
for the invokedProcessState
.void
setClockFactory(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 theOffice
managing theManagedObjectSource
being 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
-ManagedObjectSource
type.- 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
-ManagedObjectSource
type.- Parameters:
managedObjectSource
-ManagedObjectSource
instance.- 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
-ManagedObjectSource
type.- 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
-ManagedObjectSource
type.- Parameters:
managedObjectSourceClass
-ManagedObjectSource
class.- 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
-ManagedObjectSource
type.- Parameters:
managedObjectSource
-ManagedObjectSource
instance.- 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 initialManagedFunction
for the invokedProcessState
.- Parameters:
processKey
- Key of theProcessState
.function
- InitialManagedFunction
for theProcessState
.functionContext
-ManagedFunctionContext
for theManagedFunction
. Allows for mocking theManagedFunctionContext
to validate functionality for theManagedFunction
.
-
registerInvokeProcessFunction
public void registerInvokeProcessFunction(int processIndex, ManagedFunction<?,?> function, ManagedFunctionContext<?,?> functionContext)
Registers the initialManagedFunction
for the invokedProcessState
.- Parameters:
processIndex
- Index of theProcessState
.function
- InitialManagedFunction
for theProcessState
.functionContext
-ManagedFunctionContext
for theManagedFunction
. Allows for mocking theManagedFunctionContext
to validate functionality for theManagedFunction
.
-
registerInvokeProcessServicer
public void registerInvokeProcessServicer(java.lang.Enum<?> processKey, InvokedProcessServicer servicer)
Registers anInvokedProcessServicer
for the invokedProcessState
.- Parameters:
processKey
- Key of theProcessState
.servicer
-InvokedProcessServicer
.
-
registerInvokeProcessServicer
public void registerInvokeProcessServicer(int processIndex, InvokedProcessServicer servicer)
Registers anInvokedProcessServicer
for 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
-ThreadFactory
instances for theExecutionStrategy
.
-
-