Class SimpleResourceRegistry.RegistryValue

java.lang.Object
com.tangosol.util.SimpleResourceRegistry.RegistryValue
All Implemented Interfaces:
Disposable, AutoCloseable
Enclosing class:
SimpleResourceRegistry

protected class SimpleResourceRegistry.RegistryValue extends Object implements Disposable
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 Details

  • Method Details

    • getResource

      public Object 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 interface Disposable