Class ReopeningInterruptibleChannel<T extends InterruptibleChannel>
java.lang.Object
org.terracotta.offheapstore.util.ReopeningInterruptibleChannel<T>
- All Implemented Interfaces:
Closeable, AutoCloseable, Channel, InterruptibleChannel
public final class ReopeningInterruptibleChannel<T extends InterruptibleChannel>
extends Object
implements InterruptibleChannel
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicReference<T> private static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static <T extends InterruptibleChannel>
ReopeningInterruptibleChannel<T> <R> Rexecute(ReopeningInterruptibleChannel.IoOperation<T, R> operation) booleanisOpen()
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
channelFactory
-
currentChannel
-
-
Constructor Details
-
ReopeningInterruptibleChannel
-
-
Method Details
-
create
public static <T extends InterruptibleChannel> ReopeningInterruptibleChannel<T> create(Supplier<T> channelFactory) -
execute
- Throws:
IOException
-
isOpen
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceInterruptibleChannel- Throws:
IOException
-