Package io.deephaven.util.channel
Class BaseSeekableChannelContext
java.lang.Object
io.deephaven.util.channel.BaseSeekableChannelContext
- All Implemented Interfaces:
SeekableChannelContext
,SafeCloseable
,AutoCloseable
,Function<Supplier<SafeCloseable>,
SafeCloseable>
-
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 TypeMethodDescriptionfinal @Nullable SafeCloseable
apply
(@NotNull Supplier<SafeCloseable> resourceFactory) If this instance holds a resource, return it.void
close()
Release any resources associated with this context.
-
Constructor Details
-
BaseSeekableChannelContext
public BaseSeekableChannelContext()
-
-
Method Details
-
apply
@Nullable public final @Nullable SafeCloseable apply(@NotNull @NotNull Supplier<SafeCloseable> resourceFactory) Description copied from interface:SeekableChannelContext
If this instance holds a resource, 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:
apply
in interfaceFunction<Supplier<SafeCloseable>,
SafeCloseable> - Specified by:
apply
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
-