Class StateManagerImpl
java.lang.Object
net.officefloor.frame.impl.execute.office.StateManagerImpl
- All Implemented Interfaces:
AutoCloseable,StateManager
StateManager implementation.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionStateManagerImpl(Map<String, ManagedFunctionMetaData<?, ?>> loadObjectMetaDatas, ThreadState threadState, MonitorClock monitorClock, Consumer<FunctionState> functionExecutor, Runnable cleanUpState) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<O> OObtains the object for theManagedObjectsynchronously.<O> voidload(String boundObjectName, ObjectUser<O> user) Loads the object from theManagedObjectasynchronously.
-
Constructor Details
-
StateManagerImpl
public StateManagerImpl(Map<String, ManagedFunctionMetaData<?, ?>> loadObjectMetaDatas, ThreadState threadState, MonitorClock monitorClock, Consumer<FunctionState> functionExecutor, Runnable cleanUpState) Instantiate.- Parameters:
loadObjectMetaDatas- Load objectManagedFunctionMetaDatainstances by the loading object bound name.threadState-ThreadStatefor context of theManagedObjectinstances.monitorClock-MonitorClock.functionExecutor- Executes theFunctionStateinstances.cleanUpState- Cleans up state on closingStateManager.
-
-
Method Details
-
load
Description copied from interface:StateManagerLoads the object from theManagedObjectasynchronously.- Specified by:
loadin interfaceStateManager- Type Parameters:
O- Object type.- Parameters:
boundObjectName- Bound name of theManagedObject.user-ObjectUserto receive the loaded object (or possible failure).- Throws:
UnknownObjectException- If unknown bound object name.
-
getObject
Description copied from interface:StateManagerObtains the object for theManagedObjectsynchronously.- Specified by:
getObjectin interfaceStateManager- Type Parameters:
O- Object type.- Parameters:
boundObjectName- Bound name of theManagedObject.timeoutInMilliseconds- Time out in milliseconds to wait for theManagedObjectcreation.- Returns:
- Object.
- Throws:
UnknownObjectException- If unknown bound object name.Throwable- If failure in obtaining the bound object.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-