01: //========================================================================
02: //Copyright 2006 Mort Bay Consulting Pty. Ltd.
03: //------------------------------------------------------------------------
04: //Licensed under the Apache License, Version 2.0 (the "License");
05: //you may not use this file except in compliance with the License.
06: //You may obtain a copy of the License at
07: //http://www.apache.org/licenses/LICENSE-2.0
08: //Unless required by applicable law or agreed to in writing, software
09: //distributed under the License is distributed on an "AS IS" BASIS,
10: //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11: //See the License for the specific language governing permissions and
12: //limitations under the License.
13: //========================================================================
14:
15: package org.mortbay.jetty.ajp;
16:
17: import org.mortbay.io.BufferCache;
18:
19: /**
20: * @author Markus Kobler
21: */
22: public class Ajp13Packet {
23:
24: public final static int MAX_PACKET_SIZE = (8 * 1024);
25: public final static int HDR_SIZE = 4;
26:
27: // Used in writing response...
28: public final static int DATA_HDR_SIZE = 7;
29: public final static int MAX_DATA_SIZE = MAX_PACKET_SIZE
30: - DATA_HDR_SIZE;
31:
32: public final static String
33: // Server -> Container
34: FORWARD_REQUEST = "FORWARD REQUEST",
35: SHUTDOWN = "SHUTDOWN",
36: PING_REQUEST = "PING REQUEST", // Obsolete
37: CPING_REQUEST = "CPING REQUEST",
38:
39: // Server <- Container
40: SEND_BODY_CHUNK = "SEND BODY CHUNK",
41: SEND_HEADERS = "SEND HEADERS",
42: END_RESPONSE = "END RESPONSE",
43: GET_BODY_CHUNK = "GET BODY CHUNK",
44: CPONG_REPLY = "CPONG REPLY";
45:
46: public final static int FORWARD_REQUEST_ORDINAL = 2,
47: SHUTDOWN_ORDINAL = 7,
48: PING_REQUEST_ORDINAL = 8, // Obsolete
49: CPING_REQUEST_ORDINAL = 10, SEND_BODY_CHUNK_ORDINAL = 3,
50: SEND_HEADERS_ORDINAL = 4, END_RESPONSE_ORDINAL = 5,
51: GET_BODY_CHUNK_ORDINAL = 6, CPONG_REPLY_ORDINAL = 9;
52:
53: public final static BufferCache CACHE = new BufferCache();
54:
55: static {
56: CACHE.add(FORWARD_REQUEST, FORWARD_REQUEST_ORDINAL);
57: CACHE.add(SHUTDOWN, SHUTDOWN_ORDINAL);
58: CACHE.add(PING_REQUEST, PING_REQUEST_ORDINAL); // Obsolete
59: CACHE.add(CPING_REQUEST, CPING_REQUEST_ORDINAL);
60: CACHE.add(SEND_BODY_CHUNK, SEND_BODY_CHUNK_ORDINAL);
61: CACHE.add(SEND_HEADERS, SEND_HEADERS_ORDINAL);
62: CACHE.add(END_RESPONSE, END_RESPONSE_ORDINAL);
63: CACHE.add(GET_BODY_CHUNK, GET_BODY_CHUNK_ORDINAL);
64: CACHE.add(CPONG_REPLY, CPONG_REPLY_ORDINAL);
65: }
66:
67: }
|