public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S>
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractAjpProcessor.SocketInputBuffer
This class is an input buffer which will read its data from an input
stream.
|
protected class |
AbstractAjpProcessor.SocketOutputBuffer
This class is an output buffer which will write data to an output
stream.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
ajpFlush
Send AJP flush packet when flushing.
|
protected MessageBytes |
bodyBytes
Body message.
|
protected AjpMessage |
bodyMessage
Body message.
|
protected long |
bytesWritten
Bytes written to client for the current request.
|
protected MessageBytes |
certificates
Byte chunk for certs.
|
protected java.lang.String |
clientCertProvider
When client certificate information is presented in a form other than
instances of
X509Certificate it needs to be
converted before it can be used and this property controls which JSSE
provider is used to perform the conversion. |
protected boolean |
empty
Request body empty flag.
|
protected static byte[] |
endAndCloseMessageArray |
protected static byte[] |
endMessageArray
End message array.
|
protected boolean |
endOfStream
End of stream flag.
|
protected boolean |
finished
Finished response.
|
protected boolean |
first
First read.
|
protected static byte[] |
flushMessageArray
Flush message array.
|
protected byte[] |
getBodyMessageArray
GetBody message array.
|
protected int |
keepAliveTimeout
The number of milliseconds Tomcat will wait for a subsequent request
before closing the connection.
|
protected static byte[] |
pongMessageArray
Pong message array.
|
protected boolean |
replay
Replay read.
|
protected AjpMessage |
requestHeaderMessage
Header message.
|
protected java.lang.String |
requiredSecret
Required secret.
|
protected AjpMessage |
responseMessage
Message used for response composition.
|
protected static StringManager |
sm
The string manager for this package.
|
protected MessageBytes |
tmpMB
Temp message bytes used for processing.
|
protected boolean |
tomcatAuthentication
Use Tomcat authentication ?
|
adapter, asyncStateMachine, endpoint, hostNameC, request, response, socketWrapper, userDataHelper
Constructor and Description |
---|
AbstractAjpProcessor(int packetSize,
AbstractEndpoint<S> endpoint) |
Modifier and Type | Method and Description |
---|---|
void |
action(ActionCode actionCode,
java.lang.Object param)
Send an action to the connector.
|
AbstractEndpoint.Handler.SocketState |
asyncDispatch(SocketStatus status)
Process in-progress Servlet 3.0 Async requests.
|
AbstractEndpoint.Handler.SocketState |
event(SocketStatus status)
Process in-progress Comet requests.
|
protected void |
finish()
Finish AJP response.
|
protected void |
flush(boolean explicit)
Callback to write data from the buffer.
|
boolean |
getAjpFlush() |
java.lang.String |
getClientCertProvider() |
int |
getKeepAliveTimeout() |
java.nio.ByteBuffer |
getLeftoverInput()
Allows retrieving additional input during the upgrade process
|
boolean |
getTomcatAuthentication() |
boolean |
getTomcatAuthorization() |
UpgradeToken |
getUpgradeToken() |
boolean |
isComet() |
boolean |
isUpgrade() |
protected abstract int |
output(byte[] src,
int offset,
int length,
boolean block) |
protected void |
populateHost()
Called when a host name is not present in the request (e.g.
|
protected void |
prepareRequest()
After reading the request headers, we have to setup the request filters.
|
protected void |
prepareResponse()
When committing the response, we have to validate the set of headers, as
well as setup the response filters.
|
AbstractEndpoint.Handler.SocketState |
process(SocketWrapper<S> socket)
Process pipelined HTTP requests using the specified input and output
streams.
|
protected abstract boolean |
read(byte[] buf,
int pos,
int n,
boolean block)
Read at least the specified amount of bytes, and place them
in the input buffer.
|
protected boolean |
readMessage(AjpMessage message,
boolean block)
Read an AJP message.
|
protected boolean |
receive(boolean block)
Read an AJP body message.
|
void |
recycle(boolean socketClosing)
Recycle the processor, ready for the next request which may be on the
same connection or a different connection.
|
protected boolean |
refillReadBuffer(boolean block)
Get more request body data from the web server and store it in the
internal buffer.
|
protected abstract void |
resetTimeouts()
Provides a mechanism for those connector implementations (currently only
NIO) that need to reset timeouts from Async timeouts to standard HTTP
timeouts once async processing completes.
|
void |
setAjpFlush(boolean ajpFlush) |
void |
setClientCertProvider(java.lang.String s) |
void |
setKeepAliveTimeout(int timeout) |
void |
setRequiredSecret(java.lang.String requiredSecret) |
void |
setSslSupport(SSLSupport sslSupport) |
protected abstract void |
setTimeout(SocketWrapper<S> socketWrapper,
int timeout) |
void |
setTomcatAuthentication(boolean tomcatAuthentication) |
void |
setTomcatAuthorization(boolean tomcatAuthorization) |
protected abstract void |
setupSocket(SocketWrapper<S> socketWrapper) |
AbstractEndpoint.Handler.SocketState |
upgradeDispatch(SocketStatus status)
Processes data received on a connection that has been through an HTTP
upgrade.
|
asyncPostProcess, errorDispatch, getAdapter, getEndpoint, getErrorState, getExecutor, getLog, getMaxCookieCount, getRequest, getSocketWrapper, isAsync, parseHost, registerForEvent, resetErrorState, setAdapter, setErrorState, setMaxCookieCount, setSocketWrapper
protected static final StringManager sm
protected static final byte[] endMessageArray
protected static final byte[] endAndCloseMessageArray
protected static final byte[] flushMessageArray
protected static final byte[] pongMessageArray
protected final byte[] getBodyMessageArray
protected final AjpMessage requestHeaderMessage
protected final AjpMessage responseMessage
protected final AjpMessage bodyMessage
protected final MessageBytes bodyBytes
protected final MessageBytes tmpMB
protected final MessageBytes certificates
protected boolean endOfStream
protected boolean empty
protected boolean first
protected boolean replay
protected boolean finished
protected long bytesWritten
protected boolean ajpFlush
protected int keepAliveTimeout
protected boolean tomcatAuthentication
protected java.lang.String requiredSecret
protected java.lang.String clientCertProvider
X509Certificate
it needs to be
converted before it can be used and this property controls which JSSE
provider is used to perform the conversion. For example it is used with
the AJP connectors, the HTTP APR connector and with the
SSLValve
. If not specified, the
default provider will be used.public AbstractAjpProcessor(int packetSize, AbstractEndpoint<S> endpoint)
public boolean getAjpFlush()
public void setAjpFlush(boolean ajpFlush)
public int getKeepAliveTimeout()
public void setKeepAliveTimeout(int timeout)
public boolean getTomcatAuthentication()
public void setTomcatAuthentication(boolean tomcatAuthentication)
public boolean getTomcatAuthorization()
public void setTomcatAuthorization(boolean tomcatAuthorization)
public void setRequiredSecret(java.lang.String requiredSecret)
public java.lang.String getClientCertProvider()
public void setClientCertProvider(java.lang.String s)
public final void action(ActionCode actionCode, java.lang.Object param)
actionCode
- Type of the actionparam
- Action parameterpublic AbstractEndpoint.Handler.SocketState asyncDispatch(SocketStatus status)
AbstractProcessor
asyncDispatch
in interface Processor<S>
asyncDispatch
in class AbstractProcessor<S>
public AbstractEndpoint.Handler.SocketState process(SocketWrapper<S> socket) throws java.io.IOException
public void setSslSupport(SSLSupport sslSupport)
public AbstractEndpoint.Handler.SocketState event(SocketStatus status) throws java.io.IOException
AbstractProcessor
public AbstractEndpoint.Handler.SocketState upgradeDispatch(SocketStatus status) throws java.io.IOException
AbstractProcessor
upgradeDispatch
in interface Processor<S>
upgradeDispatch
in class AbstractProcessor<S>
java.io.IOException
public UpgradeToken getUpgradeToken()
getUpgradeToken
in interface Processor<S>
getUpgradeToken
in class AbstractProcessor<S>
public void recycle(boolean socketClosing)
socketClosing
- Indicates if the socket is about to be closed
allowing the processor to perform any additional
clean-up that may be requiredprotected abstract void resetTimeouts()
protected abstract int output(byte[] src, int offset, int length, boolean block) throws java.io.IOException
java.io.IOException
protected abstract void setupSocket(SocketWrapper<S> socketWrapper) throws java.io.IOException
java.io.IOException
protected abstract void setTimeout(SocketWrapper<S> socketWrapper, int timeout) throws java.io.IOException
java.io.IOException
protected abstract boolean read(byte[] buf, int pos, int n, boolean block) throws java.io.IOException
buf
- Buffer to read data intopos
- Start positionn
- The minimum number of bytes to readblock
- If there is no data available to read when this method is
called, should this call block until data becomes available?true
if the requested number of bytes were read
else false
java.io.IOException
protected boolean receive(boolean block) throws java.io.IOException
block
- If there is no data available to read when this method is
called, should this call block until data becomes available?true
if at least one body byte was read, otherwise
false
java.io.IOException
protected boolean readMessage(AjpMessage message, boolean block) throws java.io.IOException
message
- The message to populateblock
- If there is no data available to read when this method is
called, should this call block until data becomes available?java.io.IOException
- any other failure, including incomplete readspublic final boolean isComet()
public final boolean isUpgrade()
public java.nio.ByteBuffer getLeftoverInput()
Processor
protected boolean refillReadBuffer(boolean block) throws java.io.IOException
java.io.IOException
protected void prepareRequest()
protected void populateHost()
The default implementation is a NO-OP.
This implementation populates the server name and port from the local name and port provided by the AJP message.
populateHost
in class AbstractProcessor<S>
protected void prepareResponse() throws java.io.IOException
java.io.IOException
protected void flush(boolean explicit) throws java.io.IOException
java.io.IOException
protected void finish() throws java.io.IOException
java.io.IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.