Interface AutoWireStateManager
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
AutoWireStateManagerImpl
public interface AutoWireStateManager extends java.lang.AutoCloseable
StateManager
that enables obtainingManagedObject
objects by their qualifications and types.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <O> O
getObject(java.lang.String qualifier, java.lang.Class<? extends O> objectType, long timeoutInMilliseconds)
Obtains the object for theManagedObject
synchronously.boolean
isObjectAvailable(java.lang.String qualifier, java.lang.Class<?> objectType)
Indicates if the object by auto-wiring is available.<O> void
load(java.lang.String qualifier, java.lang.Class<? extends O> objectType, ObjectUser<O> user)
Loads the object from theManagedObject
asynchronously.
-
-
-
Method Detail
-
isObjectAvailable
boolean isObjectAvailable(java.lang.String qualifier, java.lang.Class<?> objectType)
Indicates if the object by auto-wiring is available.- Parameters:
qualifier
- Qualifier. May benull
.objectType
- Required object type.- Returns:
true
if the object is available.
-
load
<O> void load(java.lang.String qualifier, java.lang.Class<? extends O> objectType, ObjectUser<O> user) throws UnknownObjectException
Loads the object from theManagedObject
asynchronously.- Parameters:
qualifier
- Qualifier. May benull
.objectType
- Required object type.user
-ObjectUser
to receive the loaded object (or possible failure).- Throws:
UnknownObjectException
- If unknown bound object name.
-
getObject
<O> O getObject(java.lang.String qualifier, java.lang.Class<? extends O> objectType, long timeoutInMilliseconds) throws UnknownObjectException, java.lang.Throwable
Obtains the object for theManagedObject
synchronously.- Parameters:
qualifier
- Qualifier. May benull
.objectType
- Required object type.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.
-
-