Package net.officefloor.frame.api.manage
Interface StateManager
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
StateManagerImpl
Manages state (multiple ManagedObject instances used externally).
ManagedObject instances are kept alive until the StateManager
is closed.
- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescription<O> OObtains the object for theManagedObjectsynchronously.<O> voidload(String boundObjectName, ObjectUser<O> user) Loads the object from theManagedObjectasynchronously.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
load
Loads the object from theManagedObjectasynchronously.- 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
<O> O getObject(String boundObjectName, long timeoutInMilliseconds) throws UnknownObjectException, Throwable Obtains the object for theManagedObjectsynchronously.- 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.
-