Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / jigsaw / src / org / w3c / www / protocol / http / RequestEvent.java
diff --git a/JMCR-Stable/real-world application/jigsaw/src/org/w3c/www/protocol/http/RequestEvent.java b/JMCR-Stable/real-world application/jigsaw/src/org/w3c/www/protocol/http/RequestEvent.java
new file mode 100644 (file)
index 0000000..842af07
--- /dev/null
@@ -0,0 +1,64 @@
+// RequestEvent.java\r
+// $Id: RequestEvent.java,v 1.1 2010/06/15 12:25:17 smhuang Exp $\r
+// (c) COPYRIGHT MIT and INRIA, 1996.\r
+// Please first read the full copyright statement in file COPYRIGHT.html\r
+\r
+package org.w3c.www.protocol.http;\r
+\r
+/**\r
+ * The base class for request events.\r
+ * Request events are emited to request observers (if available) while\r
+ * requests are being processed.\r
+ * <p>This class is the base class for all request events.\r
+ */\r
+\r
+public class RequestEvent {\r
+    /**\r
+     * Status definition - The request is now queued for processing.\r
+     */\r
+    public static int EVT_QUEUED = 1 ;\r
+    /**\r
+     * Status definition - Connection is now settle, about to emit \r
+     * the request to target host.\r
+     */\r
+    public static int EVT_CONNECTED = 2 ;\r
+    /**\r
+     * Status definition - Request headers are now emited, the HttpManager\r
+     * is now waiting for the reply.\r
+     */\r
+    public static int EVT_EMITED = 3 ;\r
+    /**\r
+     * Status definition - Reply headers have been received, the reply\r
+     * will be handed out right after this to the observer.\r
+     */\r
+    public static int EVT_REPLIED = 4 ;\r
+    /**\r
+     * Error definition - The target server has improperly closed the \r
+     * connection.\r
+     */\r
+    public static int EVT_CLOSED = 5 ;\r
+    // FIXME doc\r
+    public static int EVT_CONTINUE = 6;    \r
+    public static int EVT_UNREACHABLE = 7;\r
+\r
+    /**\r
+     * The server instance that issued the event.\r
+     */\r
+    public HttpServer server = null;\r
+    /**\r
+     * The request that trigered the event.\r
+     */\r
+    public Request request = null;\r
+    /**\r
+     * The associated event code.\r
+     */\r
+    public int code = -1;\r
+\r
+    public RequestEvent(HttpServer server, Request request, int code) {\r
+       this.server  = server;\r
+       this.request = request;\r
+       this.code    = code;\r
+    }\r
+}\r
+\r
+\r