01: // LoggingProp.java
02: // $Id: LoggingProp.java,v 1.11 2000/08/16 21:37:40 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;
07:
08: import org.w3c.jigsaw.config.PropertySet;
09:
10: import org.w3c.tools.resources.Attribute;
11: import org.w3c.tools.resources.AttributeRegistry;
12: import org.w3c.tools.resources.ClassAttribute;
13: import org.w3c.tools.resources.FileAttribute;
14: import org.w3c.tools.resources.IntegerAttribute;
15:
16: /**
17: * A wrapper class to give access to editable properties through a resource.
18: * This class allows to reuse entirely the generic resource editor to
19: * edit the properties of the server.
20: */
21:
22: class LoggingProp extends PropertySet {
23: private static String title = "Logging properties";
24:
25: static {
26: Class c = null;
27: Attribute a = null;
28:
29: try {
30: c = Class.forName("org.w3c.jigsaw.http.LoggingProp");
31: } catch (Exception ex) {
32: ex.printStackTrace();
33: System.exit(1);
34: }
35: // The class of the logger:
36: a = new ClassAttribute(httpd.LOGGER_P, null, Attribute.EDITABLE);
37: AttributeRegistry.registerAttribute(c, a);
38: // The error log file:
39: a = new FileAttribute(CommonLogger.ERRLOGNAME_P, null,
40: Attribute.EDITABLE);
41: AttributeRegistry.registerAttribute(c, a);
42: // The normal log:
43: a = new FileAttribute(CommonLogger.LOGNAME_P, null,
44: Attribute.EDITABLE);
45: AttributeRegistry.registerAttribute(c, a);
46: // The trace log:
47: a = new FileAttribute(CommonLogger.TRACELOGNAME_P, null,
48: Attribute.EDITABLE);
49: AttributeRegistry.registerAttribute(c, a);
50: // The log dir:
51: a = new FileAttribute(CommonLogger.LOGDIRNAME_P, null,
52: Attribute.EDITABLE);
53: AttributeRegistry.registerAttribute(c, a);
54: // The rotation level
55: a = new IntegerAttribute(CommonLogger.ROTATE_LEVEL_P,
56: new Integer(0), Attribute.EDITABLE);
57: AttributeRegistry.registerAttribute(c, a);
58: // The log buffer size:
59: a = new IntegerAttribute(CommonLogger.BUFSIZE_P, new Integer(
60: 8192), Attribute.EDITABLE);
61: AttributeRegistry.registerAttribute(c, a);
62: }
63:
64: /**
65: * Get this property set title.
66: * @return A String encoded title.
67: */
68:
69: public String getTitle() {
70: return title;
71: }
72:
73: LoggingProp(String name, httpd server) {
74: super(name, server);
75: }
76: }
|