Top Description Methods
org.apache.coyote

public Interface Processor

Known Direct Implementers
org.apache.coyote.AbstractProcessorLight
Imports
java.io.IOException, java.nio.ByteBuffer, org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState, .SSLSupport, .SocketEvent, .SocketWrapperBase

Common interface for processors of all protocols.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true If the async generation has not changed since the async timeout was triggered
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

Returns:

leftover bytes
getLeftoverInput
()

Allows retrieving additional input during the upgrade process.

public Request

Returns:

The request associated with this processor.
getRequest
()

public UpgradeToken

Returns:

An upgrade token encapsulating the information required to process the upgrade request
getUpgradeToken
()

Generate an upgrade token.

public boolean
public boolean

Returns:

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

public void
pause()

Informs the processor that the underlying I/O layer has stopped accepting new connections.

public AbstractEndpoint.Handler.SocketState

Returns:

The state the caller should put the socket in when this method returns
process
(SocketWrapperBase<?>
The connection to process
socketWrapper
,
SocketEvent
The status of the connection that triggered this additional processing
status
)

Process a connection.

public void
recycle()

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

public void
setSslSupport(SSLSupport
The SSL support object to use for this connection
sslSupport
)

Set the SSL information for this HTTP connection.

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
)

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

Method Detail

checkAsyncTimeoutGenerationback to summary
public boolean 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

getLeftoverInputback to summary
public ByteBuffer getLeftoverInput()

Allows retrieving additional input during the upgrade process.

Returns:ByteBuffer

leftover bytes

Exceptions
IllegalStateException:
if this is called on a Processor that does not support upgrading
getRequestback to summary
public Request getRequest()
Returns:Request

The request associated with this processor.

getUpgradeTokenback to summary
public UpgradeToken getUpgradeToken()

Generate an upgrade token.

Returns:UpgradeToken

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

Exceptions
IllegalStateException:
if this is called on a Processor that does not support upgrading
isAsyncback to summary
public boolean isAsync()
isUpgradeback to summary
public boolean isUpgrade()
Returns:boolean

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

pauseback to summary
public 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.

processback to summary
public 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:SocketWrapperBase<?>

The connection to process

status:SocketEvent

The status of the connection that triggered this additional processing

Returns:AbstractEndpoint.Handler.SocketState

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

Exceptions
IOException:
If an I/O error occurs during the processing of the request
recycleback to summary
public void recycle()

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

setSslSupportback to summary
public void setSslSupport(SSLSupport sslSupport)

Set the SSL information for this HTTP connection.

Parameters
sslSupport:SSLSupport

The SSL support object to use for this connection

timeoutAsyncback to summary
public void timeoutAsync(long now)

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.