protected class SimpleResourceRegistry.RegistryValue extends Object implements com.oracle.coherence.common.base.Disposable
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 and Description |
---|
RegistryValue(Object oResource,
ResourceRegistry.ResourceLifecycleObserver<Object> observer)
Construct a
SimpleResourceRegistry.RegistryValue object. |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Invoked when all resources owned by the implementer can safely be
released.
|
ResourceRegistry.ResourceLifecycleObserver<Object> |
getObserver()
Return the lifecycle observer for the registered resource.
|
Object |
getResource()
Return the registered resource.
|
public RegistryValue(Object oResource, ResourceRegistry.ResourceLifecycleObserver<Object> observer)
SimpleResourceRegistry.RegistryValue
object.oResource
- the registered resourceobserver
- the lifecycle observerpublic Object getResource()
public ResourceRegistry.ResourceLifecycleObserver<Object> getObserver()
public void dispose()
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.
dispose
in interface com.oracle.coherence.common.base.Disposable