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