001: /*
002: * @(#)AutoDocLogSet.java
003: *
004: * Copyright (C) 2002-2003 Matt Albrecht
005: * groboclown@users.sourceforge.net
006: * http://groboutils.sourceforge.net
007: *
008: * Part of the GroboUtils package at:
009: * http://groboutils.sourceforge.net
010: *
011: * Permission is hereby granted, free of charge, to any person obtaining a
012: * copy of this software and associated documentation files (the "Software"),
013: * to deal in the Software without restriction, including without limitation
014: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
015: * and/or sell copies of the Software, and to permit persons to whom the
016: * Software is furnished to do so, subject to the following conditions:
017: *
018: * The above copyright notice and this permission notice shall be included in
019: * all copies or substantial portions of the Software.
020: *
021: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
022: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
023: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
024: * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
025: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
026: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
027: * DEALINGS IN THE SOFTWARE.
028: */
029: package net.sourceforge.groboutils.autodoc.v1.defimpl;
030:
031: import net.sourceforge.groboutils.autodoc.v1.AutoDocLog;
032:
033: import java.util.Vector;
034: import java.util.Enumeration;
035:
036: /**
037: * An interface for logging. This allows for an abstraction between the
038: * owning class and any underlying logging mechanism desired.
039: * <P>
040: * The actual meaning of the logging levels is implementation independent.
041: *
042: * @author Matt Albrecht <a href="mailto:groboclown@users.sourceforge.net">groboclown@users.sourceforge.net</a>
043: * @version $Date: 2003/02/10 22:52:11 $
044: * @since June 28, 2002
045: */
046: public class AutoDocLogSet implements AutoDocLog, IAutoDocSet {
047: private Vector set = new Vector();
048:
049: public void addLog(AutoDocLog log) {
050: this .set.addElement(log);
051: }
052:
053: public Enumeration getSetContents() {
054: return this .set.elements();
055: }
056:
057: public void debug( Object message )
058: {
059: Enumeration enum = getSetContents();
060: while (enum.hasMoreElements())
061: {
062: ((AutoDocLog)enum.nextElement()).debug( message );
063: }
064: }
065:
066: public void debug( Object message[] )
067: {
068: Enumeration enum = getSetContents();
069: while (enum.hasMoreElements())
070: {
071: ((AutoDocLog)enum.nextElement()).debug( message );
072: }
073: }
074:
075: public void debug( Object message, Throwable error )
076: {
077: Enumeration enum = getSetContents();
078: while (enum.hasMoreElements())
079: {
080: ((AutoDocLog)enum.nextElement()).debug( message, error );
081: }
082: }
083:
084: public void debug( Object message[], Throwable error )
085: {
086: Enumeration enum = getSetContents();
087: while (enum.hasMoreElements())
088: {
089: ((AutoDocLog)enum.nextElement()).debug( message, error );
090: }
091: }
092:
093: public void info( Object message )
094: {
095: Enumeration enum = getSetContents();
096: while (enum.hasMoreElements())
097: {
098: ((AutoDocLog)enum.nextElement()).info( message );
099: }
100: }
101:
102: public void info( Object message[] )
103: {
104: Enumeration enum = getSetContents();
105: while (enum.hasMoreElements())
106: {
107: ((AutoDocLog)enum.nextElement()).info( message );
108: }
109: }
110:
111: public void info( Object message, Throwable error )
112: {
113: Enumeration enum = getSetContents();
114: while (enum.hasMoreElements())
115: {
116: ((AutoDocLog)enum.nextElement()).info( message, error );
117: }
118: }
119:
120: public void info( Object message[], Throwable error )
121: {
122: Enumeration enum = getSetContents();
123: while (enum.hasMoreElements())
124: {
125: ((AutoDocLog)enum.nextElement()).info( message, error );
126: }
127: }
128:
129: public void warn( Object message )
130: {
131: Enumeration enum = getSetContents();
132: while (enum.hasMoreElements())
133: {
134: ((AutoDocLog)enum.nextElement()).warn( message );
135: }
136: }
137:
138: public void warn( Object message[] )
139: {
140: Enumeration enum = getSetContents();
141: while (enum.hasMoreElements())
142: {
143: ((AutoDocLog)enum.nextElement()).warn( message );
144: }
145: }
146:
147: public void warn( Object message, Throwable error )
148: {
149: Enumeration enum = getSetContents();
150: while (enum.hasMoreElements())
151: {
152: ((AutoDocLog)enum.nextElement()).warn( message, error );
153: }
154: }
155:
156: public void warn( Object message[], Throwable error )
157: {
158: Enumeration enum = getSetContents();
159: while (enum.hasMoreElements())
160: {
161: ((AutoDocLog)enum.nextElement()).warn( message, error );
162: }
163: }
164: }
|