KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * Copyright (C) 2001-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 /**
21  * <P>The aims of this interface is to provide Logger instances, to allow
22  * instrumentation to be independent of the logging implementation and
23  * to allow the use of the same logging implementation for all the
24  * components of a given application.</P>
25  *
26  * <P>This interface provides two methods to fetch Logger. If the Logger
27  * described by the parameters does not exist, then the LoggerFactory
28  * must return a new instance of Logger.</P>
29  *
30  * <P>The LoggerFactory interface also provides accessors to a resource
31  * bundle name associated to a LoggerFactory. This interface allows defining
32  * a resource bundle name used by all Logger.</P>
33  *
34  * @author S.Chassande-Barrioz
35  */

36 public interface LoggerFactory {
37     
38     /**
39      * This method permits to fetch a Logger. If the Logger
40      * described by the parameters does not exist, then the LoggerFactory
41      * must return a new instance of Logger.
42      * The key parameter is a description of the expected Logger. In simple
43      * cases, the key is the initial topic of the Logger.
44      */

45     Logger getLogger(String JavaDoc key);
46     
47     /**
48      * This method permits to fetch a Logger. If the Logger
49      * described by the parameters does not exist, then the LoggerFactory
50      * must return a new instance of Logger.
51      * The key parameter is a description of the expected Logger. In simple
52      * cases, the key is the initial topic of the Logger.
53      * The resourceBundleName parameter allows specifying the name of a
54      * resource bundle in order to internationalise the logging.
55      */

56     Logger getLogger(String JavaDoc key, String JavaDoc resourceBundleName);
57     
58     /**
59      * Accessors to a resource bundle name associated to a LoggerFactory.
60      */

61     String JavaDoc getResourceBundleName();
62     
63     /**
64      * Accessors to a resource bundle name associated to a LoggerFactory.
65      */

66     void setResourceBundleName(String JavaDoc resourceBundleName);
67
68     /**
69      * It retrieves a list of all loggers.
70      */

71     Logger[] getLoggers();
72     
73     /**
74      * A Logger Factory can have a prefix helping for isolate applications. To
75      * assume the isolation, a prefix can be used for topic name.
76      * @return the prefix of the topic name.
77      */

78     String JavaDoc getTopicPrefix();
79 }
80
Popular Tags