|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tomcat.modules.server.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 internal 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
Constructor Summary | |
Ajp13()
|
Method Summary | |
void |
close()
Close the socket connection to the web server. |
int |
doRead()
Return the next byte of request body data (to a servlet). |
int |
doRead(byte[] b,
int off,
int len)
Store a chunk of request data into the passed-in byte buffer. |
void |
doWrite(byte[] b,
int off,
int len)
Send a chunk of response body data to the web server and on to the browser. |
void |
finish()
Signal the web server that the servlet has finished handling this request, and that the connection can be reused. |
java.lang.String |
getSecret()
|
protected int |
headerNameToSc(java.lang.String name)
Translate an HTTP response header name to an integer code if possible. |
boolean |
isTomcatAuthentication()
|
int |
receiveNextRequest(Request req)
Read a new packet from the web server and decode it. |
void |
recycle()
|
void |
sendHeaders(int status,
MimeHeaders headers)
Send the HTTP headers back to the web server and on to the browser. |
void |
setDebug(int i)
|
void |
setSocket(java.net.Socket socket)
Associate an open socket with this instance. |
void |
setTomcatAuthentication(boolean newTomcatAuthentication)
|
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 byte JK_AJP13_FORWARD_REQUEST
public static final byte JK_AJP13_SHUTDOWN
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 static final byte JK_AJP13_SEND_BODY_CHUNK
public static final byte JK_AJP13_SEND_HEADERS
public static final byte JK_AJP13_END_RESPONSE
public static final byte JK_AJP13_GET_BODY_CHUNK
public static final int SC_RESP_CONTENT_TYPE
public static final int SC_RESP_CONTENT_LANGUAGE
public static final int SC_RESP_CONTENT_LENGTH
public static final int SC_RESP_DATE
public static final int SC_RESP_LAST_MODIFIED
public static final int SC_RESP_LOCATION
public static final int SC_RESP_SET_COOKIE
public static final int SC_RESP_SET_COOKIE2
public static final int SC_RESP_SERVLET_ENGINE
public static final int SC_RESP_STATUS
public static final int SC_RESP_WWW_AUTHENTICATE
public static final byte SC_A_CONTEXT
public static final byte SC_A_SERVLET_PATH
public static final byte SC_A_REMOTE_USER
public static final byte SC_A_AUTH_TYPE
public static final byte SC_A_QUERY_STRING
public static final byte SC_A_JVM_ROUTE
public static final byte SC_A_SSL_CERT
public static final byte SC_A_SSL_CIPHER
public static final byte SC_A_SSL_SESSION
public static final byte SC_A_SECRET
public static final byte SC_A_REQ_ATTRIBUTE
public static final byte SC_A_ARE_DONE
public static final java.lang.String[] methodTransArray
public static final java.lang.String[] headerTransArray
Constructor Detail |
public Ajp13()
Method Detail |
public void recycle()
public boolean isTomcatAuthentication()
public void setTomcatAuthentication(boolean newTomcatAuthentication)
public void setSocket(java.net.Socket socket) throws java.io.IOException
java.io.IOException
public java.lang.String getSecret()
public int receiveNextRequest(Request req) throws java.io.IOException
req
- An empty (newly-recycled) request object.
java.io.IOException
public int doRead() throws java.io.IOException
java.io.IOException
Ajp13Request#doRead
public int doRead(byte[] b, int off, int len) throws java.io.IOException
b
- A buffer to fill with data from the request.off
- The offset in the buffer at which to start filling.len
- The number of bytes to copy into the buffer.
java.io.IOException
Ajp13Request#doRead
public void sendHeaders(int status, MimeHeaders headers) throws java.io.IOException
status
- The HTTP status code to send.headers
- The set of all headers.
java.io.IOException
protected int headerNameToSc(java.lang.String name)
name
- The name of the response header to translate.
public void finish() throws java.io.IOException
java.io.IOException
public void doWrite(byte[] b, int off, int len) throws java.io.IOException
b
- A huffer of bytes to send.off
- The offset into the buffer from which to start sending.len
- The number of bytes to send.
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
Ajp13Interceptor.processConnection(org.apache.tomcat.util.net.TcpConnection, java.lang.Object[])
public void setDebug(int i)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |