org.apache.tomcat.util.net

## Class SocketWrapperBase.OperationState<A>

- java.lang.Object
- - org.apache.tomcat.util.net.SocketWrapperBase.OperationState<A>

- All Implemented Interfaces:
    Runnable
  Enclosing class:
    SocketWrapperBase<E>

      protected abstract class SocketWrapperBase.OperationState<A>
      extends Object
      implements Runnable

  Internal state tracker for vectored operations.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected A` | `attachment`
    `protected SocketWrapperBase.BlockingMode` | `block`
    `protected ByteBuffer[]` | `buffers`
    `protected AtomicBoolean` | `callHandler`
    `protected SocketWrapperBase.CompletionCheck` | `check`
    `protected SocketWrapperBase.VectoredIOCompletionHandler<A>` | `completion`
    `protected boolean` | `completionDone`
    `protected CompletionHandler<Long,? super A>` | `handler`
    `protected int` | `length`
    `protected long` | `nBytes`
    `protected int` | `offset`
    `protected boolean` | `read`
    `protected Semaphore` | `semaphore`
    `protected SocketWrapperBase.CompletionState` | `state`
    `protected long` | `timeout`
    `protected TimeUnit` | `unit`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `OperationState(boolean read, ByteBuffer[] buffers, int offset, int length, SocketWrapperBase.BlockingMode block, long timeout, TimeUnit unit, A attachment, SocketWrapperBase.CompletionCheck check, CompletionHandler<Long,? super A> handler, Semaphore semaphore, SocketWrapperBase.VectoredIOCompletionHandler<A> completion)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `end()` End the operation.
    `protected abstract boolean` | `isInline()`
    `protected boolean` | `process()` Process the operation using the connector executor.
    `protected void` | `start()` Start the operation, this will typically call run.

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

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

    - ### Methods inherited from interface java.lang.Runnable

      `run`

- - ### Field Detail

    - #### read

          protected final boolean read

    - #### buffers

          protected final ByteBuffer[] buffers

    - #### offset

          protected final int offset

    - #### length

          protected final int length

    - #### attachment

          protected final A attachment

    - #### timeout

          protected final long timeout

    - #### unit

          protected final TimeUnit unit

    - #### block

          protected final SocketWrapperBase.BlockingMode block

    - #### check

          protected final SocketWrapperBase.CompletionCheck check

    - #### handler

          protected final CompletionHandler<Long,? super A> handler

    - #### semaphore

          protected final Semaphore semaphore

    - #### completion

          protected final SocketWrapperBase.VectoredIOCompletionHandler<A> completion

    - #### callHandler

          protected final AtomicBoolean callHandler

    - #### nBytes

          protected volatile long nBytes

    - #### state

          protected volatile SocketWrapperBase.CompletionState state

    - #### completionDone

          protected boolean completionDone

  - ### Constructor Detail

    - #### OperationState

          protected OperationState(boolean read,
                                   ByteBuffer[] buffers,
                                   int offset,
                                   int length,
                                   SocketWrapperBase.BlockingMode block,
                                   long timeout,
                                   TimeUnit unit,
                                   A attachment,
                                   SocketWrapperBase.CompletionCheck check,
                                   CompletionHandler<Long,? super A> handler,
                                   Semaphore semaphore,
                                   SocketWrapperBase.VectoredIOCompletionHandler<A> completion)

  - ### Method Detail

    - #### isInline

          protected abstract boolean isInline()

      Returns:
        true if the operation is still inline, false if the operation is running on a thread that is not the original caller

    - #### process

          protected boolean process()

      Process the operation using the connector executor.
      Returns:
        true if the operation was accepted, false if the executor rejected execution

    - #### start

          protected void start()

      Start the operation, this will typically call run.

    - #### end

          protected void end()

      End the operation.

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