Class OfficeMetaDataImpl
- java.lang.Object
-
- net.officefloor.frame.impl.execute.office.OfficeMetaDataImpl
-
- All Implemented Interfaces:
OfficeMetaData
public class OfficeMetaDataImpl extends java.lang.Object implements OfficeMetaData
OfficeMetaData
implementation.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description OfficeMetaDataImpl(java.lang.String officeName, OfficeManagerHirer officeManagerHirer, MonitorClock monitorClock, FunctionLoop functionLoop, ThreadLocalAwareExecutor threadLocalAwareExecutor, Executive executive, ManagedExecutionFactory managedExecutionFactory, ManagedFunctionMetaData<?,?>[] functionMetaDatas, ManagedFunctionLocator functionLocator, ProcessMetaData processMetaData, ManagedFunctionMetaData<?,?> stateKeepAliveFunctionMetaData, java.util.Map<java.lang.String,ManagedFunctionMetaData<?,?>> loadObjectMetaDatas, OfficeStartupFunction[] startupFunctions, Profiler profiler)
Initiate.
-
Method Summary
-
-
-
Constructor Detail
-
OfficeMetaDataImpl
public OfficeMetaDataImpl(java.lang.String officeName, OfficeManagerHirer officeManagerHirer, MonitorClock monitorClock, FunctionLoop functionLoop, ThreadLocalAwareExecutor threadLocalAwareExecutor, Executive executive, ManagedExecutionFactory managedExecutionFactory, ManagedFunctionMetaData<?,?>[] functionMetaDatas, ManagedFunctionLocator functionLocator, ProcessMetaData processMetaData, ManagedFunctionMetaData<?,?> stateKeepAliveFunctionMetaData, java.util.Map<java.lang.String,ManagedFunctionMetaData<?,?>> loadObjectMetaDatas, OfficeStartupFunction[] startupFunctions, Profiler profiler)
Initiate.- Parameters:
officeName
- Name of theOffice
.officeManagerHirer
-OfficeManagerHirer
.monitorClock
-MonitorClock
.functionLoop
-FunctionLoop
.threadLocalAwareExecutor
-ThreadLocalAwareExecutor
.executive
-Executive
.managedExecutionFactory
-ManagedExecutionFactory
.functionMetaDatas
-ManagedFunctionMetaData
of theManagedFunction
that can be executed within theOffice
.functionLocator
-ManagedFunctionLocator
.processMetaData
-ProcessMetaData
of theProcessState
instances created within thisOffice
.stateKeepAliveFunctionMetaData
-ManagedFunctionMetaData
of theManagedFunction
that keeps theStateManager
active.loadObjectMetaDatas
- Load objectManagedFunctionMetaData
byManagedObject
bound name.startupFunctions
-OfficeStartupFunction
instances.profiler
-Profiler
.
-
-
Method Detail
-
getOfficeName
public java.lang.String getOfficeName()
Description copied from interface:OfficeMetaData
Obtains the name of theOffice
.- Specified by:
getOfficeName
in interfaceOfficeMetaData
- Returns:
- Name of the
Office
.
-
createProcessIdentifier
public ProcessIdentifier createProcessIdentifier(ProcessState processState)
Description copied from interface:OfficeMetaData
Creates aProcessIdentifier
for a newProcessState
.- Specified by:
createProcessIdentifier
in interfaceOfficeMetaData
- Parameters:
processState
- NewProcessState
.- Returns:
- New
ProcessIdentifier
.
-
getOfficeManager
public OfficeManager getOfficeManager(ProcessIdentifier processIdentifier)
Description copied from interface:OfficeMetaData
Obtains theOfficeManager
for theProcessState
.- Specified by:
getOfficeManager
in interfaceOfficeMetaData
- Parameters:
processIdentifier
-ProcessIdentifier
of theProcessState
.- Returns:
OfficeManager
of theOffice
.
-
getExecutor
public java.util.concurrent.Executor getExecutor(ProcessIdentifier processIdentifier)
Description copied from interface:OfficeMetaData
Obtains theExecutor
for theProcessState
.- Specified by:
getExecutor
in interfaceOfficeMetaData
- Parameters:
processIdentifier
-ProcessIdentifier
of theProcessState
.- Returns:
Executor
for theProcessState
.
-
getMonitorClock
public MonitorClock getMonitorClock()
Description copied from interface:OfficeMetaData
Obtains theMonitorClock
for theOffice
.- Specified by:
getMonitorClock
in interfaceOfficeMetaData
- Returns:
MonitorClock
for theOffice
.
-
getFunctionLoop
public FunctionLoop getFunctionLoop()
Description copied from interface:OfficeMetaData
Obtains theFunctionLoop
for theOffice
.- Specified by:
getFunctionLoop
in interfaceOfficeMetaData
- Returns:
FunctionLoop
for theOffice
.
-
getProcessMetaData
public ProcessMetaData getProcessMetaData()
Description copied from interface:OfficeMetaData
Obtains theProcessMetaData
for processes within thisOffice
.- Specified by:
getProcessMetaData
in interfaceOfficeMetaData
- Returns:
ProcessMetaData
for processes within thisOffice
.
-
getManagedFunctionMetaData
public ManagedFunctionMetaData<?,?>[] getManagedFunctionMetaData()
Description copied from interface:OfficeMetaData
- Specified by:
getManagedFunctionMetaData
in interfaceOfficeMetaData
- Returns:
ManagedFunctionMetaData
instances of thisOffice
.
-
getManagedFunctionLocator
public ManagedFunctionLocator getManagedFunctionLocator()
Description copied from interface:OfficeMetaData
Obtains theManagedFunctionLocator
.- Specified by:
getManagedFunctionLocator
in interfaceOfficeMetaData
- Returns:
ManagedFunctionLocator
.
-
getStartupFunctions
public OfficeStartupFunction[] getStartupFunctions()
Description copied from interface:OfficeMetaData
Obtains theOfficeStartupFunction
instances for thisOffice
.- Specified by:
getStartupFunctions
in interfaceOfficeMetaData
- Returns:
OfficeStartupFunction
instances for thisOffice
.
-
getExecutive
public Executive getExecutive()
Description copied from interface:OfficeMetaData
- Specified by:
getExecutive
in interfaceOfficeMetaData
- Returns:
Executive
for thisOffice
.
-
getManagedExecutionFactory
public ManagedExecutionFactory getManagedExecutionFactory()
Description copied from interface:OfficeMetaData
Obtains theManagedExecutionFactory
for thisOffice
.- Specified by:
getManagedExecutionFactory
in interfaceOfficeMetaData
- Returns:
ManagedExecutionFactory
for thisOffice
.
-
createProcess
public FunctionState createProcess(FlowMetaData flowMetaData, java.lang.Object parameter, FlowCallback callback, ThreadState callbackThreadState)
Description copied from interface:OfficeMetaData
Creates a newProcessState
.- Specified by:
createProcess
in interfaceOfficeMetaData
- Parameters:
flowMetaData
-FlowMetaData
of the startingFunctionState
for theProcessState
.parameter
- Parameter to the startingFunctionState
.callback
- OptionalFlowCallback
of theProcessState
. May benull
.callbackThreadState
- OptionalThreadState
for theFlowCallback
. May benull
.- Returns:
FunctionState
to start processing theProcessState
.
-
setupDefaultOfficeManager
public OfficeManager setupDefaultOfficeManager()
Description copied from interface:OfficeMetaData
Sets up the defaultOfficeManager
.- Specified by:
setupDefaultOfficeManager
in interfaceOfficeMetaData
- Returns:
- Default
OfficeManager
.
-
createStateManager
public StateManager createStateManager()
Description copied from interface:OfficeMetaData
Creates aStateManager
.- Specified by:
createStateManager
in interfaceOfficeMetaData
- Returns:
Statement
.
-
invokeProcess
public ProcessManager invokeProcess(FlowMetaData flowMetaData, java.lang.Object parameter, long delay, FlowCallback callback, ThreadState callbackThreadState, ManagedObject inputManagedObject, ManagedObjectMetaData<?> inputManagedObjectMetaData, int processBoundIndexForInputManagedObject) throws InvalidParameterTypeException
Description copied from interface:OfficeMetaData
Invokes aProcessState
.- Specified by:
invokeProcess
in interfaceOfficeMetaData
- Parameters:
flowMetaData
-FlowMetaData
of the startingFunctionState
for theProcessState
.parameter
- Parameter to the startingFunctionState
.delay
- Millisecond delay in invoking theProcessState
. 0 (or negative value) will invoke immediately on the currentThread
.callback
- OptionalFlowCallback
of theProcessState
. May benull
.callbackThreadState
- OptionalThreadState
for theFlowCallback
. May benull
.inputManagedObject
-ManagedObject
that possibly invoked the newProcessState
. This may benull
and if so the remaining parameters will be ignored.inputManagedObjectMetaData
-ManagedObjectMetaData
for theManagedObject
that invoked the newProcessState
. Should theManagedObject
be provided this must then also be provided.processBoundIndexForInputManagedObject
- Index of theManagedObject
within theProcessState
. Ignored ifManagedObject
passed in isnull
.- Returns:
ProcessManager
for the invokedProcessState
.- Throws:
InvalidParameterTypeException
- Should the type of parameter be invalid for the initialManagedFunction
.
-
-