KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > coyote > ActionCode


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17  
18 package org.apache.coyote;
19
20
21 /**
22  * Enumerated class containing the adapter event codes.
23  * Actions represent callbacks from the servlet container to the coyote
24  * connector.
25  *
26  * Actions are implemented by ProtocolHandler, using the ActionHook interface.
27  *
28  * @see ProtocolHandler
29  * @see ActionHook
30  * @author Remy Maucherat
31  */

32 public final class ActionCode {
33
34
35     // -------------------------------------------------------------- Constants
36

37
38     public static final ActionCode ACTION_ACK = new ActionCode(1);
39
40
41     public static final ActionCode ACTION_CLOSE = new ActionCode(2);
42
43
44     public static final ActionCode ACTION_COMMIT = new ActionCode(3);
45
46
47     /**
48      * A flush() operation originated by the client ( i.e. a flush() on
49      * the servlet output stream or writer, called by a servlet ).
50      *
51      * Argument is the Response.
52      */

53     public static final ActionCode ACTION_CLIENT_FLUSH = new ActionCode(4);
54
55     
56     public static final ActionCode ACTION_CUSTOM = new ActionCode(5);
57
58
59     public static final ActionCode ACTION_RESET = new ActionCode(6);
60
61
62     public static final ActionCode ACTION_START = new ActionCode(7);
63
64
65     public static final ActionCode ACTION_STOP = new ActionCode(8);
66
67
68     public static final ActionCode ACTION_WEBAPP = new ActionCode(9);
69
70     /** Hook called after request, but before recycling. Can be used
71         for logging, to update counters, custom cleanup - the request
72         is still visible
73     */

74     public static final ActionCode ACTION_POST_REQUEST = new ActionCode(10);
75
76     /**
77      * Callback for lazy evaluation - extract the remote host address.
78      */

79     public static final ActionCode ACTION_REQ_HOST_ATTRIBUTE =
80         new ActionCode(11);
81
82
83     /**
84      * Callback for lazy evaluation - extract the remote host infos (address, name, port) and local address.
85      */

86     public static final ActionCode ACTION_REQ_HOST_ADDR_ATTRIBUTE = new ActionCode(12);
87
88     /**
89      * Callback for lazy evaluation - extract the SSL-related attributes.
90      */

91     public static final ActionCode ACTION_REQ_SSL_ATTRIBUTE = new ActionCode(13);
92
93
94     /** Chain for request creation. Called each time a new request is created
95         ( requests are recycled ).
96      */

97     public static final ActionCode ACTION_NEW_REQUEST = new ActionCode(14);
98
99
100     /**
101      * Callback for lazy evaluation - extract the SSL-certificate
102      * (including forcing a re-handshake if necessary)
103      */

104     public static final ActionCode ACTION_REQ_SSL_CERTIFICATE = new ActionCode(15);
105     
106     
107     /**
108      * Callback for lazy evaluation - socket remote port.
109      **/

110     public static final ActionCode ACTION_REQ_REMOTEPORT_ATTRIBUTE = new ActionCode(16);
111
112     
113     /**
114      * Callback for lazy evaluation - socket local port.
115      **/

116     public static final ActionCode ACTION_REQ_LOCALPORT_ATTRIBUTE = new ActionCode(17);
117     
118     
119     /**
120      * Callback for lazy evaluation - local address.
121      **/

122     public static final ActionCode ACTION_REQ_LOCAL_ADDR_ATTRIBUTE = new ActionCode(18);
123     
124     
125     /**
126      * Callback for lazy evaluation - local address.
127      **/

128     public static final ActionCode ACTION_REQ_LOCAL_NAME_ATTRIBUTE = new ActionCode(19);
129
130
131     /**
132      * Callback for setting FORM auth body replay
133      */

134     public static final ActionCode ACTION_REQ_SET_BODY_REPLAY = new ActionCode(20);
135
136
137     /**
138      * Callback for begin Comet processing
139      */

140     public static final ActionCode ACTION_COMET_BEGIN = new ActionCode(21);
141
142
143     /**
144      * Callback for begin Comet processing
145      */

146     public static final ActionCode ACTION_COMET_END = new ActionCode(22);
147
148
149     // ----------------------------------------------------------- Constructors
150
int code;
151
152     /**
153      * Private constructor.
154      */

155     private ActionCode(int code) {
156         this.code=code;
157     }
158
159     /** Action id, useable in switches and table indexes
160      */

161     public int getCode() {
162         return code;
163     }
164
165
166 }
167
Popular Tags