Package io.deephaven.util.channel
Class BaseSeekableChannelContext
java.lang.Object
io.deephaven.util.channel.BaseSeekableChannelContext
- All Implemented Interfaces:
SeekableChannelContext,SafeCloseable,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.util.channel.SeekableChannelContext
SeekableChannelContext.ContextHolder -
Field Summary
Fields inherited from interface io.deephaven.util.channel.SeekableChannelContext
NULL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release any resources associated with this context.final <T extends SafeCloseable>
TgetCachedResource(String key, @NotNull Supplier<T> resourceFactory) If this instance holds a resource corresponding to the given key, return it.
-
Constructor Details
-
BaseSeekableChannelContext
public BaseSeekableChannelContext()
-
-
Method Details
-
getCachedResource
@Nullable public final <T extends SafeCloseable> T getCachedResource(String key, @NotNull @NotNull Supplier<T> resourceFactory) Description copied from interface:SeekableChannelContextIf this instance holds a resource corresponding to the given key, return it. Otherwise, use the resource factory to create a new resource, store it, and return it. This method can return anullif the factory returns anull.- Specified by:
getCachedResourcein interfaceSeekableChannelContext
-
close
@OverridingMethodsMustInvokeSuper public void close()Description copied from interface:SeekableChannelContextRelease any resources associated with this context. The context should not be used afterward.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable- Specified by:
closein interfaceSeekableChannelContext
-