Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / jigsaw / src / org / w3c / jigsaw / ssi / commands / ControlCommand.java
diff --git a/JMCR-Stable/real-world application/jigsaw/src/org/w3c/jigsaw/ssi/commands/ControlCommand.java b/JMCR-Stable/real-world application/jigsaw/src/org/w3c/jigsaw/ssi/commands/ControlCommand.java
new file mode 100644 (file)
index 0000000..e3d7a7c
--- /dev/null
@@ -0,0 +1,56 @@
+// Command.java\r
+// $Id: ControlCommand.java,v 1.1 2010/06/15 12:21:51 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.jigsaw.ssi.commands ;\r
+\r
+import java.util.Dictionary;\r
+\r
+import org.w3c.util.ArrayDictionary;\r
+\r
+import org.w3c.jigsaw.http.Request;\r
+\r
+import org.w3c.jigsaw.ssi.SSIFrame;\r
+\r
+/**\r
+ * This interface is used to supply implementations of SSI\r
+ * commands. They have to be registered in a CommandRegistry, which in\r
+ * turn is used by the SSIFrame. A control command is a command \r
+ * like loop or if witch can modify the way to execute commands.\r
+ * A control command have to register is position and to know the\r
+ * next position. A position is an integer, witch can be an array\r
+ * index.\r
+ * @see org.w3c.jigsaw.ssi.commands.CommandRegistry\r
+ * @author Benoit Mahe <bmahe@sophia.inria.fr>\r
+ */\r
+\r
+public interface ControlCommand extends Command {\r
+\r
+    /**\r
+     * register the command position in the structure\r
+     * witch store the SSIFrame.\r
+     */\r
+    public void setPosition(SSIFrame ssiframe,\r
+                           Request request,\r
+                           CommandRegistry registry,\r
+                           ArrayDictionary parameters,\r
+                           Dictionary variables,\r
+                           int position);\r
+\r
+    /**\r
+     * Give the next position in the structure witch\r
+     * store the SSIFrame.\r
+     * @return An integer\r
+     * @exception ControlCommandException if action failed.\r
+     */\r
+    public int jumpTo(SSIFrame ssiframe,\r
+                     Request request,\r
+                     CommandRegistry registry,\r
+                     ArrayDictionary parameters,\r
+                     Dictionary variables)\r
+       throws ControlCommandException;\r
+\r
+}\r
+\r
+\r