public abstract class AbstractIOReactor extends Object implements IOReactor
IOReactor that can used as a subclass
for more specialized I/O reactors. It is based on a single Selector
instance.| Constructor and Description |
|---|
AbstractIOReactor(long selectTimeout)
Creates new AbstractIOReactor instance.
|
AbstractIOReactor(long selectTimeout,
boolean interestOpsQueueing)
Creates new AbstractIOReactor instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChannel(ChannelEntry channelEntry)
Adds new channel entry.
|
void |
awaitShutdown(long timeout)
Blocks for the given period of time in milliseconds awaiting
the completion of the reactor shutdown.
|
boolean |
getInterestOpsQueueing()
Returns
true if interest Ops queueing is enabled, false otherwise. |
IOReactorStatus |
getStatus()
Returns the current status of the reactor.
|
void |
gracefulShutdown()
Attempts graceful shutdown of this I/O reactor.
|
void |
hardShutdown()
Attempts force-shutdown of this I/O reactor.
|
void |
shutdown()
Initiates shutdown of the reactor and blocks for a default period of
time waiting for the reactor to terminate all active connections, to shut
down itself and to release system resources it currently holds.
|
void |
shutdown(long gracePeriod)
Initiates shutdown of the reactor and blocks approximately for the given
period of time in milliseconds waiting for the reactor to terminate all
active connections, to shut down itself and to release system resources
it currently holds.
|
public AbstractIOReactor(long selectTimeout)
throws IOReactorException
selectTimeout - the select timeout.IOReactorException - in case if a non-recoverable I/O error.public AbstractIOReactor(long selectTimeout,
boolean interestOpsQueueing)
throws IOReactorException
selectTimeout - the select timeout.interestOpsQueueing - Ops queueing flag.IOReactorException - in case if a non-recoverable I/O error.public IOReactorStatus getStatus()
IOReactorpublic boolean getInterestOpsQueueing()
true if interest Ops queueing is enabled, false otherwise.public void addChannel(ChannelEntry channelEntry)
channelEntry - the channel entry.public void gracefulShutdown()
public void hardShutdown()
throws IOReactorException
IOReactorExceptionpublic void awaitShutdown(long timeout)
throws InterruptedException
timeout - the maximum wait time.InterruptedException - if interrupted.public void shutdown(long gracePeriod)
throws IOReactorException
IOReactorshutdown in interface IOReactorgracePeriod - wait time in milliseconds.IOReactorExceptionpublic void shutdown()
throws IOReactorException
IOReactorshutdown in interface IOReactorIOReactorExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved