[jboss-svn-commits] JBoss Common SVN: r2786 - in common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk: format and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Mar 31 11:34:38 EDT 2008
Author: adrian at jboss.org
Date: 2008-03-31 11:34:37 -0400 (Mon, 31 Mar 2008)
New Revision: 2786
Modified:
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JBossLevel.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JDK14LoggerPlugin.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JDKNDCProvider.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/SecurityActions.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/AbsoluteTimeDateFormat.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/DateTimeDateFormat.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/ISO8601DateFormat.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternConverter.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternFormatter.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternParser.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/DailyRollingFileHandler.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/FileHandler.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/WriterHandler.java
common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/xml/DOMConfigurator.java
Log:
Sourcecode tidyup
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JBossLevel.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JBossLevel.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JBossLevel.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -6,6 +6,8 @@
*
*/
public final class JBossLevel extends Level {
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
protected JBossLevel(final String name, final int value) {
super(name, value);
}
@@ -17,6 +19,7 @@
public static final JBossLevel FATAL = new JBossLevel("FATAL", 1100);
public static final JBossLevel ERROR = new JBossLevel("ERROR", 1000);
public static final JBossLevel WARN = new JBossLevel("WARN", 900);
+ @SuppressWarnings("hiding")
public static final JBossLevel INFO = new JBossLevel("INFO", 800);
public static final JBossLevel DEBUG = new JBossLevel("DEBUG", 500);
public static final JBossLevel TRACE = new JBossLevel("TRACE", 400);
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JDK14LoggerPlugin.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JDK14LoggerPlugin.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JDK14LoggerPlugin.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -71,6 +71,7 @@
doLog(JBossLevel.TRACE, message, t);
}
+ @Deprecated
public boolean isDebugEnabled()
{
return log.isLoggable(JBossLevel.DEBUG);
@@ -86,6 +87,7 @@
doLog(JBossLevel.DEBUG, message, t);
}
+ @Deprecated
public boolean isInfoEnabled()
{
return log.isLoggable(JBossLevel.INFO);
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JDKNDCProvider.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JDKNDCProvider.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/JDKNDCProvider.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.EmptyStackException;
-import java.util.Stack;
import org.jboss.logging.NDCProvider;
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/SecurityActions.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/SecurityActions.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/SecurityActions.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -49,9 +49,9 @@
{
public String getProperty(final String name)
{
- return (String) AccessController.doPrivileged(new PrivilegedAction()
+ return AccessController.doPrivileged(new PrivilegedAction<String>()
{
- public Object run()
+ public String run()
{
return System.getProperty(name);
}
@@ -59,9 +59,9 @@
}
public String getProperty(final String name, final String def)
{
- return (String)AccessController.doPrivileged(new PrivilegedAction()
+ return AccessController.doPrivileged(new PrivilegedAction<String>()
{
- public Object run()
+ public String run()
{
return System.getProperty(name, def);
}
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/AbsoluteTimeDateFormat.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/AbsoluteTimeDateFormat.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/AbsoluteTimeDateFormat.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -34,23 +34,26 @@
public class AbsoluteTimeDateFormat extends DateFormat
{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
/**
* String constant used to specify {@link
- * org.apache.log4j.helpers.AbsoluteTimeDateFormat} in layouts. Current
+ * AbsoluteTimeDateFormat} in layouts. Current
* value is <b>ABSOLUTE</b>.
*/
public final static String ABS_TIME_DATE_FORMAT = "ABSOLUTE";
/**
* String constant used to specify {@link
- * org.apache.log4j.helpers.DateTimeDateFormat} in layouts. Current
+ * DateTimeDateFormat} in layouts. Current
* value is <b>DATE</b>.
*/
public final static String DATE_AND_TIME_DATE_FORMAT = "DATE";
/**
* String constant used to specify {@link
- * org.apache.log4j.helpers.ISO8601DateFormat} in layouts. Current
+ * ISO8601DateFormat} in layouts. Current
* value is <b>ISO8601</b>.
*/
public final static String ISO8601_DATE_FORMAT = "ISO8601";
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/DateTimeDateFormat.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/DateTimeDateFormat.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/DateTimeDateFormat.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -34,6 +34,8 @@
public class DateTimeDateFormat extends AbsoluteTimeDateFormat
{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
String[] shortMonths;
public DateTimeDateFormat()
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/ISO8601DateFormat.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/ISO8601DateFormat.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/ISO8601DateFormat.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -41,6 +41,9 @@
public class ISO8601DateFormat extends AbsoluteTimeDateFormat
{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
public ISO8601DateFormat()
{
}
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternConverter.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternConverter.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternConverter.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -51,12 +51,16 @@
/**
* Derived pattern converters must override this method in order to
* convert conversion specifiers in the correct way.
+ * @param event
+ * @return the converted record
*/
abstract
protected String convert(LogRecord event);
/**
* A template method for formatting in a converter specific way.
+ * @param sbuf
+ * @param e
*/
public void format(StringBuffer sbuf, LogRecord e)
{
@@ -96,6 +100,8 @@
/**
* Fast space padding method.
+ * @param sbuf
+ * @param length
*/
public void spacePad(StringBuffer sbuf, int length)
{
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternFormatter.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternFormatter.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternFormatter.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -18,6 +18,8 @@
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
+import org.jboss.logging.MDC;
+
// Contributors: Nelson Minar <nelson at monkey.org>
// Anders Kristensen <akristensen at dynamicsoft.com>
@@ -25,7 +27,7 @@
* A flexible layout configurable with pattern string.
* <p/>
* <p>The goal of this class is to {@link #format format} a {@link
- * LoggingEvent} and return the results as a String. The results
+ * LogRecord} and return the results as a String. The results
* depend on the <em>conversion pattern</em>.
* <p/>
* <p>The conversion pattern is closely related to the conversion
@@ -128,11 +130,11 @@
* <p>For better results it is recommended to use the log4j date
* formatters. These can be specified using one of the strings
* "ABSOLUTE", "DATE" and "ISO8601" for specifying {@link
- * org.apache.log4j.helpers.AbsoluteTimeDateFormat
+ * AbsoluteTimeDateFormat
* AbsoluteTimeDateFormat}, {@link
- * org.apache.log4j.helpers.DateTimeDateFormat DateTimeDateFormat}
+ * DateTimeDateFormat DateTimeDateFormat}
* and respectively {@link
- * org.apache.log4j.helpers.ISO8601DateFormat
+ * ISO8601DateFormat
* ISO8601DateFormat}. For example, <b>%d{ISO8601}</b> or
* <b>%d{ABSOLUTE}</b>.
* <p/>
@@ -412,8 +414,6 @@
private PatternConverter head;
- private String timezone;
-
/**
* Constructs a PatternLayout using the DEFAULT_LAYOUT_PATTERN.
* <p/>
@@ -426,6 +426,7 @@
/**
* Constructs a PatternLayout using the supplied conversion pattern.
+ * @param pattern
*/
public PatternFormatter(String pattern)
{
@@ -438,6 +439,7 @@
* Set the <b>ConversionPattern</b> option. This is the string which
* controls formatting and consists of a mix of literal content and
* conversion specifiers.
+ * @param conversionPattern
*/
public void setConversionPattern(String conversionPattern)
{
@@ -447,6 +449,7 @@
/**
* Returns the value of the <b>ConversionPattern</b> option.
+ * @return the pattern
*/
public String getConversionPattern()
{
@@ -463,9 +466,10 @@
/**
* The PatternLayout does not handle the throwable contained within
- * {@link LoggingEvent LoggingEvents}. Thus, it returns
+ * {@link LogRecord LoggingEvents}. Thus, it returns
* <code>true</code>.
*
+ * @return whether to ignore throwables
* @since 0.8.4
*/
public boolean ignoresThrowable()
@@ -478,6 +482,8 @@
* may override this to return a subclass of PatternParser which recognize
* custom conversion characters.
*
+ * @param pattern the pattern
+ * @return the parser
* @since 0.9.0
*/
protected PatternParser createPatternParser(String pattern)
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternParser.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternParser.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/format/PatternParser.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -28,11 +28,7 @@
// Reinhard Deschler <reinhard.deschler at web.de>
/**
- * Most of the work of the {@link org.apache.log4j.PatternLayout} class
- * is delegated to the PatternParser class.
- * <p/>
- * <p>It is this class that parses conversion patterns and creates
- * a chained list of {@link OptionConverter OptionConverters}.
+ * Pattern Parser
*
* @author <a href=mailto:"cakalijp at Maritz.com">James P. Cakalic</a>
* @author Ceki Gülcü
@@ -50,7 +46,6 @@
private static final int LITERAL_STATE = 0;
private static final int CONVERTER_STATE = 1;
- private static final int MINUS_STATE = 2;
private static final int DOT_STATE = 3;
private static final int MIN_STATE = 4;
private static final int MAX_STATE = 5;
@@ -116,6 +111,7 @@
/**
* The option is expected to be in decimal and positive. In case of
* error, zero is returned.
+ * @return the precision option
*/
protected int extractPrecisionOption()
{
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/DailyRollingFileHandler.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/DailyRollingFileHandler.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/DailyRollingFileHandler.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -28,7 +28,7 @@
import java.io.File;
/**
- DailyRollingFileAppender extends {@link FileAppender} so that the
+ DailyRollingFileAppender extends {@link FileHandler} so that the
underlying file is rolled over at a user chosen frequency.
<p>The rolling schedule is specified by the <b>DatePattern</b>
@@ -190,6 +190,10 @@
* Instantiate a <code>DailyRollingFileAppender</code> and open the
* file designated by <code>filename</code>. The opened filename will
* become the ouput destination for this appender.
+ * @param layout
+ * @param filename
+ * @param datePattern
+ * @throws IOException
*/
public DailyRollingFileHandler(Formatter layout, String filename,
String datePattern) throws IOException
@@ -203,6 +207,7 @@
* The <b>DatePattern</b> takes a string in the same format as
* expected by {@link SimpleDateFormat}. This options determines the
* rollover schedule.
+ * @param pattern
*/
public void setDatePattern(String pattern)
{
@@ -211,6 +216,7 @@
/**
* Returns the value of the <b>DatePattern</b> option.
+ * @return the date pattern
*/
public String getDatePattern()
{
@@ -397,6 +403,8 @@
class RollingCalendar extends GregorianCalendar
{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
int type = DailyRollingFileHandler.TOP_OF_TROUBLE;
RollingCalendar()
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/FileHandler.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/FileHandler.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/FileHandler.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -15,14 +15,12 @@
*/
package org.jboss.logging.jdk.handlers;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.FileOutputStream;
-import java.io.FileNotFoundException;
-import java.io.File;
-import java.io.Writer;
-import java.io.BufferedWriter;
+import java.util.logging.ErrorManager;
import java.util.logging.Formatter;
-import java.util.logging.ErrorManager;
/**
* FileAppender appends log events to a file.
@@ -67,6 +65,12 @@
* <p/>
* <p>If the <code>bufferedIO</code> parameter is <code>true</code>,
* then buffered IO will be used to write to the output file.
+ * @param layout
+ * @param filename
+ * @param append
+ * @param bufferedIO
+ * @param bufferSize
+ * @throws IOException
*/
public FileHandler(Formatter layout, String filename, boolean append, boolean bufferedIO,
int bufferSize)
@@ -84,6 +88,10 @@
* <p>If the <code>append</code> parameter is true, the file will be
* appended to. Otherwise, the file designated by
* <code>filename</code> will be truncated before being opened.
+ * @param layout
+ * @param filename
+ * @param append
+ * @throws IOException
*/
public FileHandler(Formatter layout, String filename, boolean append)
throws IOException
@@ -97,6 +105,9 @@
* destination for this appender.
* <p/>
* <p>The file will be appended to.
+ * @param layout
+ * @param filename
+ * @throws IOException
*/
public FileHandler(Formatter layout, String filename) throws IOException
{
@@ -109,6 +120,7 @@
* <p/>
* <p>Note: Actual opening of the file is made when {@link
* #activateOptions} is called, not when the options are set.
+ * @param file
*/
public void setFile(String file)
{
@@ -120,6 +132,7 @@
/**
* Returns the value of the <b>Append</b> option.
+ * @return whether to append to the file
*/
public boolean getAppend()
{
@@ -129,6 +142,7 @@
/**
* Returns the value of the <b>File</b> option.
+ * @return the file name
*/
public String getFile()
{
@@ -137,7 +151,7 @@
/**
* If the value of <b>File</b> is not <code>null</code>, then {@link
- * #setFile} is called with the values of <b>File</b> and
+ * #setFile(String)} is called with the values of <b>File</b> and
* <b>Append</b> properties.
*
*/
@@ -166,12 +180,13 @@
/**
* The <b>Append</b> option takes a boolean value. It is set to
* <code>true</code> by default. If true, then <code>File</code>
- * will be opened in append mode by {@link #setFile setFile} (see
- * above). Otherwise, {@link #setFile setFile} will open
+ * will be opened in append mode by {@link #setFile(String) setFile} (see
+ * above). Otherwise, {@link #setFile(String) setFile} will open
* <code>File</code> in truncate mode.
* <p/>
* <p>Note: Actual opening of the file is made when {@link
* #activateOptions} is called, not when the options are set.
+ * @param flag
*/
public void setAppend(boolean flag)
{
@@ -192,6 +207,9 @@
* @param fileName The path to the log file.
* @param append If true will append to fileName. Otherwise will
* truncate fileName.
+ * @param bufferedIO
+ * @param bufferSize
+ * @throws IOException
*/
public synchronized void setFile(String fileName, boolean append, boolean bufferedIO, int bufferSize)
throws IOException
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/WriterHandler.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/WriterHandler.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/handlers/WriterHandler.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -71,6 +71,7 @@
* skipped, then it is likely that the last few log events will not
* be recorded on disk when the application exits. This is a high
* price to pay even for a 20% performance gain.
+ * @param value
*/
public void setImmediateFlush(boolean value)
{
@@ -78,7 +79,7 @@
}
/**
- * Returns value of the <b>ImmediateFlush</b> option.
+ * @return value of the <b>ImmediateFlush</b> option.
*/
public boolean getImmediateFlush()
{
@@ -98,6 +99,7 @@
* <p/>
* BufferedIO will significatnly increase performance on heavily
* loaded systems.
+ * @param bufferedIO
*/
public void setBufferedIO(boolean bufferedIO)
{
@@ -115,6 +117,7 @@
/**
* Set the size of the IO buffer.
+ * @param bufferSize
*/
public void setBufferSize(int bufferSize)
{
@@ -206,6 +209,7 @@
* Actual writing occurs here.
* Most subclasses of WriterHandler will need to
* override this method.
+ * @param record
*/
protected void subPublish(LogRecord record)
{
Modified: common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/xml/DOMConfigurator.java
===================================================================
--- common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/xml/DOMConfigurator.java 2008-03-31 15:12:39 UTC (rev 2785)
+++ common-logging-jdk/trunk/src/main/java/org/jboss/logging/jdk/xml/DOMConfigurator.java 2008-03-31 15:34:37 UTC (rev 2786)
@@ -26,20 +26,20 @@
import java.util.Properties;
import java.util.logging.ErrorManager;
import java.util.logging.Filter;
+import java.util.logging.Formatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
-import java.util.logging.Formatter;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
+import org.jboss.logging.jdk.handlers.HandlerSkeleton;
+import org.jboss.util.StringPropertyReplacer;
import org.jboss.util.propertyeditor.PropertyEditors;
-import org.jboss.util.StringPropertyReplacer;
import org.jboss.util.xml.JBossEntityResolver;
-import org.jboss.logging.jdk.handlers.HandlerSkeleton;
-import org.jboss.logging.jdk.JBossLevel;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -107,21 +107,21 @@
static final String RENDERED_CLASS_ATTR = "renderedClass";
static final String EMPTY_STR = "";
- static final Class[] ONE_STRING_PARAM = new Class[]{String.class};
+ static final Class<?>[] ONE_STRING_PARAM = new Class[]{String.class};
final static String dbfKey = "javax.xml.parsers.DocumentBuilderFactory";
// key: appenderName, value: appender
- private Hashtable appenderBag;
+ private Hashtable<String, Handler> appenderBag;
private ErrorManager errorLog;
- private Properties props;
private LogManager repository;
private boolean debug;
/**
* Configure jdk using a <code>configuration</code> element as
* defined in the jdk.dtd.
+ * @param element
*/
static public void configure(Element element)
{
@@ -131,6 +131,8 @@
/**
* A static version of {@link #doConfigure(String, LogManager)}.
+ * @param filename the file name
+ * @throws FactoryConfigurationError for any error
*/
static public void configure(String filename)
throws FactoryConfigurationError
@@ -141,6 +143,8 @@
/**
* A static version of {@link #doConfigure(java.net.URL, LogManager)}.
+ * @param url the url
+ * @throws FactoryConfigurationError for any error
*/
static public void configure(URL url)
throws FactoryConfigurationError
@@ -150,6 +154,8 @@
/**
* A static version of {@link #doConfigure(java.net.URL, LogManager)}.
+ * @param is the input stream
+ * @throws FactoryConfigurationError for any error
*/
static public void configure(InputStream is)
throws FactoryConfigurationError
@@ -167,16 +173,20 @@
public DOMConfigurator(ErrorManager errorLog)
{
- appenderBag = new Hashtable();
+ appenderBag = new Hashtable<String, Handler>();
this.errorLog = errorLog;
}
/**
* Used internally to parse appenders by IDREF name.
+ *
+ * @param doc the document
+ * @param appenderName the appender name
+ * @return the handler
*/
protected Handler findHandlerByName(Document doc, String appenderName)
{
- Handler appender = (Handler) appenderBag.get(appenderName);
+ Handler appender = appenderBag.get(appenderName);
if (appender != null)
{
@@ -203,6 +213,8 @@
/**
* Used internally to parse appenders by IDREF element.
+ * @param appenderRef
+ * @return the handler
*/
protected Handler findHandlerByReference(Element appenderRef)
{
@@ -213,6 +225,9 @@
/**
* Used internally to parse an appender element.
+ *
+ * @param appenderElement the append element
+ * @return the handler
*/
protected Handler parseHandler(Element appenderElement)
{
@@ -291,19 +306,27 @@
/**
* Used internally to parse an {@link ErrorManager} element.
+ *
+ * @param element the xml element
+ * @param appender the appender
+ * @throws Exception for any error
*/
protected void parseErrorManager(Element element, Handler appender)
throws Exception
{
String className = subst(element.getAttribute(CLASS_ATTR));
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class ehClazz = loader.loadClass(className);
+ Class<?> ehClazz = loader.loadClass(className);
ErrorManager eh = (ErrorManager) ehClazz.newInstance();
appender.setErrorManager(eh);
}
/**
* Used internally to parse a filter element.
+ *
+ * @param element the xml element
+ * @param appender the appender
+ * @throws Exception for any error
*/
protected void parseFilters(Element element, Handler appender)
throws Exception
@@ -340,6 +363,9 @@
/**
* Used internally to parse an category element.
+ *
+ * @param loggerElement the xml element
+ * @throws Exception for any error
*/
protected void parseCategory(Element loggerElement)
throws Exception
@@ -368,9 +394,9 @@
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class c = loader.loadClass(className);
- Class[] sig = {String.class, String.class};
- Constructor ctor = c.getConstructor(sig);
+ Class<?> c = loader.loadClass(className);
+ Class<?>[] sig = {String.class, String.class};
+ Constructor<?> ctor = c.getConstructor(sig);
Object[] args = {catName, null};
logger = (Logger) ctor.newInstance(args);
}
@@ -398,6 +424,9 @@
/**
* Used internally to parse the category factory element.
+ *
+ * @param factoryElement the xml element
+ * @throws Exception for any error
*/
protected void parseCategoryFactory(Element factoryElement)
throws Exception
@@ -441,6 +470,9 @@
/**
* Used internally to parse the root category element.
+ *
+ * @param rootElement the xml element
+ * @throws Exception for any error
*/
protected void parseRoot(Element rootElement)
throws Exception
@@ -461,6 +493,11 @@
/**
* Used internally to parse the children of a category element.
+ *
+ * @param catElement the xml element
+ * @param logger the logger
+ * @param isRoot whether this is the root
+ * @throws Exception for any error
*/
protected void parseChildrenOfLoggerElement(Element catElement,
Logger logger, boolean isRoot)
@@ -522,6 +559,9 @@
/**
* Used internally to parse a layout element.
+ *
+ * @param layout_element the xml element
+ * @return the formatter
*/
protected Formatter parseLayout(Element layout_element)
{
@@ -562,12 +602,14 @@
protected void parseRenderer(Element element)
{
- String renderingClass = subst(element.getAttribute(RENDERING_CLASS_ATTR));
- String renderedClass = subst(element.getAttribute(RENDERED_CLASS_ATTR));
}
/**
* Used internally to parse a level element.
+ *
+ * @param element the element
+ * @param logger the logger
+ * @param isRoot whether it is the root
*/
protected void parseLevel(Element element, Logger logger, boolean isRoot)
{
@@ -611,10 +653,10 @@
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class clazz = loader.loadClass(className);
- Class[] sig = {String.class, int.class};
+ Class<?> clazz = loader.loadClass(className);
+ Class<?>[] sig = {String.class, int.class};
Object[] args = {levelName, new Integer(Level.FINEST.intValue())};
- Constructor ctor = clazz.getConstructor(sig);
+ Constructor<?> ctor = clazz.getConstructor(sig);
Level pri = (Level) ctor.newInstance(args);
logger.setLevel(pri);
}
@@ -682,6 +724,9 @@
/**
* Configure jdk by reading in a jdk.dtd compliant XML
* configuration file.
+ * @param inputStream
+ * @param repository
+ * @throws FactoryConfigurationError
*/
public void doConfigure(final InputStream inputStream, LogManager repository)
throws FactoryConfigurationError
@@ -706,6 +751,9 @@
/**
* Configure jdk by reading in a jdk.dtd compliant XML
* configuration file.
+ * @param reader
+ * @param repository
+ * @throws FactoryConfigurationError
*/
public void doConfigure(final Reader reader, LogManager repository)
throws FactoryConfigurationError
@@ -730,6 +778,9 @@
/**
* Configure jdk by reading in a jdk.dtd compliant XML
* configuration file.
+ * @param inputSource
+ * @param repository
+ * @throws FactoryConfigurationError
*/
protected void doConfigure(final InputSource inputSource, LogManager repository)
throws FactoryConfigurationError
@@ -793,6 +844,8 @@
/**
* Configure by taking in an DOM element.
+ * @param element
+ * @param repository
*/
public void doConfigure(Element element, LogManager repository)
{
@@ -804,6 +857,7 @@
* Used internally to configure the jdk framework by parsing a DOM
* tree of XML elements based on <a
* href="doc-files/jdk.dtd">jdk.dtd</a>.
+ * @param element
*/
protected void parse(Element element)
{
@@ -967,7 +1021,7 @@
if( debug )
System.out.println(msg);
}
- Object instantiateByClassName(String className, Class superClass,
+ Object instantiateByClassName(String className, Class<?> superClass,
Object defaultValue)
{
if (className != null)
@@ -975,7 +1029,7 @@
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class classObj = loader.loadClass(className);
+ Class<?> classObj = loader.loadClass(className);
if (!superClass.isAssignableFrom(classObj))
{
errorLog.error("A \"" + className + "\" object is not assignable to a \"" +
More information about the jboss-svn-commits
mailing list