|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.coyote.ajp.AjpMessage
public class AjpMessage
A single packet for communication between the web server and the container. Designed to be reused many times with no creation of garbage. Understands the format of data types for these packets. Can be used (somewhat confusingly) for both incoming and outgoing packets.
Field Summary | |
---|---|
protected byte[] |
buf
Fixed size buffer. |
protected int |
len
This actually means different things depending on whether the packet is read or write. |
protected int |
pos
The current read or write position in the buffer. |
protected static StringManager |
sm
The string manager for this package. |
Constructor Summary | |
---|---|
AjpMessage(int packetSize)
|
Method Summary | |
---|---|
void |
appendByte(int val)
Append a byte (1 byte) to the message. |
void |
appendByteChunk(ByteChunk bc)
Write a ByteChunk out at the current write position. |
void |
appendBytes(byte[] b,
int off,
int numBytes)
Copy a chunk of bytes into the packet, starting at the current write position. |
void |
appendBytes(MessageBytes mb)
Write a MessageBytes out at the current write position. |
void |
appendCharChunk(CharChunk cc)
Write a CharChunk out at the current write position. |
void |
appendInt(int val)
Add a short integer (2 bytes) to the message. |
void |
appendString(String str)
Write a String out at the current write position. |
void |
dump(String msg)
Dump the contents of the message, prefixed with the given String. |
void |
end()
For a packet to be sent to the web server, finish the process of accumulating data and write the length of the data payload into the header. |
void |
getBodyBytes(MessageBytes mb)
|
byte[] |
getBuffer()
Return the underlying byte buffer. |
byte |
getByte()
|
void |
getBytes(MessageBytes mb)
|
int |
getHeaderLength()
|
int |
getInt()
Read an integer from packet, and advance the read position past it. |
int |
getLen()
Return the current message length. |
int |
getLongInt()
Read a 32 bits integer from packet, and advance the read position past it. |
int |
getPacketSize()
|
protected static String |
hex(int x)
|
protected static String |
hexLine(byte[] buf,
int start,
int len)
|
int |
peekInt()
|
int |
processHeader()
Deprecated. |
int |
processHeader(boolean toContainer)
|
void |
reset()
Prepare this packet for accumulating a message from the container to the web server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final StringManager sm
protected byte[] buf
protected int pos
protected int len
Constructor Detail |
---|
public AjpMessage(int packetSize)
Method Detail |
---|
public void reset()
public void end()
public byte[] getBuffer()
public int getLen()
public void appendInt(int val)
public void appendByte(int val)
public void appendBytes(MessageBytes mb)
public void appendByteChunk(ByteChunk bc)
public void appendCharChunk(CharChunk cc)
public void appendString(String str)
public void appendBytes(byte[] b, int off, int numBytes)
b
- The array from which to copy bytes.off
- The offset into the array at which to start copyingnumBytes
- The number of bytes to copy.public int getInt()
public int peekInt()
public byte getByte()
public void getBytes(MessageBytes mb)
public void getBodyBytes(MessageBytes mb)
public int getLongInt()
public int getHeaderLength()
public int getPacketSize()
@Deprecated public int processHeader()
public int processHeader(boolean toContainer)
public void dump(String msg)
protected static String hexLine(byte[] buf, int start, int len)
protected static String hex(int x)
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |