Interface Disposable

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
Disposable, ParameterizedBuilderRegistry, ResourceRegistry, ServiceMonitor
All Known Implementing Classes:
BinaryMapStore, CoherenceBasedCacheManager, MultiBufferWriteBuffer, NullImplementation.NullResourceRegistry, ObservableSplittingBackingCache, ObservableSplittingBackingCache.CapacityAwareMap, ObservableSplittingBackingMap, PartitionSplittingBackingMap, SimpleParameterizedBuilderRegistry, SimpleParameterizedBuilderRegistry.RegistryValue, SimpleResourceRegistry, SimpleResourceRegistry.RegistryValue, SimpleResourceResolver, SimpleServiceMonitor

public interface Disposable extends AutoCloseable
The Disposable interface is used for life-cycle management of resources. Disposable is also AutoCloseable and thus is compatible with the try-with-resources pattern.
Author:
ch 2010.01.11
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Default implementation invokes dispose(), it is not recommended that this be overridden.
    void
    Invoked when all resources owned by the implementer can safely be released.
  • Method Details

    • dispose

      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.

    • close

      default void close()
      Default implementation invokes dispose(), it is not recommended that this be overridden.
      Specified by:
      close in interface AutoCloseable