C - AbstractOioChannelabstract class AbstractOioWorker<C extends AbstractOioChannel> extends java.lang.Object implements Worker
| Modifier and Type | Field and Description |
|---|---|
protected C |
channel |
private boolean |
done |
private java.util.Queue<java.lang.Runnable> |
eventQueue |
protected java.lang.Thread |
thread
If this worker has been started thread will be a reference to the thread
used when starting.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOioWorker(C channel) |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
close(AbstractOioChannel channel,
ChannelFuture future) |
private static void |
close(AbstractOioChannel channel,
ChannelFuture future,
boolean iothread) |
void |
executeInIoThread(java.lang.Runnable task)
Execute the given
Runnable in the IO-Thread. |
(package private) static boolean |
isIoThread(AbstractOioChannel channel) |
(package private) abstract boolean |
process()
Process the incoming messages and also is responsible for call
Channels.fireMessageReceived(Channel, Object) once a message was processed without
errors. |
private void |
processEventQueue() |
void |
run() |
(package private) static void |
setInterestOps(AbstractOioChannel channel,
ChannelFuture future,
int interestOps) |
private final java.util.Queue<java.lang.Runnable> eventQueue
protected final C extends AbstractOioChannel channel
protected volatile java.lang.Thread thread
private volatile boolean done
protected AbstractOioWorker(C channel)
public void run()
run in interface java.lang.Runnablestatic boolean isIoThread(AbstractOioChannel channel)
public void executeInIoThread(java.lang.Runnable task)
WorkerRunnable in the IO-Thread. This may be now or
later once the IO-Thread do some other work.executeInIoThread in interface Workertask - the Runnable to executeprivate void processEventQueue()
abstract boolean process()
throws java.io.IOException
Channels.fireMessageReceived(Channel, Object) once a message was processed without
errors.true as long as this worker should continue to try
processing incoming messagesjava.io.IOExceptionstatic void setInterestOps(AbstractOioChannel channel, ChannelFuture future, int interestOps)
static void close(AbstractOioChannel channel, ChannelFuture future)
private static void close(AbstractOioChannel channel, ChannelFuture future, boolean iothread)