Constructs a new AjpProcessor. @param protocol The AJP protocol @param adapter The adapter for this processor
(AbstractAjpProtocol<?> protocol, Adapter adapter)
| 265 | * @param adapter The adapter for this processor |
| 266 | */ |
| 267 | public AjpProcessor(AbstractAjpProtocol<?> protocol, Adapter adapter) { |
| 268 | super(adapter); |
| 269 | this.protocol = protocol; |
| 270 | |
| 271 | int packetSize = protocol.getPacketSize(); |
| 272 | // Calculate maximum chunk size as packetSize may have been changed from |
| 273 | // the default (Constants.MAX_PACKET_SIZE) |
| 274 | this.outputMaxChunkSize = packetSize - Constants.SEND_HEAD_LEN; |
| 275 | |
| 276 | request.setInputBuffer(new SocketInputBuffer()); |
| 277 | |
| 278 | requestHeaderMessage = new AjpMessage(packetSize); |
| 279 | responseMessage = new AjpMessage(packetSize); |
| 280 | bodyMessage = new AjpMessage(packetSize); |
| 281 | |
| 282 | // Set the getBody message buffer |
| 283 | AjpMessage getBodyMessage = new AjpMessage(16); |
| 284 | getBodyMessage.reset(); |
| 285 | getBodyMessage.appendByte(Constants.JK_AJP13_GET_BODY_CHUNK); |
| 286 | // Adjust read size if packetSize != default (Constants.MAX_PACKET_SIZE) |
| 287 | getBodyMessage.appendInt(Constants.MAX_READ_SIZE + packetSize - Constants.MAX_PACKET_SIZE); |
| 288 | getBodyMessage.end(); |
| 289 | getBodyMessageArray = new byte[getBodyMessage.getLen()]; |
| 290 | System.arraycopy(getBodyMessage.getBuffer(), 0, getBodyMessageArray, 0, getBodyMessage.getLen()); |
| 291 | |
| 292 | response.setOutputBuffer(new SocketOutputBuffer()); |
| 293 | } |
| 294 | |
| 295 | |
| 296 | // --------------------------------------------------------- Public Methods |
nothing calls this directly
no test coverage detected