Interface ManagedObjectContainer
-
- All Known Implementing Classes:
ManagedObjectContainerImpl
public interface ManagedObjectContainerContainer managing aManagedObject.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FunctionStatecheckReady(ManagedObjectReadyCheck check)Creates aFunctionStateto check if theManagedObjectcontained within thisManagedObjectContaineris ready.<E> FunctionStateextractExtension(ManagedObjectExtensionExtractor<E> extractor, E[] managedObjectExtensions, int extensionIndex, TeamManagement responsibleTeam)Extracts theManagedObjectextension from theManagedObjectcontained in thisManagedObjectContainer.java.lang.ObjectgetObject()Obtains the object being managed by theManagedObject.java.lang.ObjectgetOptionalObject()Obtains the object only if available, otherwisenull.ThreadStategetResponsibleThreadState()Obtains theThreadStateresponsible for changes to thisManagedObjectContainer.FunctionStateloadManagedObject(ManagedFunctionContainer managedFunctionContainer)Creates aFunctionStateto load theManagedObject.FunctionStateunloadManagedObject()Creates aFunctionStateto unload theManagedObject.FunctionStateunregisterGovernance(int governanceIndex)Unregisters theManagedObjectfromGovernance.
-
-
-
Method Detail
-
getResponsibleThreadState
ThreadState getResponsibleThreadState()
Obtains theThreadStateresponsible for changes to thisManagedObjectContainer.- Returns:
ThreadStateresponsible for changes to thisManagedObjectContainer.
-
loadManagedObject
FunctionState loadManagedObject(ManagedFunctionContainer managedFunctionContainer)
Creates aFunctionStateto load theManagedObject.- Parameters:
managedFunctionContainer-ManagedFunctionContainerrequiring theManagedObject.- Returns:
- Optional
FunctionStateto load theManagedObject. Should this returnnull, theManagedFunctionContainershould not then be executed, as it is expecting to wait. This will return theManagedFunctionContainerwhen theManagedObjectis loaded.
-
checkReady
FunctionState checkReady(ManagedObjectReadyCheck check)
Creates a
FunctionStateto check if theManagedObjectcontained within thisManagedObjectContaineris ready.Should the
ManagedObjectnot be ready, then will latch to wait for theManagedObjectto be ready.- Parameters:
check-ManagedObjectReadyCheck.- Returns:
FunctionStateto check if theManagedObjectcontained within thisManagedObjectContaineris ready.
-
extractExtension
<E> FunctionState extractExtension(ManagedObjectExtensionExtractor<E> extractor, E[] managedObjectExtensions, int extensionIndex, TeamManagement responsibleTeam)
Extracts the
ManagedObjectextension from theManagedObjectcontained in thisManagedObjectContainer.Should the
ManagedObjectnot be loaded, then noManagedObjectextension will be loaded.- Type Parameters:
E- Extension type.- Parameters:
extractor-ManagedObjectExtensionExtractor.managedObjectExtensions-Listto load theManagedObjectextension.extensionIndex- Index within theManagedObjectextensions array to load the extension.responsibleTeam-TeamManagementresponsible for extracting the extension. May benullto use anyTeam.- Returns:
FunctionStateto load theManagedObjectextension.
-
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
ManagedObjectornullif not yet available. - See Also:
OptionalThreadLocal
-
unregisterGovernance
FunctionState unregisterGovernance(int governanceIndex)
Unregisters theManagedObjectfromGovernance.- Parameters:
governanceIndex- Index of theGovernance.- Returns:
FunctionStateto unregister theManagedObjectfromGovernance.
-
unloadManagedObject
FunctionState unloadManagedObject()
Creates aFunctionStateto unload theManagedObject.- Returns:
FunctionStateto unload theManagedObject.
-
-