AbstractProcessorLight (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.coyote, class: AbstractProcessorLight

# Class AbstractProcessorLight

java.lang.Object
org.apache.coyote.AbstractProcessorLight

All Implemented Interfaces:
  `Processor`

Direct Known Subclasses:
  `AbstractProcessor, UpgradeProcessorBase`

public abstract class AbstractProcessorLight extends Object implements Processor
This is a light-weight abstract processor implementation that is intended as a basis for all Processor implementations from the light-weight upgrade processors to the HTTP/AJP processors.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractProcessorLight()`
  Constructs a new processor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addDispatch(DispatchType dispatchType)`
  Adds a dispatch type to the set of dispatches to be processed.
  `protected abstract AbstractEndpoint.Handler.SocketState`
  `asyncPostProcess()`
  Calls the post process of the async state machine.
  `protected void`
  `clearDispatches()`
  Clears the set of dispatches to be processed.
  `protected abstract AbstractEndpoint.Handler.SocketState`
  `dispatch(SocketEvent status)`
  Process an in-progress request that is no longer in standard HTTP mode.
  `Iterator<DispatchType>`
  `getIteratorAndClearDispatches()`
  Returns an iterator over the dispatches and clears the set.
  `protected abstract Log`
  `getLog()`
  Returns the logger associated with this processor type.
  `protected void`
  `logAccess(SocketWrapperBase<?> socketWrapper)`
  Add an entry to the access log for a failed connection attempt.
  `AbstractEndpoint.Handler.SocketState`
  `process(SocketWrapperBase<?> socketWrapper, SocketEvent status)`
  Process a connection.
  `protected abstract AbstractEndpoint.Handler.SocketState`
  `service(SocketWrapperBase<?> socketWrapper)`
  Service a 'standard' HTTP request.

  ### Methods inherited from class Object

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

  ### Methods inherited from interface Processor

  `checkAsyncTimeoutGeneration, getLeftoverInput, getRequest, getUpgradeToken, isAsync, isUpgrade, pause, recycle, setSslSupport, timeoutAsync`

- ## Constructor Details

  - ### AbstractProcessorLight

    public AbstractProcessorLight()
    Constructs a new processor.

- ## Method Details

  - ### process

    public AbstractEndpoint.Handler.SocketState process(SocketWrapperBase<?> socketWrapper, SocketEvent status) throws IOException
    Description copied from interface: `Processor`
    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.
    Specified by:
      `process` in interface `Processor`
    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

  - ### addDispatch

    public void addDispatch(DispatchType dispatchType)
    Adds a dispatch type to the set of dispatches to be processed.
    Parameters:
      `dispatchType` - The dispatch type to add

  - ### getIteratorAndClearDispatches

    public Iterator<DispatchType> getIteratorAndClearDispatches()
    Returns an iterator over the dispatches and clears the set.
    Returns:
      an iterator over the dispatches, or `null` if there are no dispatches

  - ### clearDispatches

    protected void clearDispatches()
    Clears the set of dispatches to be processed.

  - ### logAccess

    protected void logAccess(SocketWrapperBase<?> socketWrapper) throws IOException
    Add an entry to the access log for a failed connection attempt.
    Parameters:
      `socketWrapper` - The connection to process
    Throws:
      `IOException` - If an I/O error occurs during the processing of the request

  - ### service

    protected abstract AbstractEndpoint.Handler.SocketState service(SocketWrapperBase<?> socketWrapper) throws IOException
    Service a 'standard' HTTP request. This method is called for both new requests and for requests that have partially read the HTTP request line or HTTP headers. Once the headers have been fully read this method is not called again until there is a new HTTP request to process. Note that the request type may change during processing which may result in one or more calls to `dispatch(SocketEvent)`. Requests may be pipe-lined.
    Parameters:
      `socketWrapper` - The connection to process
    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

  - ### dispatch

    protected abstract AbstractEndpoint.Handler.SocketState dispatch(SocketEvent status) throws IOException
    Process an in-progress request that is no longer in standard HTTP mode. Uses currently include Servlet 3.0 Async and HTTP upgrade connections. Further uses may be added in the future. These will typically start as HTTP requests.
    Parameters:
      `status` - The event to process
    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

  - ### asyncPostProcess

    protected abstract AbstractEndpoint.Handler.SocketState asyncPostProcess() throws IOException
    Calls the post process of the async state machine.
    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

  - ### getLog

    protected abstract Log getLog()
    Returns the logger associated with this processor type.
    Returns:
      the logger associated with this processor type