| java.lang.Object org.apache.ajp.Ajp13
Ajp13 | public class Ajp13 (Code) | | Represents a single, persistent connection between the web server and
the servlet container. Uses the Apache JServ Protocol version 1.3 for
communication. Because this protocal does not multiplex requests, this
connection can only be associated with a single request-handling cycle
at a time.
This class contains knowledge about how an individual packet is laid out
(via the Ajp13Packet class), and also about the
stages of communicaton between the server and the servlet container. It
translates from Tomcat's internal servlet support methods
(e.g. doWrite) to the correct packets to send to the web server.
See Also: Ajp13Interceptor See Also: author: Dan Milstein [danmil@shore.net] author: Keith Wannamaker [Keith@Wannamaker.org] author: Kevin Seguin [seguin@apache.org] author: Henri Gomez [hgomez@apache.org] author: Costin Manolache |
Method Summary | |
public int | available() | public void | beginSendHeaders(int status, String statusMessage, int numHeaders) | public void | close() Close the socket connection to the web server. | public int | doRead() | public int | doRead(byte[] b, int off, int len) | public void | doWrite(byte b, int off, int len) | public void | endSendHeaders() | public void | finish() | public String | getSecret() | public int | handleMessage(int type, Ajp13Packet hBuf, BaseRequest req) | public void | initBuf() | public boolean | isLogged() | public int | receive(Ajp13Packet msg) Read in a packet from the web server and store it in the passed-in
Ajp13Packet object.
Parameters: msg - The object into which to store the incoming packet -- anycurrent contents will be overwritten. | public int | receiveNextRequest(BaseRequest req) Read a new packet from the web server and decode it. | public void | recycle() | public int | registerMessageType(int id, String name, AjpHandler h, String sig) | public void | send(Ajp13Packet msg) Send a packet to the web server. | public void | sendHeader(String name, String value) | public void | sendHeaders(int status, MimeHeaders headers) | public void | sendHeaders(int status, String statusMessage, MimeHeaders headers) | public void | setBackward(boolean b) | public void | setDebug(int debug) | void | setLogged(boolean b) | public void | setLogger(Logger l) | public void | setSecret(String s) | public void | setSocket(Socket socket) Associate an open socket with this instance. |
H_SIZE | final public static int H_SIZE(Code) | | |
JK_AJP13_BAD_BODY | final public static int JK_AJP13_BAD_BODY(Code) | | |
JK_AJP13_BAD_HEADER | final public static int JK_AJP13_BAD_HEADER(Code) | | |
JK_AJP13_COMM_BROKEN | final public static int JK_AJP13_COMM_BROKEN(Code) | | |
JK_AJP13_COMM_CLOSED | final public static int JK_AJP13_COMM_CLOSED(Code) | | |
JK_AJP13_INCOMPLETE_BODY | final public static int JK_AJP13_INCOMPLETE_BODY(Code) | | |
JK_AJP13_NO_HEADER | final public static int JK_AJP13_NO_HEADER(Code) | | |
MAX_HANDLERS | final static int MAX_HANDLERS(Code) | | |
MAX_PACKET_SIZE | final public static int MAX_PACKET_SIZE(Code) | | |
MAX_READ_SIZE | final public static int MAX_READ_SIZE(Code) | | |
MAX_SEND_SIZE | final public static int MAX_SEND_SIZE(Code) | | |
RESERVED | final static int RESERVED(Code) | | |
backwardCompat | boolean backwardCompat(Code) | | |
bodyBuff | byte[] bodyBuff(Code) | | |
debug | protected int debug(Code) | | |
end_of_stream | boolean end_of_stream(Code) | | |
beginSendHeaders | public void beginSendHeaders(int status, String statusMessage, int numHeaders) throws IOException(Code) | | |
close | public void close() throws IOException(Code) | | Close the socket connection to the web server. In general, sockets
are maintained across many requests, so this will not be called
after finish().
See Also: Ajp13Interceptor.processConnection |
initBuf | public void initBuf()(Code) | | Will be overriden
|
isLogged | public boolean isLogged()(Code) | | |
receive | public int receive(Ajp13Packet msg) throws IOException(Code) | | Read in a packet from the web server and store it in the passed-in
Ajp13Packet object.
Parameters: msg - The object into which to store the incoming packet -- anycurrent contents will be overwritten. The number of bytes read on a successful read or -1 if there was an error. |
receiveNextRequest | public int receiveNextRequest(BaseRequest req) throws IOException(Code) | | Read a new packet from the web server and decode it. If it's a
forwarded request, store its properties in the passed-in AjpRequest
object.
Parameters: req - An empty (newly-recycled) request object. 200 in case of a successful read of a forwarded request, 500if there were errors in the reading of the request, and -2 if theserver is asking the container to shut itself down. |
recycle | public void recycle()(Code) | | |
send | public void send(Ajp13Packet msg) throws IOException(Code) | | Send a packet to the web server. Works for any type of message.
Parameters: msg - A packet with accumulated data to send to the server --this method will write out the length in the header. |
setBackward | public void setBackward(boolean b)(Code) | | Backward compat mode, no login needed
|
setDebug | public void setDebug(int debug)(Code) | | |
setLogged | void setLogged(boolean b)(Code) | | |
setSocket | public void setSocket(Socket socket) throws IOException(Code) | | Associate an open socket with this instance.
|
|
|