Interface SharedCloseable
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Subinterfaces:
IFilter
- All Known Implementing Classes:
BloomFilter
,ChannelProxy
,CompressionMetadata
,FileHandle
,IndexSummary
,MmappedRegions
,PartitionIndex
,SafeMemory
,SharedCloseableImpl
,SSTableContext
,WrappedSharedCloseable
public interface SharedCloseable extends java.lang.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 Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addTo(Ref.IdentityCollection identities)
java.lang.Throwable
close(java.lang.Throwable accumulate)
SharedCloseable
sharedCopy()
static <T extends SharedCloseable>
TsharedCopyOrNull(T sharedCloseable)
-
-
-
Method Detail
-
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
java.lang.Throwable close(java.lang.Throwable accumulate)
-
addTo
void addTo(Ref.IdentityCollection identities)
-
sharedCopyOrNull
static <T extends SharedCloseable> T sharedCopyOrNull(T sharedCloseable)
-
-