public abstract class AbstractProcessor extends AbstractProcessorLight implements ActionHook
Modifier and Type | Field and Description |
---|---|
protected Adapter |
adapter |
protected org.apache.coyote.AsyncStateMachine |
asyncStateMachine |
protected Request |
request |
protected Response |
response |
protected SocketWrapperBase<?> |
socketWrapper |
protected SSLSupport |
sslSupport |
protected UserDataHelper |
userDataHelper |
Modifier | Constructor and Description |
---|---|
|
AbstractProcessor(Adapter adapter) |
protected |
AbstractProcessor(Adapter adapter,
Request coyoteRequest,
Response coyoteResponse) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
ack() |
void |
action(ActionCode actionCode,
java.lang.Object param)
Send an action to the connector.
|
AbstractEndpoint.Handler.SocketState |
asyncPostProcess() |
protected abstract int |
available(boolean doRead) |
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.
|
protected abstract void |
disableSwallowRequest() |
AbstractEndpoint.Handler.SocketState |
dispatch(SocketEvent status)
Process an in-progress request that is not longer in standard HTTP mode.
|
protected abstract AbstractEndpoint.Handler.SocketState |
dispatchEndRequest()
Perform any necessary clean-up processing if the dispatch resulted in the
completion of processing for the current request.
|
protected void |
dispatchNonBlockingRead()
Perform any necessary processing for a non-blocking read before
dispatching to the adapter.
|
protected void |
doHttpUpgrade(UpgradeToken upgradeToken)
Process an HTTP upgrade.
|
protected void |
doPush(Request pushTarget)
Process a push.
|
protected void |
execute(java.lang.Runnable runnable)
Provides a mechanism to trigger processing on a container thread.
|
protected void |
executeDispatches() |
protected abstract void |
finishResponse() |
protected abstract void |
flush() |
protected abstract boolean |
flushBufferedWrite()
Flush any pending writes.
|
Adapter |
getAdapter()
Get the associated adapter.
|
long |
getAsyncTimeout() |
protected java.lang.Object |
getConnectionID()
Protocols that support multiplexing (e.g.
|
protected ErrorState |
getErrorState() |
java.nio.ByteBuffer |
getLeftoverInput()
Allows retrieving additional input during the upgrade process.
|
protected boolean |
getPopulateRequestAttributesFromSocket()
Processors that populate request attributes directly (e.g.
|
Request |
getRequest() |
protected SocketWrapperBase<?> |
getSocketWrapper() |
protected java.lang.Object |
getStreamID()
Protocols that support multiplexing (e.g.
|
UpgradeToken |
getUpgradeToken()
Generate an upgrade token.
|
boolean |
isAsync() |
protected boolean |
isPushSupported()
Protocols that support push should override this method and return
true . |
protected abstract boolean |
isReady() |
protected abstract boolean |
isRequestBodyFullyRead() |
protected abstract boolean |
isTrailerFieldsReady() |
protected boolean |
isTrailerFieldsSupported()
Protocols that support trailer fields should override this method and
return
true . |
boolean |
isUpgrade()
Processors that implement HTTP upgrade must override this method.
|
protected void |
parseHost(MessageBytes valueMB) |
protected void |
populateHost()
Called when a host name is not present in the request (e.g.
|
protected void |
populateRequestAttributeRemoteHost()
Populate the remote host request attribute.
|
protected void |
populateSslRequestAttributes()
Populate the TLS related request attributes from the
SSLSupport
instance associated with this processor. |
protected abstract void |
prepareResponse() |
protected void |
processSocketEvent(SocketEvent event,
boolean dispatch) |
void |
recycle()
Recycle the processor, ready for the next request which may be on the
same connection or a different connection.
|
protected abstract void |
registerReadInterest() |
void |
setAsyncTimeout(long timeout) |
protected void |
setErrorState(ErrorState errorState,
java.lang.Throwable t)
Update the current error state to the new error state if the new error
state is more severe than the current error state.
|
protected abstract void |
setRequestBody(ByteChunk body) |
protected void |
setSocketWrapper(SocketWrapperBase<?> socketWrapper)
Set the socket wrapper being used.
|
void |
setSslSupport(SSLSupport sslSupport)
Set the SSL information for this HTTP connection.
|
protected abstract void |
setSwallowResponse() |
protected void |
sslReHandShake()
Processors that can perform a TLS re-handshake (e.g.
|
void |
timeoutAsync(long now)
Check this processor to see if the async timeout has expired and process
a timeout if that is that case.
|
addDispatch, clearDispatches, getIteratorAndClearDispatches, getLog, process, service
protected final Adapter adapter
protected final org.apache.coyote.AsyncStateMachine asyncStateMachine
protected final Request request
protected final Response response
protected volatile SocketWrapperBase<?> socketWrapper
protected volatile SSLSupport sslSupport
protected final UserDataHelper userDataHelper
public AbstractProcessor(Adapter adapter)
protected void setErrorState(ErrorState errorState, java.lang.Throwable t)
errorState
- The error status detailst
- The error which occurredprotected ErrorState getErrorState()
public Request getRequest()
getRequest
in interface Processor
public Adapter getAdapter()
protected final void setSocketWrapper(SocketWrapperBase<?> socketWrapper)
socketWrapper
- The socket wrapperprotected final SocketWrapperBase<?> getSocketWrapper()
public final void setSslSupport(SSLSupport sslSupport)
Processor
setSslSupport
in interface Processor
sslSupport
- The SSL support object to use for this connectionprotected void execute(java.lang.Runnable runnable)
runnable
- The task representing the processing that needs to take
place on a container threadpublic AbstractEndpoint.Handler.SocketState asyncPostProcess()
asyncPostProcess
in class AbstractProcessorLight
public final AbstractEndpoint.Handler.SocketState dispatch(SocketEvent status)
AbstractProcessorLight
dispatch
in class AbstractProcessorLight
status
- The event to processprotected void parseHost(MessageBytes valueMB)
protected void populateHost()
The default implementation is a NO-OP.
public final void action(ActionCode actionCode, java.lang.Object param)
ActionHook
action
in interface ActionHook
actionCode
- Type of the actionparam
- Action parameterprotected void dispatchNonBlockingRead()
public void timeoutAsync(long now)
Processor
timeoutAsync
in interface Processor
now
- The time (as returned by System.currentTimeMillis()
to
use as the current time to determine whether the async timeout
has expired. If negative, the timeout will always be treated
as if it has expired.public boolean checkAsyncTimeoutGeneration()
Processor
checkAsyncTimeoutGeneration
in interface Processor
true
If the async generation has not changed since the
async timeout was triggeredpublic void setAsyncTimeout(long timeout)
public long getAsyncTimeout()
public void recycle()
Processor
protected abstract void prepareResponse() throws java.io.IOException
java.io.IOException
protected abstract void finishResponse() throws java.io.IOException
java.io.IOException
protected abstract void ack()
protected abstract void flush() throws java.io.IOException
java.io.IOException
protected abstract int available(boolean doRead)
protected abstract void setRequestBody(ByteChunk body)
protected abstract void setSwallowResponse()
protected abstract void disableSwallowRequest()
protected boolean getPopulateRequestAttributesFromSocket()
false
.true
if the SocketWrapper should be used to populate the
request attributes, otherwise false
.protected void populateRequestAttributeRemoteHost()
protected void populateSslRequestAttributes()
SSLSupport
instance associated with this processor. Protocols that populate TLS
attributes from a different source (e.g. AJP) should override this
method.protected void sslReHandShake() throws java.io.IOException
java.io.IOException
- If authentication is required then there will be I/O
with the client and this exception will be thrown if
that goes wrongprotected void processSocketEvent(SocketEvent event, boolean dispatch)
protected abstract boolean isRequestBodyFullyRead()
protected abstract void registerReadInterest()
protected abstract boolean isReady()
protected void executeDispatches()
public UpgradeToken getUpgradeToken()
getUpgradeToken
in interface Processor
protected void doHttpUpgrade(UpgradeToken upgradeToken)
upgradeToken
- Contains all the information necessary for the
Processor to process the upgradejava.lang.UnsupportedOperationException
- if the protocol does not support
HTTP upgradepublic java.nio.ByteBuffer getLeftoverInput()
getLeftoverInput
in interface Processor
public boolean isUpgrade()
protected boolean isPushSupported()
true
.true
if push is supported by this processor, otherwise
false
.protected void doPush(Request pushTarget)
pushTarget
- Contains all the information necessary for the Processor
to process the push requestjava.lang.UnsupportedOperationException
- if the protocol does not support
pushprotected abstract boolean isTrailerFieldsReady()
protected boolean isTrailerFieldsSupported()
true
.true
if trailer fields are supported by this processor,
otherwise false
.protected java.lang.Object getConnectionID()
null
if a
multiplexing protocol is not being usedprotected java.lang.Object getStreamID()
null
if a
multiplexing protocol is not being usedprotected abstract boolean flushBufferedWrite() throws java.io.IOException
true
if data remains to be flushed at the end of
methodjava.io.IOException
- If an I/O error occurs while attempting to flush the
dataprotected abstract AbstractEndpoint.Handler.SocketState dispatchEndRequest()
Copyright © 2000-1970 Apache Software Foundation. All Rights Reserved.