KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > monolog > api > MonologFactory


1 /**
2  * Copyright (C) 2003 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * 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  */

18 package org.objectweb.util.monolog.api;
19
20 import org.objectweb.util.monolog.api.LoggerFactory;
21 import org.objectweb.util.monolog.api.LevelFactory;
22 import org.objectweb.util.monolog.api.HandlerFactory;
23 import org.objectweb.util.monolog.api.MonologFactoryListener;
24
25 import java.util.Properties JavaDoc;
26
27 /**
28  * A monolog factory is a factory for loggers, levels and handlers. It permits
29  * also to configure specificaly a wrapper.
30  *
31  * @author S.Chassande-Barrioz
32  */

33 public interface MonologFactory
34         extends LoggerFactory, LevelFactory, HandlerFactory {
35
36     /**
37      * This constant can be used to specify the type of specific configuration
38      * which you need. The possible value are DEFAULT, PROPERTY and XML.
39      */

40     String JavaDoc LOG_CONFIGURATION_TYPE = "log.config.type";
41
42     /**
43      * This constant represents the default configuration type. It means that
44      * the wrapper must initialized the underlying sub system with the default
45      * configuration.
46      */

47     String JavaDoc DEFAULT = "default";
48
49     /**
50      * This constant represents the property configuration type. It means that
51      * the wrapper must used the LOG_CONFIGURATION_FILE constant to fetch the
52      * property file which describes the configuration.
53      */

54     String JavaDoc PROPERTY = "property";
55
56     /**
57      * This constant represents the xml configuration type. It means that
58      * the wrapper must used the LOG_CONFIGURATION_FILE constant to fetch the
59      * xml file which describes the configuration.
60      */

61     String JavaDoc XML = "xml";
62
63     /**
64      * This constant can be used to specify the specific configuration file.
65      */

66     String JavaDoc LOG_CONFIGURATION_FILE = "log.config.file";
67
68     /**
69      * This constant can be used to specify if the configuration file must be
70      * searched into the classpath
71      */

72     String JavaDoc LOG_CONFIGURATION_FILE_USE_CLASSPATH
73         = "log.config.file.useclasspath";
74
75     /**
76      * This method permits to order to a monolog wrapper to configure the
77      * underlying log system.
78      * @param prop contains properties which describes the way to configure.
79      * In particular three properties could be used:
80      * <ul>
81      * <li>LOG_CONFIGURATION_TYPE</li>
82      * <li>LOG_CONFIGURATION_FILE</li>
83      * <li>LOG_CONFIGURATION_FILE_USE_CLASSPATH</li>
84      * <ul>
85      */

86     void configure(Properties JavaDoc prop) throws Exception JavaDoc;
87
88     /**
89      * register a listener for the events of this MonologFactory
90      */

91     void addMonologFactoryListener(MonologFactoryListener mfl);
92     
93     /**
94      * forget a listener for the events of this MonologFactory
95      */

96     void removeMonologFactoryListener (MonologFactoryListener mfl);
97 }
98
Popular Tags