| |
|
| java.lang.Object java.lang.Thread org.apache.catalina.cluster.tcp.WorkerThread org.apache.catalina.cluster.tcp.TcpReplicationThread
TcpReplicationThread | public class TcpReplicationThread extends WorkerThread (Code) | | A worker thread class which can drain channels and echo-back
the input. Each instance is constructed with a reference to
the owning thread pool object. When started, the thread loops
forever waiting to be awakened to service the channel associated
with a SelectionKey object.
The worker is tasked by calling its serviceChannel() method
with a SelectionKey object. The serviceChannel() method stores
the key reference in the thread object then calls notify()
to wake it up. When the channel has been drained, the worker
thread returns itself to its parent pool.
|
Method Summary | |
public synchronized void | run() | synchronized void | serviceChannel(SelectionKey key, boolean synchronous) Called to initiate a unit of work by this worker thread
on the provided SelectionKey object. |
TcpReplicationThread | TcpReplicationThread()(Code) | | |
run | public synchronized void run()(Code) | | |
serviceChannel | synchronized void serviceChannel(SelectionKey key, boolean synchronous)(Code) | | Called to initiate a unit of work by this worker thread
on the provided SelectionKey object. This method is
synchronized, as is the run() method, so only one key
can be serviced at a given time.
Before waking the worker thread, and before returning
to the main selection loop, this key's interest set is
updated to remove OP_READ. This will cause the selector
to ignore read-readiness for this channel while the
worker thread is servicing it.
|
|
|
|