01: // ConnectionProp.java
02: // $Id: SocketConnectionProp.java,v 1.7 2000/08/16 21:37:42 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1996.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.http.socket;
07:
08: import org.w3c.tools.resources.Attribute;
09: import org.w3c.tools.resources.AttributeRegistry;
10: import org.w3c.tools.resources.IntegerAttribute;
11: import org.w3c.tools.resources.StringAttribute;
12:
13: import org.w3c.jigsaw.http.httpd;
14:
15: import org.w3c.jigsaw.config.PropertySet;
16:
17: public class SocketConnectionProp extends PropertySet {
18: private static String title = "Socket connection properties";
19:
20: static {
21: Class c = null;
22: Attribute a = null;
23:
24: try {
25: c = Class
26: .forName("org.w3c.jigsaw.http.socket.SocketConnectionProp");
27: } catch (Exception ex) {
28: ex.printStackTrace();
29: System.exit(1);
30: }
31: // Minimum number of free spare threads
32: a = new IntegerAttribute(SocketClientFactory.MINSPARE_FREE_P,
33: new Integer(SocketClientFactory.MINSPARE_FREE),
34: Attribute.EDITABLE);
35: AttributeRegistry.registerAttribute(c, a);
36: // Maximum number of free spare threads
37: a = new IntegerAttribute(SocketClientFactory.MAXSPARE_FREE_P,
38: new Integer(SocketClientFactory.MAXSPARE_FREE),
39: Attribute.EDITABLE);
40: AttributeRegistry.registerAttribute(c, a);
41: // Maximum number of idle threads:
42: a = new IntegerAttribute(SocketClientFactory.MAXSPARE_IDLE_P,
43: new Integer(SocketClientFactory.MAXSPARE_IDLE),
44: Attribute.EDITABLE);
45: AttributeRegistry.registerAttribute(c, a);
46: // Maximum number of simultaneous connections:
47: a = new IntegerAttribute(SocketClientFactory.MAXCLIENTS_P,
48: new Integer(SocketClientFactory.MAXCLIENTS),
49: Attribute.EDITABLE);
50: AttributeRegistry.registerAttribute(c, a);
51: // Idle timeout for thread cache
52: a = new IntegerAttribute(SocketClientFactory.IDLETO_P,
53: new Integer(SocketClientFactory.IDLETO),
54: Attribute.EDITABLE);
55: AttributeRegistry.registerAttribute(c, a);
56: // Max number of threads
57: a = new IntegerAttribute(SocketClientFactory.MAXTHREADS_P,
58: new Integer(SocketClientFactory.MAXTHREADS),
59: Attribute.EDITABLE);
60: AttributeRegistry.registerAttribute(c, a);
61: // Specific address to bidn the server socket
62: a = new StringAttribute(SocketClientFactory.BINDADDR_P, null,
63: Attribute.EDITABLE);
64: AttributeRegistry.registerAttribute(c, a);
65: }
66:
67: /**
68: * Get this property set title.
69: * @return A String giving the title for this property set.
70: */
71:
72: public String getTitle() {
73: return title;
74: }
75:
76: SocketConnectionProp(String name, httpd server) {
77: super(name, server);
78: }
79: }
|