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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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:SeekableChannelContext
If 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 anull
if the factory returns anull
.- Specified by:
getCachedResource
in interfaceSeekableChannelContext
-
close
@OverridingMethodsMustInvokeSuper public void close()Description copied from interface:SeekableChannelContext
Release any resources associated with this context. The context should not be used afterward.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
- Specified by:
close
in interfaceSeekableChannelContext
-