|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 static org.jboss.logging.Logger |
log
|
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 |
appendLongInt(int val)
Append an int (4 bytes) to the message. |
void |
appendString(java.lang.String str)
Write a String out at the current write position. |
void |
dump(java.lang.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. |
byte[] |
getBuffer()
Return the underlying byte buffer. |
byte |
getByte()
|
int |
getBytes(byte[] dest)
Copy a chunk of bytes from the packet into an array and advance the read position past the chunk. |
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 java.lang.String |
hex(int x)
|
protected static java.lang.String |
hexLine(byte[] buf,
int start,
int len)
|
byte |
peekByte()
|
int |
peekInt()
|
int |
processHeader()
|
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 org.jboss.logging.Logger log
protected static 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 appendLongInt(int val)
public void appendBytes(MessageBytes mb)
public void appendByteChunk(ByteChunk bc)
public void appendCharChunk(CharChunk cc)
public void appendString(java.lang.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 byte peekByte()
public void getBytes(MessageBytes mb)
public int getBytes(byte[] dest)
public int getLongInt()
public int getHeaderLength()
public int getPacketSize()
public int processHeader()
public void dump(java.lang.String msg)
protected static java.lang.String hexLine(byte[] buf, int start, int len)
protected static java.lang.String hex(int x)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |