BioReplicationTask (Apache Tomcat 9.0.117 API Documentation)
Description: declaration: package: org.apache.catalina.tribes.transport.bio, class: BioReplicationTask

# Class BioReplicationTask

java.lang.Object
org.apache.catalina.tribes.transport.AbstractRxTask
org.apache.catalina.tribes.transport.bio.BioReplicationTask

All Implemented Interfaces:
  `Runnable`

@Deprecated public class BioReplicationTask extends AbstractRxTask
Deprecated.
This will be removed in Tomcat 10
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.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected ObjectReader`
  `reader`
  Deprecated.
  `protected static final StringManager`
  `sm`
  Deprecated.
  `protected Socket`
  `socket`
  Deprecated.

  ### Fields inherited from class AbstractRxTask

  `OPTION_DIRECT_BUFFER, useBufferPool`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BioReplicationTask(ListenCallback callback)`
  Deprecated.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Deprecated.
  `protected void`
  `drainSocket()`
  Deprecated.
  The actual code which drains the channel associated with the given key.
  `protected void`
  `execute(ObjectReader reader)`
  Deprecated.
  `void`
  `run()`
  Deprecated.
  `protected void`
  `sendAck(byte[] command)`
  Deprecated.
  Send a reply-acknowledgment (6,2,3)
  `void`
  `serviceSocket(Socket socket, ObjectReader reader)`
  Deprecated.

  ### Methods inherited from class AbstractRxTask

  `getCallback, getOptions, getTaskPool, getUseBufferPool, isDoRun, setCallback, setDoRun, setOptions, setTaskPool, setUseBufferPool`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### sm

    protected static final StringManager sm
    Deprecated.

  - ### socket

    protected Socket socket
    Deprecated.

  - ### reader

    protected ObjectReader reader
    Deprecated.

- ## Constructor Details

  - ### BioReplicationTask

    public BioReplicationTask(ListenCallback callback)
    Deprecated.

- ## Method Details

  - ### run

    public void run()
    Deprecated.

  - ### serviceSocket

    public void serviceSocket(Socket socket, ObjectReader reader)
    Deprecated.

  - ### execute

    protected void execute(ObjectReader reader) throws Exception
    Deprecated.
    Throws:
      `Exception`

  - ### drainSocket

    protected void drainSocket() throws Exception
    Deprecated.
    The actual code which drains the channel associated with the given key. This method assumes the key has been modified prior to invocation to turn off selection interest in OP_READ. When this method completes it re-enables OP_READ and calls wakeup() on the selector so the selector will resume watching this channel.
    Throws:
      `Exception` - IO exception or execute exception

  - ### sendAck

    protected void sendAck(byte[] command)
    Deprecated.
    Send a reply-acknowledgment (6,2,3)
    Parameters:
      `command` - The command to write

  - ### close

    public void close()
    Deprecated.
    Overrides:
      `close` in class `AbstractRxTask`