Nio2Endpoint.Nio2Acceptor (Apache Tomcat 9.0.68 API Documentation)

Package org.apache.tomcat.util.net

## Class Nio2Endpoint.Nio2Acceptor

- java.lang.Object
- - org.apache.tomcat.util.net.Acceptor<java.nio.channels.AsynchronousSocketChannel>
  - - org.apache.tomcat.util.net.Nio2Endpoint.Nio2Acceptor

- All Implemented Interfaces:
    `java.lang.Runnable`, `java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,​java.lang.Void>`
  Enclosing class:
    Nio2Endpoint

      protected class Nio2Endpoint.Nio2Acceptor
      extends Acceptor<java.nio.channels.AsynchronousSocketChannel>
      implements java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,​java.lang.Void>

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.tomcat.util.net.Acceptor

      `Acceptor.AcceptorState`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected int` | `errorDelay` |

    - ### Fields inherited from class org.apache.tomcat.util.net.Acceptor

      `state`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Nio2Acceptor​(AbstractEndpoint<?,​java.nio.channels.AsynchronousSocketChannel> endpoint)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `completed​(java.nio.channels.AsynchronousSocketChannel socket, java.lang.Void attachment)` |
    `void` | `failed​(java.lang.Throwable t, java.lang.Void attachment)` |
    `void` | `run()` |
    `void` | `stop​(int waitSeconds)` | Signals the Acceptor to stop.

    - ### Methods inherited from class org.apache.tomcat.util.net.Acceptor

      `getState, handleExceptionWithDelay, stop`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### errorDelay

          protected int errorDelay

  - ### Constructor Detail

    - #### Nio2Acceptor

          public Nio2Acceptor​(AbstractEndpoint<?,​java.nio.channels.AsynchronousSocketChannel> endpoint)

  - ### Method Detail

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`
      Overrides:
        `run` in class `Acceptor<java.nio.channels.AsynchronousSocketChannel>`

    - #### stop

          public void stop​(int waitSeconds)

      Signals the Acceptor to stop.
      Overrides:
        `stop` in class `Acceptor<java.nio.channels.AsynchronousSocketChannel>`
      Parameters:
        `waitSeconds` - Ignored for NIO2.

    - #### completed

          public void completed​(java.nio.channels.AsynchronousSocketChannel socket,
                                java.lang.Void attachment)

      Specified by:
        `completed` in interface `java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,​java.lang.Void>`

    - #### failed

          public void failed​(java.lang.Throwable t,
                             java.lang.Void attachment)

      Specified by:
        `failed` in interface `java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,​java.lang.Void>`