Package org.apache.hc.core5.testing.nio
Class IOReactorExecutor<T extends IOReactorService>
java.lang.Object
org.apache.hc.core5.testing.nio.IOReactorExecutor<T>
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
AsyncRequester
,AsyncServer
abstract class IOReactorExecutor<T extends IOReactorService>
extends Object
implements AutoCloseable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IOReactorConfig
private final AtomicReference
<T> private final AtomicReference
<IOReactorExecutor.Status> private final ThreadFactory
-
Constructor Summary
ConstructorsConstructorDescriptionIOReactorExecutor
(IOReactorConfig ioReactorConfig, ThreadFactory workerThreadFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
awaitShutdown
(TimeValue waitTime) void
close()
(package private) abstract T
createIOReactor
(IOEventHandlerFactory ioEventHandlerFactory, IOReactorConfig ioReactorConfig, ThreadFactory threadFactory, Callback<IOSession> sessionShutdownCallback) private T
protected void
execute
(IOEventHandlerFactory ioEventHandlerFactory) void
(package private) T
reactor()
void
-
Field Details
-
ioReactorConfig
-
workerThreadFactory
-
ioReactorRef
-
status
-
-
Constructor Details
-
IOReactorExecutor
IOReactorExecutor(IOReactorConfig ioReactorConfig, ThreadFactory workerThreadFactory)
-
-
Method Details
-
createIOReactor
abstract T createIOReactor(IOEventHandlerFactory ioEventHandlerFactory, IOReactorConfig ioReactorConfig, ThreadFactory threadFactory, Callback<IOSession> sessionShutdownCallback) throws IOException - Throws:
IOException
-
execute
- Throws:
IOException
-
ensureRunning
-
reactor
T reactor() -
getStatus
-
awaitShutdown
- Throws:
InterruptedException
-
initiateShutdown
public void initiateShutdown() -
shutdown
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-