Top Fields Constructors Methods
org.apache.coyote.http11.upgrade

public abstract Class UpgradeProcessorBase

extends AbstractProcessorLight
implements WebConnection
Class Inheritance
All Implemented Interfaces
jakarta.servlet.http.WebConnection, java.lang.AutoCloseable
Known Direct Subclasses
org.apache.coyote.http11.upgrade.UpgradeProcessorExternal, org.apache.coyote.http11.upgrade.UpgradeProcessorInternal
Imports
java.io.IOException, java.nio.ByteBuffer, jakarta.servlet.http.WebConnection, org.apache.coyote.AbstractProcessorLight, .Request, .UpgradeToken, org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState, .SocketWrapperBase

Field Summary

Modifier and TypeField and Description
protected static final int
private final UpgradeToken

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final AbstractEndpoint.Handler.SocketState
public boolean
checkAsyncTimeoutGeneration()

Implements org.apache.coyote.Processor.checkAsyncTimeoutGeneration.

Check to see if the async generation (each cycle of async increments the generation of the AsyncStateMachine) is the same as the generation when the most recent async timeout was triggered.

public ByteBuffer
getLeftoverInput()

Implements org.apache.coyote.Processor.getLeftoverInput.

Allows retrieving additional input during the upgrade process.

public final Request
public UpgradeToken
getUpgradeToken()

Implements org.apache.coyote.Processor.getUpgradeToken.

Generate an upgrade token.

public final boolean
public final boolean
public final void
recycle()

Implements org.apache.coyote.Processor.recycle.

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

public final AbstractEndpoint.Handler.SocketState
service(SocketWrapperBase<?>
The connection to process
socketWrapper
)

Implements abstract org.apache.coyote.AbstractProcessorLight.service.

Service a 'standard' HTTP request.

public void
timeoutAsync(long
The time (as returned by System#currentTimeMillis() to use as the current time to determine whether the timeout has expired. If negative, the timeout will always be treated as ifq it has expired.
now
)

Implements org.apache.coyote.Processor.timeoutAsync.

Check this processor to see if the timeout has expired and process a timeout if that is that case.

Inherited from org.apache.coyote.AbstractProcessorLight:
addDispatchclearDispatchesdispatchgetIteratorAndClearDispatchesgetLoglogAccessprocess

Field Detail

INFINITE_TIMEOUTback to summary
protected static final int INFINITE_TIMEOUT
upgradeTokenback to summary
private final UpgradeToken upgradeToken

Constructor Detail

UpgradeProcessorBaseback to summary
public UpgradeProcessorBase(UpgradeToken upgradeToken)

Method Detail

asyncPostProcessback to summary
public final AbstractEndpoint.Handler.SocketState asyncPostProcess()

Implements abstract org.apache.coyote.AbstractProcessorLight.asyncPostProcess.

Annotations
@Override
checkAsyncTimeoutGenerationback to summary
public boolean checkAsyncTimeoutGeneration()

Implements org.apache.coyote.Processor.checkAsyncTimeoutGeneration.

Doc from org.apache.coyote.Processor.checkAsyncTimeoutGeneration.

Check to see if the async generation (each cycle of async increments the generation of the AsyncStateMachine) is the same as the generation when the most recent async timeout was triggered. This is intended to be used to avoid unnecessary processing.

Returns:boolean

true If the async generation has not changed since the async timeout was triggered

Annotations
@Override
getLeftoverInputback to summary
public ByteBuffer getLeftoverInput()

Implements org.apache.coyote.Processor.getLeftoverInput.

Doc from org.apache.coyote.Processor.getLeftoverInput.

Allows retrieving additional input during the upgrade process.

Returns:ByteBuffer

leftover bytes

Annotations
@Override
getRequestback to summary
public final Request getRequest()

Implements org.apache.coyote.Processor.getRequest.

Returns:Request

Doc from org.apache.coyote.Processor.getRequest.

The request associated with this processor.

Annotations
@Override
getUpgradeTokenback to summary
public UpgradeToken getUpgradeToken()

Implements org.apache.coyote.Processor.getUpgradeToken.

Doc from org.apache.coyote.Processor.getUpgradeToken.

Generate an upgrade token.

Returns:UpgradeToken

An upgrade token encapsulating the information required to process the upgrade request

Annotations
@Override
isAsyncback to summary
public final boolean isAsync()

Implements org.apache.coyote.Processor.isAsync.

Annotations
@Override
isUpgradeback to summary
public final boolean isUpgrade()

Implements org.apache.coyote.Processor.isUpgrade.

Returns:boolean

Doc from org.apache.coyote.Processor.isUpgrade.

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

Annotations
@Override
recycleback to summary
public final void recycle()

Implements org.apache.coyote.Processor.recycle.

Doc from org.apache.coyote.Processor.recycle.

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

Annotations
@Override
serviceback to summary
public final AbstractEndpoint.Handler.SocketState service(SocketWrapperBase<?> socketWrapper) throws IOException

Implements abstract org.apache.coyote.AbstractProcessorLight.service.

Doc from org.apache.coyote.AbstractProcessorLight.service.

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:SocketWrapperBase<?>

The connection to process

Returns:AbstractEndpoint.Handler.SocketState

The state the caller should put the socket in when this method returns

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs during the processing of the request
timeoutAsyncback to summary
public void timeoutAsync(long now)

Implements org.apache.coyote.Processor.timeoutAsync.

Doc from org.apache.coyote.Processor.timeoutAsync.

Check this processor to see if the timeout has expired and process a timeout if that is that case.

Note

The name of this method originated with the Servlet 3.0 asynchronous processing but evolved over time to represent a timeout that is triggered independently of the socket read/write timeouts.

Parameters
now:long

The time (as returned by System#currentTimeMillis() to use as the current time to determine whether the timeout has expired. If negative, the timeout will always be treated as ifq it has expired.

Annotations
@Override