KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > idaremedia > antx > feedback > EmitConfiguration


1 /**
2  * $Id: EmitConfiguration.java 180 2007-03-15 12:56:38Z ssmc $
3  * Copyright 2002-2003 iDare Media, Inc. All rights reserved.
4  *
5  * Originally written by iDare Media, Inc. for release into the public domain. This
6  * library, source form and binary form, is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License as published by the
8  * Free Software Foundation; either version 2 of the License, or (at your option) any later
9  * version.<p>
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU LGPL (GNU Lesser General Public License) for more details.<p>
14  *
15  * You should have received a copy of the GNU Lesser General Public License along with this
16  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite
17  * 330, Boston, MA 02111-1307 USA. The LGPL can be found online at
18  * http://www.fsf.org/copyleft/lesser.html<p>
19  *
20  * This product has been influenced by several projects within the open-source community.
21  * The JWare developers wish to acknowledge the open-source community's support. For more
22  * information regarding the open-source products used within JWare, please visit the
23  * JWare website.
24  *----------------------------------------------------------------------------------------*
25  * WEBSITE- http://www.jware.info EMAIL- inquiries@jware.info
26  *----------------------------------------------------------------------------------------*
27  **/

28
29 package com.idaremedia.antx.feedback;
30
31 import com.idaremedia.apis.DiagnosticsEmitter;
32
33 import com.idaremedia.antx.NoiseLevel;
34
35 /**
36  * Configuration information provided to {@linkplain EmitConfigurable} components.
37  * Configuration instances are both a source of default emit setup instructions as well
38  * as a DiagnosticsEmitter factory.
39  *
40  * @since JWare/AntX 0.1
41  * @author ssmc, &copy;2002-2003 <a HREF="http://www.jware.info">iDare&nbsp;Media,&nbsp;Inc.</a>
42  * @version 0.5
43  * @.safety n/a
44  * @.group api,infra
45  * @see EmitContext
46  **/

47
48 public interface EmitConfiguration
49 {
50     /**
51      * Returns the default grouping with which all messages sent
52      * from this configuration are associated. Returns <i>null</i>
53      * or the empty string if no such grouping.
54      * @since JWare/AntX 0.3
55      **/

56     String JavaDoc getFrom();
57
58
59     /**
60      * Returns the default grouping path separator string for
61      * this configuration. Most configurations use the period
62      * (&#46;) to separate grouping items.
63      * @since JWare/AntX 0.3
64      **/

65     String JavaDoc getGroupingPathSeparator();
66
67
68     /**
69      * Returns the default noise or priority level for this
70      * configuration. Can return <i>null</i> if this configuration
71      * has no custom level. Caller is free to use either some
72      * default configuration or a project-based default.
73      **/

74     NoiseLevel getNoiseLevel();
75
76
77     /**
78      * Returns <i>true</i> if emitted messages should be echoed
79      * to the standard Ant logging system.
80      **/

81     boolean shouldEcho();
82
83
84     /**
85      * Returns <i>true</i> if timestamp information should be
86      * included with emitted messages.
87      **/

88     boolean wantTimestamp();
89
90
91     /**
92      * Updates the name list of properties to be included with any
93      * messages. Returns <i>false</i> if no special properties have
94      * been included.
95      **/

96     boolean getPropertiesNameList(StringBuffer JavaDoc list);
97
98
99     /**
100      * Returns this configuration's default diagnostics emitter.
101      * Should never return <i>null</i>.
102      **/

103     DiagnosticsEmitter getEmitter();
104
105
106     /**
107      * Returns a specific diagnostics emitter from this configuration.
108      * Should never return <i>null</i>.
109      * @param grpId grouping path (like log4j's category name)
110      **/

111     DiagnosticsEmitter getCustomEmitter(String JavaDoc grpId);
112
113
114     /**
115      * Returns a configuration-formatted date/time string of
116      * given timestamp.
117      * @param ms timestamp as milliseconds since Jan 1st, 1970
118      **/

119     String JavaDoc stampify(long ms);
120 }
121
122
123 /* end-of-EmitConfiguration.java */
124
Popular Tags