View Javadoc

    1   //========================================================================
    2   //Copyright 2006 Mort Bay Consulting Pty. Ltd.
    3   //------------------------------------------------------------------------
    4   //Licensed under the Apache License, Version 2.0 (the "License");
    5   //you may not use this file except in compliance with the License.
    6   //You may obtain a copy of the License at
    7   //http://www.apache.org/licenses/LICENSE-2.0
    8   //Unless required by applicable law or agreed to in writing, software
    9   //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
    25      public final static int MAX_PACKET_SIZE=(8*1024);
    26      public final static int HDR_SIZE=4;
    27
    28      // Used in writing response...
    29      public final static int DATA_HDR_SIZE=7;
    30      public final static int MAX_DATA_SIZE=MAX_PACKET_SIZE-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", SEND_HEADERS="SEND HEADERS", END_RESPONSE="END RESPONSE",
    41              GET_BODY_CHUNK="GET BODY CHUNK",
    42              CPONG_REPLY="CPONG REPLY";
    43
    44      public final static int FORWARD_REQUEST_ORDINAL=2, SHUTDOWN_ORDINAL=7,
    45              PING_REQUEST_ORDINAL=8, // Obsolete
    46              CPING_REQUEST_ORDINAL=10, SEND_BODY_CHUNK_ORDINAL=3, SEND_HEADERS_ORDINAL=4, END_RESPONSE_ORDINAL=5, GET_BODY_CHUNK_ORDINAL=6,
    47              CPONG_REPLY_ORDINAL=9;
    48
    49      public final static BufferCache CACHE=new BufferCache();
    50
    51      static
    52      {
    53          CACHE.add(FORWARD_REQUEST,FORWARD_REQUEST_ORDINAL);
    54          CACHE.add(SHUTDOWN,SHUTDOWN_ORDINAL);
    55          CACHE.add(PING_REQUEST,PING_REQUEST_ORDINAL); // Obsolete
    56          CACHE.add(CPING_REQUEST,CPING_REQUEST_ORDINAL);
    57          CACHE.add(SEND_BODY_CHUNK,SEND_BODY_CHUNK_ORDINAL);
    58          CACHE.add(SEND_HEADERS,SEND_HEADERS_ORDINAL);
    59          CACHE.add(END_RESPONSE,END_RESPONSE_ORDINAL);
    60          CACHE.add(GET_BODY_CHUNK,GET_BODY_CHUNK_ORDINAL);
    61          CACHE.add(CPONG_REPLY,CPONG_REPLY_ORDINAL);
    62      }
    63
    64  }