protected class SimpleResourceRegistry.RegistryValue extends Object implements 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic 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 Disposable