Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / jigsaw / src / org / w3c / jigsaw / http / socket / SocketConnectionProp.java
diff --git a/JMCR-Stable/real-world application/jigsaw/src/org/w3c/jigsaw/http/socket/SocketConnectionProp.java b/JMCR-Stable/real-world application/jigsaw/src/org/w3c/jigsaw/http/socket/SocketConnectionProp.java
new file mode 100644 (file)
index 0000000..b2ac8c1
--- /dev/null
@@ -0,0 +1,81 @@
+// ConnectionProp.java\r
+// $Id: SocketConnectionProp.java,v 1.2 2010/06/15 17:53:14 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.http.socket;\r
+\r
+import org.w3c.tools.resources.Attribute;\r
+import org.w3c.tools.resources.AttributeRegistry;\r
+import org.w3c.tools.resources.IntegerAttribute;\r
+import org.w3c.tools.resources.StringAttribute;\r
+\r
+import org.w3c.jigsaw.http.httpd;\r
+\r
+import org.w3c.jigsaw.config.PropertySet;\r
+\r
+public class SocketConnectionProp extends PropertySet {\r
+    private static String title = "Socket connection properties";\r
+\r
+    static {\r
+       Class     c = null;\r
+       Attribute a = null;\r
+       \r
+       try {\r
+          c = Class.forName("org.w3c.jigsaw.http.socket.SocketConnectionProp");\r
+           //Added by Jeff Huang\r
+           //TODO: FIXIT\r
+       } catch (Exception ex) {\r
+           ex.printStackTrace();\r
+           System.exit(1);\r
+       }\r
+       // Minimum number of free spare threads\r
+       a = new IntegerAttribute(SocketClientFactory.MINSPARE_FREE_P\r
+                              , new Integer(SocketClientFactory.MINSPARE_FREE)\r
+                              , Attribute.EDITABLE);\r
+       AttributeRegistry.registerAttribute(c, a);\r
+       // Maximum number of free spare threads\r
+       a = new IntegerAttribute(SocketClientFactory.MAXSPARE_FREE_P\r
+                              , new Integer(SocketClientFactory.MAXSPARE_FREE)\r
+                              , Attribute.EDITABLE);\r
+       AttributeRegistry.registerAttribute(c, a);\r
+       // Maximum number of idle threads:\r
+       a = new IntegerAttribute(SocketClientFactory.MAXSPARE_IDLE_P\r
+                              , new Integer(SocketClientFactory.MAXSPARE_IDLE)\r
+                              , Attribute.EDITABLE);\r
+       AttributeRegistry.registerAttribute(c, a);\r
+       // Maximum number of simultaneous connections:\r
+       a = new IntegerAttribute(SocketClientFactory.MAXCLIENTS_P\r
+                              , new Integer(SocketClientFactory.MAXCLIENTS)\r
+                              , Attribute.EDITABLE);\r
+       AttributeRegistry.registerAttribute(c, a);\r
+       // Idle timeout for thread cache\r
+       a = new IntegerAttribute(SocketClientFactory.IDLETO_P\r
+                              , new Integer(SocketClientFactory.IDLETO)\r
+                              , Attribute.EDITABLE);\r
+       AttributeRegistry.registerAttribute(c, a);\r
+       // Max number of threads\r
+       a = new IntegerAttribute(SocketClientFactory.MAXTHREADS_P\r
+                                , new Integer(SocketClientFactory.MAXTHREADS)\r
+                                , Attribute.EDITABLE);\r
+       AttributeRegistry.registerAttribute(c, a);\r
+        // Specific address to bidn the server socket\r
+       a = new StringAttribute(SocketClientFactory.BINDADDR_P\r
+                               , null\r
+                               , Attribute.EDITABLE);\r
+       AttributeRegistry.registerAttribute(c, a);\r
+    }\r
+\r
+    /**\r
+     * Get this property set title.\r
+     * @return A String giving the title for this property set.\r
+     */\r
+\r
+    public String getTitle() {\r
+       return title;\r
+    }\r
+\r
+    SocketConnectionProp(String name, httpd server) {\r
+       super(name, server);\r
+    }\r
+}\r