| java.lang.Object org.apache.ajp.AjpHandler org.apache.ajp.RequestHandler
RequestHandler | public class RequestHandler extends AjpHandler (Code) | | Handle messages related with basic request information.
This object can handle the following incoming messages:
- "FORWARD_REQUEST" input message ( sent when a request is passed from the web server )
- "PING REQUEST" input message (sent by the web server to determine if tomcat is not frozen,
a PONG REPLY will be sent back)
- "RECEIVE_BODY_CHUNK" input ( sent by container to pass more body, in response to GET_BODY_CHUNK )
It can handle the following outgoing messages:
- SEND_HEADERS. Pass the status code and headers.
- SEND_BODY_CHUNK. Send a chunk of body
- GET_BODY_CHUNK. Request a chunk of body data
- END_RESPONSE. Notify the end of a request processing.
author: Henri Gomez [hgomez@apache.org] author: Dan Milstein [danmil@shore.net] author: Keith Wannamaker [Keith@Wannamaker.org] author: Costin Manolache |
Method Summary | |
public int | available(Ajp13 ch) | public void | beginSendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, String statusMessage, int numHeaders) | protected int | decodeRequest(Ajp13 ch, Ajp13Packet msg, BaseRequest req) Parse a FORWARD_REQUEST packet from the web server and store its
properties in the passed-in request object.
Parameters: req - An empty (newly-recycled) request object. Parameters: msg - Holds the packet which has just been sent by the webserver, with its read position just past the packet header (which inthis case includes the prefix code for FORWARD_REQUEST). | public int | doRead(Ajp13 ch) Return the next byte of request body data (to a servlet). | public int | doRead(Ajp13 ch, byte[] b, int off, int len) Store a chunk of request data into the passed-in byte buffer.
Parameters: b - A buffer to fill with data from the request. Parameters: off - The offset in the buffer at which to start filling. Parameters: len - The number of bytes to copy into the buffer. | public void | doWrite(Ajp13 ch, Ajp13Packet outBuf, byte b, int off, int len) Send a chunk of response body data to the web server and on to the
browser. | public void | endSendHeaders(Ajp13 ch, Ajp13Packet outBuf) | public void | finish(Ajp13 ch, Ajp13Packet outBuf) Signal the web server that the servlet has finished handling this
request, and that the connection can be reused. | public int | handleAjpMessage(int type, Ajp13 channel, Ajp13Packet ajp, BaseRequest req) | protected int | headerNameToSc(String name) Translate an HTTP response header name to an integer code if
possible. | public void | init(Ajp13 ajp14) | void | log(String s) | public boolean | refillReadBuffer(Ajp13 ch) Get more request body data from the web server and store it in the
internal buffer.
true if there is more data, false if not. | public int | sendCPong(Ajp13 ch, Ajp13Packet outBuf) | public void | sendHeader(Ajp13Packet outBuf, String name, String value) | public void | sendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, String statusMessage, MimeHeaders headers) Send the HTTP headers back to the web server and on to the browser. | public void | sendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, MimeHeaders headers) Send the HTTP headers back to the web server and on to the browser. | public void | setDebug(int debug) | public void | setLogger(Logger l) |
JK_AJP13_CPING_REQUEST | final public static byte JK_AJP13_CPING_REQUEST(Code) | | |
JK_AJP13_CPONG_REPLY | final public static byte JK_AJP13_CPONG_REPLY(Code) | | |
JK_AJP13_END_RESPONSE | final public static byte JK_AJP13_END_RESPONSE(Code) | | |
JK_AJP13_FORWARD_REQUEST | final public static byte JK_AJP13_FORWARD_REQUEST(Code) | | |
JK_AJP13_GET_BODY_CHUNK | final public static byte JK_AJP13_GET_BODY_CHUNK(Code) | | |
JK_AJP13_PING_REQUEST | final public static byte JK_AJP13_PING_REQUEST(Code) | | |
JK_AJP13_SEND_BODY_CHUNK | final public static byte JK_AJP13_SEND_BODY_CHUNK(Code) | | |
JK_AJP13_SEND_HEADERS | final public static byte JK_AJP13_SEND_HEADERS(Code) | | |
JK_AJP13_SHUTDOWN | final public static byte JK_AJP13_SHUTDOWN(Code) | | |
SC_A_ARE_DONE | final public static byte SC_A_ARE_DONE(Code) | | |
SC_A_AUTH_TYPE | final public static byte SC_A_AUTH_TYPE(Code) | | |
SC_A_CONTEXT | final public static byte SC_A_CONTEXT(Code) | | |
SC_A_JVM_ROUTE | final public static byte SC_A_JVM_ROUTE(Code) | | |
SC_A_QUERY_STRING | final public static byte SC_A_QUERY_STRING(Code) | | |
SC_A_REMOTE_USER | final public static byte SC_A_REMOTE_USER(Code) | | |
SC_A_REQ_ATTRIBUTE | final public static byte SC_A_REQ_ATTRIBUTE(Code) | | |
SC_A_SECRET | final public static byte SC_A_SECRET(Code) | | |
SC_A_SERVLET_PATH | final public static byte SC_A_SERVLET_PATH(Code) | | |
SC_A_SSL_CERT | final public static byte SC_A_SSL_CERT(Code) | | |
SC_A_SSL_CIPHER | final public static byte SC_A_SSL_CIPHER(Code) | | |
SC_A_SSL_KEY_SIZE | final public static byte SC_A_SSL_KEY_SIZE(Code) | | |
SC_A_SSL_SESSION | final public static byte SC_A_SSL_SESSION(Code) | | |
SC_A_STORED_METHOD | final public static byte SC_A_STORED_METHOD(Code) | | |
SC_M_JK_STORED | final public static int SC_M_JK_STORED(Code) | | |
SC_REQ_ACCEPT | final public static int SC_REQ_ACCEPT(Code) | | |
SC_REQ_ACCEPT_CHARSET | final public static int SC_REQ_ACCEPT_CHARSET(Code) | | |
SC_REQ_ACCEPT_ENCODING | final public static int SC_REQ_ACCEPT_ENCODING(Code) | | |
SC_REQ_ACCEPT_LANGUAGE | final public static int SC_REQ_ACCEPT_LANGUAGE(Code) | | |
SC_REQ_AUTHORIZATION | final public static int SC_REQ_AUTHORIZATION(Code) | | |
SC_REQ_CONNECTION | final public static int SC_REQ_CONNECTION(Code) | | |
SC_REQ_CONTENT_LENGTH | final public static int SC_REQ_CONTENT_LENGTH(Code) | | |
SC_REQ_CONTENT_TYPE | final public static int SC_REQ_CONTENT_TYPE(Code) | | |
SC_REQ_COOKIE | final public static int SC_REQ_COOKIE(Code) | | |
SC_REQ_COOKIE2 | final public static int SC_REQ_COOKIE2(Code) | | |
SC_REQ_HOST | final public static int SC_REQ_HOST(Code) | | |
SC_REQ_PRAGMA | final public static int SC_REQ_PRAGMA(Code) | | |
SC_REQ_REFERER | final public static int SC_REQ_REFERER(Code) | | |
SC_REQ_USER_AGENT | final public static int SC_REQ_USER_AGENT(Code) | | |
SC_RESP_CONTENT_LANGUAGE | final public static int SC_RESP_CONTENT_LANGUAGE(Code) | | |
SC_RESP_CONTENT_LENGTH | final public static int SC_RESP_CONTENT_LENGTH(Code) | | |
SC_RESP_CONTENT_TYPE | final public static int SC_RESP_CONTENT_TYPE(Code) | | |
SC_RESP_DATE | final public static int SC_RESP_DATE(Code) | | |
SC_RESP_LAST_MODIFIED | final public static int SC_RESP_LAST_MODIFIED(Code) | | |
SC_RESP_LOCATION | final public static int SC_RESP_LOCATION(Code) | | |
SC_RESP_SERVLET_ENGINE | final public static int SC_RESP_SERVLET_ENGINE(Code) | | |
SC_RESP_SET_COOKIE | final public static int SC_RESP_SET_COOKIE(Code) | | |
SC_RESP_SET_COOKIE2 | final public static int SC_RESP_SET_COOKIE2(Code) | | |
SC_RESP_STATUS | final public static int SC_RESP_STATUS(Code) | | |
SC_RESP_WWW_AUTHENTICATE | final public static int SC_RESP_WWW_AUTHENTICATE(Code) | | |
headerTransArray | final public static String[] headerTransArray(Code) | | |
methodTransArray | final public static String[] methodTransArray(Code) | | |
RequestHandler | public RequestHandler()(Code) | | |
decodeRequest | protected int decodeRequest(Ajp13 ch, Ajp13Packet msg, BaseRequest req) throws IOException(Code) | | Parse a FORWARD_REQUEST packet from the web server and store its
properties in the passed-in request object.
Parameters: req - An empty (newly-recycled) request object. Parameters: msg - Holds the packet which has just been sent by the webserver, with its read position just past the packet header (which inthis case includes the prefix code for FORWARD_REQUEST). 200 in case of a successful decoduing, 500 in case of error. |
doRead | public int doRead(Ajp13 ch) throws IOException(Code) | | Return the next byte of request body data (to a servlet).
See Also: Request.doRead |
doRead | public int doRead(Ajp13 ch, byte[] b, int off, int len) throws IOException(Code) | | Store a chunk of request data into the passed-in byte buffer.
Parameters: b - A buffer to fill with data from the request. Parameters: off - The offset in the buffer at which to start filling. Parameters: len - The number of bytes to copy into the buffer. The number of bytes actually copied into the buffer, or -1if the end of the stream has been reached. See Also: Request.doRead |
doWrite | public void doWrite(Ajp13 ch, Ajp13Packet outBuf, byte b, int off, int len) throws IOException(Code) | | Send a chunk of response body data to the web server and on to the
browser.
Parameters: b - A huffer of bytes to send. Parameters: off - The offset into the buffer from which to start sending. Parameters: len - The number of bytes to send. |
finish | public void finish(Ajp13 ch, Ajp13Packet outBuf) throws IOException(Code) | | Signal the web server that the servlet has finished handling this
request, and that the connection can be reused.
|
headerNameToSc | protected int headerNameToSc(String name)(Code) | | Translate an HTTP response header name to an integer code if
possible. Case is ignored.
Parameters: name - The name of the response header to translate. The code for that header name, or -1 if no code exists. |
refillReadBuffer | public boolean refillReadBuffer(Ajp13 ch) throws IOException(Code) | | Get more request body data from the web server and store it in the
internal buffer.
true if there is more data, false if not. |
sendCPong | public int sendCPong(Ajp13 ch, Ajp13Packet outBuf)(Code) | | Send a CPONG REPLY to web server to its CPING request
Parameters: ch - the Ajp13 channel Parameters: outBuf - the Ajp13Packet output packet to use |
sendHeaders | public void sendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, String statusMessage, MimeHeaders headers) throws IOException(Code) | | Send the HTTP headers back to the web server and on to the browser.
Parameters: status - The HTTP status code to send. Parameters: statusMessage - the HTTP status message to send. Parameters: headers - The set of all headers. |
sendHeaders | public void sendHeaders(Ajp13 ch, Ajp13Packet outBuf, int status, MimeHeaders headers) throws IOException(Code) | | Send the HTTP headers back to the web server and on to the browser.
Parameters: status - The HTTP status code to send. Parameters: headers - The set of all headers. |
setDebug | public void setDebug(int debug)(Code) | | |
|
|