Interface ManagedObjectContainer
-
- All Known Implementing Classes:
ManagedObjectContainerImpl
public interface ManagedObjectContainer
Container managing aManagedObject
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FunctionState
checkReady(ManagedObjectReadyCheck check)
Creates aFunctionState
to check if theManagedObject
contained within thisManagedObjectContainer
is ready.<E> FunctionState
extractExtension(ManagedObjectExtensionExtractor<E> extractor, E[] managedObjectExtensions, int extensionIndex, TeamManagement responsibleTeam)
Extracts theManagedObject
extension from theManagedObject
contained in thisManagedObjectContainer
.java.lang.Object
getObject()
Obtains the object being managed by theManagedObject
.java.lang.Object
getOptionalObject()
Obtains the object only if available, otherwisenull
.ThreadState
getResponsibleThreadState()
Obtains theThreadState
responsible for changes to thisManagedObjectContainer
.FunctionState
loadManagedObject(ManagedFunctionContainer managedFunctionContainer)
Creates aFunctionState
to load theManagedObject
.FunctionState
unloadManagedObject()
Creates aFunctionState
to unload theManagedObject
.FunctionState
unregisterGovernance(int governanceIndex)
Unregisters theManagedObject
fromGovernance
.
-
-
-
Method Detail
-
getResponsibleThreadState
ThreadState getResponsibleThreadState()
Obtains theThreadState
responsible for changes to thisManagedObjectContainer
.- Returns:
ThreadState
responsible for changes to thisManagedObjectContainer
.
-
loadManagedObject
FunctionState loadManagedObject(ManagedFunctionContainer managedFunctionContainer)
Creates aFunctionState
to load theManagedObject
.- Parameters:
managedFunctionContainer
-ManagedFunctionContainer
requiring theManagedObject
.- Returns:
- Optional
FunctionState
to load theManagedObject
. Should this returnnull
, theManagedFunctionContainer
should not then be executed, as it is expecting to wait. This will return theManagedFunctionContainer
when theManagedObject
is loaded.
-
checkReady
FunctionState checkReady(ManagedObjectReadyCheck check)
Creates a
FunctionState
to check if theManagedObject
contained within thisManagedObjectContainer
is ready.Should the
ManagedObject
not be ready, then will latch to wait for theManagedObject
to be ready.- Parameters:
check
-ManagedObjectReadyCheck
.- Returns:
FunctionState
to check if theManagedObject
contained within thisManagedObjectContainer
is ready.
-
extractExtension
<E> FunctionState extractExtension(ManagedObjectExtensionExtractor<E> extractor, E[] managedObjectExtensions, int extensionIndex, TeamManagement responsibleTeam)
Extracts the
ManagedObject
extension from theManagedObject
contained in thisManagedObjectContainer
.Should the
ManagedObject
not be loaded, then noManagedObject
extension will be loaded.- Type Parameters:
E
- Extension type.- Parameters:
extractor
-ManagedObjectExtensionExtractor
.managedObjectExtensions
-List
to load theManagedObject
extension.extensionIndex
- Index within theManagedObject
extensions array to load the extension.responsibleTeam
-TeamManagement
responsible for extracting the extension. May benull
to use anyTeam
.- Returns:
FunctionState
to load theManagedObject
extension.
-
getObject
java.lang.Object getObject()
Obtains the object being managed by theManagedObject
.- Returns:
- Object being managed by the
ManagedObject
.
-
getOptionalObject
java.lang.Object getOptionalObject()
Obtains the object only if available, otherwisenull
.- Returns:
- Object being managed by the
ManagedObject
ornull
if not yet available. - See Also:
OptionalThreadLocal
-
unregisterGovernance
FunctionState unregisterGovernance(int governanceIndex)
Unregisters theManagedObject
fromGovernance
.- Parameters:
governanceIndex
- Index of theGovernance
.- Returns:
FunctionState
to unregister theManagedObject
fromGovernance
.
-
unloadManagedObject
FunctionState unloadManagedObject()
Creates aFunctionState
to unload theManagedObject
.- Returns:
FunctionState
to unload theManagedObject
.
-
-