|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ajp.Ajp13
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.
Ajp13Interceptor
Field Summary | |
protected int |
debug
|
static int |
H_SIZE
|
static int |
JK_AJP13_BAD_BODY
|
static int |
JK_AJP13_BAD_HEADER
|
static int |
JK_AJP13_COMM_BROKEN
|
static int |
JK_AJP13_COMM_CLOSED
|
static int |
JK_AJP13_INCOMPLETE_BODY
|
static int |
JK_AJP13_NO_HEADER
|
static int |
MAX_PACKET_SIZE
|
static int |
MAX_READ_SIZE
|
static int |
MAX_SEND_SIZE
|
Ajp13Packet |
outBuf
|
RequestHandler |
reqHandler
|
Constructor Summary | |
Ajp13()
|
|
Ajp13(RequestHandler reqHandler)
|
Method Summary | |
int |
available()
Deprecated. -- Will use reqHandler, make sure nobody else calls this |
void |
beginSendHeaders(int status,
java.lang.String statusMessage,
int numHeaders)
|
void |
close()
Close the socket connection to the web server. |
int |
doRead()
|
int |
doRead(byte[] b,
int off,
int len)
|
void |
doWrite(byte[] b,
int off,
int len)
|
void |
endSendHeaders()
|
void |
finish()
|
java.lang.String |
getSecret()
|
int |
handleMessage(int type,
Ajp13Packet hBuf,
BaseRequest req)
Override for ajp14, temporary |
void |
initBuf()
Will be overriden |
boolean |
isLogged()
|
int |
receive(Ajp13Packet msg)
Read in a packet from the web server and store it in the passed-in Ajp13Packet object. |
int |
receiveNextRequest(BaseRequest req)
Read a new packet from the web server and decode it. |
void |
recycle()
|
int |
registerMessageType(int id,
java.lang.String name,
AjpHandler h,
java.lang.String[] sig)
|
void |
send(Ajp13Packet msg)
Send a packet to the web server. |
void |
sendHeader(java.lang.String name,
java.lang.String value)
|
void |
sendHeaders(int status,
MimeHeaders headers)
|
void |
sendHeaders(int status,
java.lang.String statusMessage,
MimeHeaders headers)
|
void |
setBackward(boolean b)
Backward compat mode, no login needed |
void |
setDebug(int debug)
|
void |
setLogger(Logger l)
|
void |
setSecret(java.lang.String s)
|
void |
setSocket(java.net.Socket socket)
Associate an open socket with this instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_PACKET_SIZE
public static final int H_SIZE
public static final int MAX_READ_SIZE
public static final int MAX_SEND_SIZE
public static final int JK_AJP13_BAD_HEADER
public static final int JK_AJP13_NO_HEADER
public static final int JK_AJP13_COMM_CLOSED
public static final int JK_AJP13_COMM_BROKEN
public static final int JK_AJP13_BAD_BODY
public static final int JK_AJP13_INCOMPLETE_BODY
public Ajp13Packet outBuf
public RequestHandler reqHandler
protected int debug
Constructor Detail |
public Ajp13()
public Ajp13(RequestHandler reqHandler)
Method Detail |
public void initBuf()
public void recycle()
public void setSocket(java.net.Socket socket) throws java.io.IOException
java.io.IOException
public void setBackward(boolean b)
public boolean isLogged()
public void setSecret(java.lang.String s)
public java.lang.String getSecret()
public int registerMessageType(int id, java.lang.String name, AjpHandler h, java.lang.String[] sig)
public int receiveNextRequest(BaseRequest req) throws java.io.IOException
req
- An empty (newly-recycled) request object.
java.io.IOException
public int handleMessage(int type, Ajp13Packet hBuf, BaseRequest req) throws java.io.IOException
java.io.IOException
public int available() throws java.io.IOException
java.io.IOException
public int doRead() throws java.io.IOException
java.io.IOException
public int doRead(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
public void beginSendHeaders(int status, java.lang.String statusMessage, int numHeaders) throws java.io.IOException
java.io.IOException
public void sendHeader(java.lang.String name, java.lang.String value) throws java.io.IOException
java.io.IOException
public void endSendHeaders() throws java.io.IOException
java.io.IOException
public void sendHeaders(int status, MimeHeaders headers) throws java.io.IOException
java.io.IOException
public void sendHeaders(int status, java.lang.String statusMessage, MimeHeaders headers) throws java.io.IOException
java.io.IOException
public void finish() throws java.io.IOException
java.io.IOException
public void doWrite(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
public int receive(Ajp13Packet msg) throws java.io.IOException
Ajp13Packet
object.
msg
- The object into which to store the incoming packet -- any
current contents will be overwritten.
java.io.IOException
public void send(Ajp13Packet msg) throws java.io.IOException
msg
- A packet with accumulated data to send to the server --
this method will write out the length in the header.
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
Ajp13Interceptor#processConnection
public void setDebug(int debug)
public void setLogger(Logger l)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |