| Modifier and Type | Field and Description |
|---|---|
| protected final byte[] | buf
Fixed size buffer. |
| protected int | len
This actually means different things depending on whether the packet is read or write. |
| private static final Log | |
| protected int | pos
The current read or write position in the buffer. |
| protected static final StringManager | sm
The string manager for this package. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | appendBytes(MessageBytes
The data to write mb)Write a MessageBytes out at the current write position. |
| public void | appendBytes(byte[]
The array from which to copy bytes. b, int The offset into the array at which to start copying off, int The number of bytes to copy. numBytes)Copy a chunk of bytes into the packet, starting at the current write position. |
| public void | appendBytes(ByteBuffer
The ByteBuffer from which to copy bytes. b)Copy a chunk of bytes into the packet, starting at the current write position. |
| public void | |
| private boolean | |
| private void | |
| private void | |
| public 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. |
| public void | |
| public byte[] | |
| public byte | |
| public void | |
| public int | Returns: The integer value read from the messageRead an integer from packet, and advance the read position past it. |
| public int | Returns: For read, it's the length of the payload (excluding the header). For write, it's the length of the packet as a whole (counting the header).Return the current message length. |
| public int | Returns: The long value read from the messageRead a 32 bits integer from packet, and advance the read position past it. |
| protected static String | |
| protected static String | |
| public int | |
| public int | |
| public void | |
| private void |
| buf | back to summary |
|---|---|
| protected final byte[] buf Fixed size buffer. | |
| len | back to summary |
|---|---|
| protected int len This actually means different things depending on whether the packet is read or write. For read, it's the length of the payload (excluding the header). For write, it's the length of the packet as a whole (counting the header). Oh, well. | |
| log | back to summary |
|---|---|
| private static final Log log | |
| pos | back to summary |
|---|---|
| protected int pos The current read or write position in the buffer. | |
| sm | back to summary |
|---|---|
| protected static final StringManager sm The string manager for this package. | |
| AjpMessage | back to summary |
|---|---|
| public AjpMessage(int packetSize) | |
| appendByte | back to summary |
|---|---|
| public void appendByte(int val) Append a byte (1 byte) to the message.
| |
| appendByteChunk | back to summary |
|---|---|
| public void appendByteChunk(ByteChunk bc) Write a ByteChunk out at the current write position. A null ByteChunk is encoded as a string with length 0.
| |
| appendBytes | back to summary |
|---|---|
| public void appendBytes(MessageBytes mb) Write a MessageBytes out at the current write position. A null MessageBytes is encoded as a string with length 0.
| |
| appendBytes | back to summary |
|---|---|
| public void appendBytes(byte[] b, int off, int numBytes) Copy a chunk of bytes into the packet, starting at the current write position. The chunk of bytes is encoded with the length in two bytes first, then the data itself, and finally a terminating \0 (which is not included in the encoded length).
| |
| appendBytes | back to summary |
|---|---|
| public void appendBytes(ByteBuffer b) Copy a chunk of bytes into the packet, starting at the current write position. The chunk of bytes is encoded with the length in two bytes first, then the data itself, and finally a terminating \0 (which is not included in the encoded length).
| |
| appendInt | back to summary |
|---|---|
| public void appendInt(int val) Add a short integer (2 bytes) to the message.
| |
| checkOverflow | back to summary |
|---|---|
| private boolean checkOverflow(int numBytes) | |
| doGetBytes | back to summary |
|---|---|
| private void doGetBytes(MessageBytes mb, boolean terminated) | |
| dump | back to summary |
|---|---|
| private void dump(String prefix) | |
| end | back to summary |
|---|---|
| public 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. | |
| getBodyBytes | back to summary |
|---|---|
| public void getBodyBytes(MessageBytes mb) | |
| getBuffer | back to summary |
|---|---|
| public byte[] getBuffer() Return the underlying byte buffer.
| |
| getByte | back to summary |
|---|---|
| public byte getByte() | |
| getBytes | back to summary |
|---|---|
| public void getBytes(MessageBytes mb) | |
| getInt | back to summary |
|---|---|
| public int getInt() Read an integer from packet, and advance the read position past it. Integers are encoded as two unsigned bytes with the high-order byte first, and, as far as I can tell, in little-endian order within each byte.
| |
| getLen | back to summary |
|---|---|
| public int getLen() Return the current message length.
| |
| getLongInt | back to summary |
|---|---|
| public int getLongInt() Read a 32 bits integer from packet, and advance the read position past it. Integers are encoded as four unsigned bytes with the high-order byte first, and, as far as I can tell, in little-endian order within each byte.
| |
| hex | back to summary |
|---|---|
| protected static String hex(int x) | |
| hexLine | back to summary |
|---|---|
| protected static String hexLine(byte[] buf, int start, int len) | |
| peekInt | back to summary |
|---|---|
| public int peekInt() | |
| processHeader | back to summary |
|---|---|
| public int processHeader(boolean toContainer) | |
| reset | back to summary |
|---|---|
| public void reset() Prepare this packet for accumulating a message from the container to the web server. Set the write position to just after the header (but leave the length unwritten, because it is as yet unknown). | |
| validatePos | back to summary |
|---|---|
| private void validatePos(int posToTest) | |