Interface SharedCloseable

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
IFilter
All Known Implementing Classes:
BloomFilter, ChannelProxy, CompressionMetadata, FileHandle, IndexSummary, MmappedRegions, PartitionIndex, SafeMemory, SharedCloseableImpl, SSTableContext, WrappedSharedCloseable

public interface SharedCloseable extends AutoCloseable
A simple extension of AutoCloseable, that represents a resource that can be utilised in multiple locations, each managing their own closure of the resource, so that when the last such instance is closed all are.
  • Method Details

    • sharedCopy

      SharedCloseable sharedCopy()
      Returns:
      a new instance of the object representing the same state and backed by the same underlying resources. Coordinates with the original (and other instances) when the underlying resource should be closed. Throws an exception if the shared resource has already been closed.
    • close

      Throwable close(Throwable accumulate)
    • addTo

      void addTo(Ref.IdentityCollection identities)
    • sharedCopyOrNull

      static <T extends SharedCloseable> T sharedCopyOrNull(T sharedCloseable)