01: /**
02: * Copyright (C) 2003 France Telecom R&D
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package org.objectweb.util.monolog.api;
18:
19: import org.objectweb.util.monolog.api.LoggerFactory;
20: import org.objectweb.util.monolog.api.LevelFactory;
21: import org.objectweb.util.monolog.api.HandlerFactory;
22: import org.objectweb.util.monolog.api.MonologFactoryListener;
23:
24: import java.util.Properties;
25:
26: /**
27: * A monolog factory is a factory for loggers, levels and handlers. It permits
28: * also to configure specificaly a wrapper.
29: *
30: * @author S.Chassande-Barrioz
31: */
32: public interface MonologFactory extends LoggerFactory, LevelFactory,
33: HandlerFactory {
34:
35: /**
36: * This constant can be used to specify the type of specific configuration
37: * which you need. The possible value are DEFAULT, PROPERTY and XML.
38: */
39: String LOG_CONFIGURATION_TYPE = "log.config.type";
40:
41: /**
42: * This constant represents the default configuration type. It means that
43: * the wrapper must initialized the underlying sub system with the default
44: * configuration.
45: */
46: String DEFAULT = "default";
47:
48: /**
49: * This constant represents the property configuration type. It means that
50: * the wrapper must used the LOG_CONFIGURATION_FILE constant to fetch the
51: * property file which describes the configuration.
52: */
53: String PROPERTY = "property";
54:
55: /**
56: * This constant represents the xml configuration type. It means that
57: * the wrapper must used the LOG_CONFIGURATION_FILE constant to fetch the
58: * xml file which describes the configuration.
59: */
60: String XML = "xml";
61:
62: /**
63: * This constant can be used to specify the specific configuration file.
64: */
65: String LOG_CONFIGURATION_FILE = "log.config.file";
66:
67: /**
68: * This constant can be used to specify if the configuration file must be
69: * searched into the classpath
70: */
71: String LOG_CONFIGURATION_FILE_USE_CLASSPATH = "log.config.file.useclasspath";
72:
73: /**
74: * This method permits to order to a monolog wrapper to configure the
75: * underlying log system.
76: * @param prop contains properties which describes the way to configure.
77: * In particular three properties could be used:
78: * <ul>
79: * <li>LOG_CONFIGURATION_TYPE</li>
80: * <li>LOG_CONFIGURATION_FILE</li>
81: * <li>LOG_CONFIGURATION_FILE_USE_CLASSPATH</li>
82: * <ul>
83: */
84: void configure(Properties prop) throws Exception;
85:
86: /**
87: * register a listener for the events of this MonologFactory
88: */
89: void addMonologFactoryListener(MonologFactoryListener mfl);
90:
91: /**
92: * forget a listener for the events of this MonologFactory
93: */
94: void removeMonologFactoryListener(MonologFactoryListener mfl);
95: }
|