Package org.apache.coyote.http11.upgrade
Class UpgradeProcessorBase
- java.lang.Object
- 
- org.apache.coyote.AbstractProcessorLight
- 
- org.apache.coyote.http11.upgrade.UpgradeProcessorBase
 
 
- 
- All Implemented Interfaces:
- java.lang.AutoCloseable,- WebConnection,- Processor
 - Direct Known Subclasses:
- UpgradeProcessorExternal,- UpgradeProcessorInternal
 
 public abstract class UpgradeProcessorBase extends AbstractProcessorLight implements WebConnection 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static intINFINITE_TIMEOUT
 - 
Constructor SummaryConstructors Constructor Description UpgradeProcessorBase(UpgradeToken upgradeToken)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractEndpoint.Handler.SocketStateasyncPostProcess()booleancheckAsyncTimeoutGeneration()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.java.nio.ByteBuffergetLeftoverInput()Allows retrieving additional input during the upgrade process.RequestgetRequest()UpgradeTokengetUpgradeToken()Generate an upgrade token.booleanisAsync()booleanisUpgrade()voidrecycle()Recycle the processor, ready for the next request which may be on the same connection or a different connection.AbstractEndpoint.Handler.SocketStateservice(SocketWrapperBase<?> socketWrapper)Service a 'standard' HTTP request.voidtimeoutAsync(long now)Check this processor to see if the timeout has expired and process a timeout if that is that case.- 
Methods inherited from class org.apache.coyote.AbstractProcessorLightaddDispatch, clearDispatches, dispatch, getIteratorAndClearDispatches, getLog, logAccess, process
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.coyote.Processorpause, setSslSupport
 - 
Methods inherited from interface javax.servlet.http.WebConnectiongetInputStream, getOutputStream
 
- 
 
- 
- 
- 
Field Detail- 
INFINITE_TIMEOUTprotected static final int INFINITE_TIMEOUT - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
UpgradeProcessorBasepublic UpgradeProcessorBase(UpgradeToken upgradeToken) 
 
- 
 - 
Method Detail- 
isUpgradepublic final boolean isUpgrade() 
 - 
getUpgradeTokenpublic UpgradeToken getUpgradeToken() Description copied from interface:ProcessorGenerate an upgrade token.- Specified by:
- getUpgradeTokenin interface- Processor
- Returns:
- An upgrade token encapsulating the information required to process the upgrade request
 
 - 
recyclepublic final void recycle() Description copied from interface:ProcessorRecycle the processor, ready for the next request which may be on the same connection or a different connection.
 - 
servicepublic final AbstractEndpoint.Handler.SocketState service(SocketWrapperBase<?> socketWrapper) throws java.io.IOException Description copied from class:AbstractProcessorLightService 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 toAbstractProcessorLight.dispatch(SocketEvent). Requests may be pipe-lined.- Specified by:
- servicein class- AbstractProcessorLight
- Parameters:
- socketWrapper- The connection to process
- Returns:
- The state the caller should put the socket in when this method returns
- Throws:
- java.io.IOException- If an I/O error occurs during the processing of the request
 
 - 
asyncPostProcesspublic final AbstractEndpoint.Handler.SocketState asyncPostProcess() - Specified by:
- asyncPostProcessin class- AbstractProcessorLight
 
 - 
getRequestpublic final Request getRequest() - Specified by:
- getRequestin interface- Processor
- Returns:
- The request associated with this processor.
 
 - 
getLeftoverInputpublic java.nio.ByteBuffer getLeftoverInput() Description copied from interface:ProcessorAllows retrieving additional input during the upgrade process.- Specified by:
- getLeftoverInputin interface- Processor
- Returns:
- leftover bytes
 
 - 
checkAsyncTimeoutGenerationpublic boolean checkAsyncTimeoutGeneration() Description copied from interface:ProcessorCheck 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.- Specified by:
- checkAsyncTimeoutGenerationin interface- Processor
- Returns:
- trueIf the async generation has not changed since the async timeout was triggered
 
 - 
timeoutAsyncpublic void timeoutAsync(long now) Description copied from interface:ProcessorCheck 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. - Specified by:
- timeoutAsyncin interface- Processor
- Parameters:
- now- 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.
 
 
- 
 
-