Processor (Apache Tomcat 8.5.20 API Documentation)

org.apache.coyote

## Interface Processor

- All Known Implementing Classes:
    AbstractProcessor, AbstractProcessorLight, AjpProcessor, Http11Processor, UpgradeProcessorBase, UpgradeProcessorExternal, UpgradeProcessorInternal

      public interface Processor

  Common interface for processors of all protocols.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ByteBuffer` | `getLeftoverInput()` Allows retrieving additional input during the upgrade process.
    `Request` | `getRequest()`
    `UpgradeToken` | `getUpgradeToken()` Generate an upgrade token.
    `boolean` | `isAsync()`
    `boolean` | `isUpgrade()`
    `void` | `pause()` Informs the processor that the underlying I/O layer has stopped accepting new connections.
    `AbstractEndpoint.Handler.SocketState` | `process(SocketWrapperBase<?> socketWrapper, SocketEvent status)` Process a connection.
    `void` | `recycle()` Recycle the processor, ready for the next request which may be on the same connection or a different connection.
    `void` | `setSslSupport(SSLSupport sslSupport)` Set the SSL information for this HTTP connection.
    `void` | `timeoutAsync(long now)` Check this processor to see if the async timeout has expired and process a timeout if that is that case.

- - ### Method Detail

    - #### process

          AbstractEndpoint.Handler.SocketState process(SocketWrapperBase<?> socketWrapper,
                                                     SocketEvent status)
                                                       throws IOException

      Process a connection. This is called whenever an event occurs (e.g. more data arrives) that allows processing to continue for a connection that is not currently being processed.
      Parameters:
        `socketWrapper` - The connection to process
        `status` - The status of the connection that triggered this additional processing
      Returns:
        The state the caller should put the socket in when this method returns
      Throws:
        `IOException` - If an I/O error occurs during the processing of the request

    - #### getUpgradeToken

          UpgradeToken getUpgradeToken()

      Generate an upgrade token.
      Returns:
        An upgrade token encapsulating the information required to process the upgrade request
      Throws:
        `IllegalStateException` - if this is called on a Processor that does not support upgrading

    - #### isUpgrade

          boolean isUpgrade()

      Returns:
        `true` if the Processor is currently processing an upgrade request, otherwise `false`

    - #### isAsync

          boolean isAsync()

    - #### timeoutAsync

          void timeoutAsync(long now)

      Check this processor to see if the async timeout has expired and process a timeout if that is that case.
      Parameters:
        `now` - The time (as returned by `System.currentTimeMillis()` to use as the current time to determine whether the async timeout has expired. If negative, the timeout will always be treated as if it has expired.

    - #### getRequest

          Request getRequest()

      Returns:
        The request associated with this processor.

    - #### recycle

          void recycle()

      Recycle the processor, ready for the next request which may be on the same connection or a different connection.

    - #### setSslSupport

          void setSslSupport(SSLSupport sslSupport)

      Set the SSL information for this HTTP connection.
      Parameters:
        `sslSupport` - The SSL support object to use for this connection

    - #### getLeftoverInput

          ByteBuffer getLeftoverInput()

      Allows retrieving additional input during the upgrade process.
      Returns:
        leftover bytes
      Throws:
        `IllegalStateException` - if this is called on a Processor that does not support upgrading

    - #### pause

          void pause()

      Informs the processor that the underlying I/O layer has stopped accepting new connections. This is primarily intended to enable processors that use multiplexed connections to prevent further 'streams' being added to an existing multiplexed connection.

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.