KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Handler is an output. For example a
22  * handler might be a console, a file, a socket, or a Logger.
23  *
24  * @author Sebastien Chassande-Barrioz
25  */

26 public interface Handler {
27
28     // Handler constant types //
29
//------------------------//
30

31     /**
32      * This constant is used to represent an handler which stores message into
33      * one file.
34      * @deprecated the type is a string now: "file"
35      */

36     byte FILE_HANDLER_TYPE = 1;
37
38     /**
39      * This constant is used to represent an handler which prints message on
40      * a console.
41      * @deprecated the type is a string now: "console"
42      */

43     byte CONSOLE_HANDLER_TYPE = 2;
44
45     /**
46      * This constant is used to represent an handler which stores message into
47      * several files.
48      */

49     byte ROLLING_FILE_HANDLER_TYPE = 3;
50
51     /**
52      * This constant is used to represent an handler which stores message into
53      * several files.
54      * @deprecated the type is a string now: "generic"
55      */

56     byte GENERIC_HANDLER_TYPE = 4;
57
58     /**
59      * This constant is used to represent an handler which is a Logger.
60      * @deprecated the type is a string now: "logger"
61      */

62     byte LOGGER_HANDLER_TYPE = 5;
63
64     /**
65      * This constant is used to represent a handler witch is a JMX notification emetter.
66      * @deprecated the type is a string now: "logger"
67      */

68     byte JMX_HANDLER_TYPE = 6;
69
70     // Handler attributes //
71
//--------------------//
72

73     String JavaDoc OUTPUT_ATTRIBUTE = "output";
74     String JavaDoc PATTERN_ATTRIBUTE = "pattern";
75     String JavaDoc LEVEL_ATTRIBUTE = "level";
76
77     String JavaDoc APPEND_MODE_ATTRIBUTE = "appendMode";
78
79     String JavaDoc FILE_NUMBER_ATTRIBUTE = "fileNumber";
80     String JavaDoc MAX_SIZE_ATTRIBUTE = "maxSize";
81     String JavaDoc BUFFER_ATTRIBUTE = "bufferSize";
82
83
84     /**
85      * It retrieves the name of the handler
86      */

87     String JavaDoc getName();
88
89     /**
90      * It assigns the name of the handler
91      */

92     void setName(String JavaDoc name);
93
94     /**
95      * It retrieves the Handler type
96      */

97     String JavaDoc getType();
98
99     /**
100      * It retrieves the attributes of the handler
101      */

102     String JavaDoc[] getAttributeNames();
103
104     /**
105      * It retrieves the value of an attribute value of the handler.
106      * @param name is an attribute name
107      */

108     Object JavaDoc getAttribute(String JavaDoc name);
109
110     /**
111      * It assigns an attributte to the handler.
112      * @param name is the attribute name
113      * @param value is the attribute value
114      * @return the old value is the attribute was already defined
115      */

116     Object JavaDoc setAttribute(String JavaDoc name, Object JavaDoc value);
117 }
118
Popular Tags