Package 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 Description protected Aattachmentprotected SocketWrapperBase.BlockingModeblockprotected ByteBuffer[]buffersprotected AtomicBooleancallHandlerprotected SocketWrapperBase.CompletionCheckcheckprotected SocketWrapperBase.VectoredIOCompletionHandler<A>completionprotected booleancompletionDoneprotected CompletionHandler<Long,? super A>handlerprotected intlengthprotected longnBytesprotected intoffsetprotected booleanreadprotected Semaphoresemaphoreprotected SocketWrapperBase.CompletionStatestateprotected longtimeoutprotected TimeUnitunit
-
Constructor Summary
Constructors Modifier Constructor Description protectedOperationState(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 Description protected voidend()End the operation.protected booleanhasOutboundRemaining()protected abstract booleanisInline()protected booleanprocess()Process the operation using the connector executor.protected voidstart()Start the operation, this will typically call 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
-
hasOutboundRemaining
protected boolean hasOutboundRemaining()
-
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.
-
-