Package com.tangosol.util
Class SimpleResourceRegistry.RegistryValue
java.lang.Object
com.tangosol.util.SimpleResourceRegistry.RegistryValue
- All Implemented Interfaces:
Disposable
,AutoCloseable
- Enclosing class:
SimpleResourceRegistry
A holder for resource objects and their (optional) respective
ResourceLifecycleObservers
.
The ResourceRegistry.ResourceLifecycleObserver.onRelease(Object)
method will be invoked when dispose()
is invoked on this object. Furthermore,
if the provided resource implements Disposable
, its dispose()
method will
be invoked.-
Constructor Summary
ConstructorDescriptionRegistryValue
(Object oResource, ResourceRegistry.ResourceLifecycleObserver<Object> observer) Construct aSimpleResourceRegistry.RegistryValue
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Invoked when all resources owned by the implementer can safely be released.Return the lifecycle observer for the registered resource.Return the registered resource.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.oracle.coherence.common.base.Disposable
close
-
Constructor Details
-
RegistryValue
Construct aSimpleResourceRegistry.RegistryValue
object.- Parameters:
oResource
- the registered resourceobserver
- the lifecycle observer
-
-
Method Details
-
getResource
Return the registered resource.- Returns:
- the registered resource
-
getObserver
Return the lifecycle observer for the registered resource.- Returns:
- the lifecycle observer for the registered resource (may be null)
-
dispose
public void dispose()Invoked when all resources owned by the implementer can safely be released.Once disposed of the object should no longer be considered to be usable.
Note the Disposable interface is compatible with try-with-resources which will automatically invoke this method.
- Specified by:
dispose
in interfaceDisposable
-