Package net.officefloor.frame.api.manage
Interface StateManager
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
StateManagerImpl
public interface StateManager extends java.lang.AutoCloseableManages state (multiple
ManagedObjectinstances used externally).ManagedObjectinstances are kept alive until theStateManageris closed.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <O> OgetObject(java.lang.String boundObjectName, long timeoutInMilliseconds)Obtains the object for theManagedObjectsynchronously.<O> voidload(java.lang.String boundObjectName, ObjectUser<O> user)Loads the object from theManagedObjectasynchronously.
-
-
-
Method Detail
-
load
<O> void load(java.lang.String boundObjectName, ObjectUser<O> user) throws UnknownObjectExceptionLoads the object from theManagedObjectasynchronously.- 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(java.lang.String boundObjectName, long timeoutInMilliseconds) throws UnknownObjectException, java.lang.ThrowableObtains the object for theManagedObjectsynchronously.- Parameters:
boundObjectName- Bound name of theManagedObject.timeoutInMilliseconds- Time out in milliseconds to wait for theManagedObjectcreation.- Returns:
- Object.
- Throws:
UnknownObjectException- If unknown bound object name.java.lang.Throwable- If failure in obtaining the bound object.
-
-