[slf4j-dev] svn commit: r227 - in slf4j/trunk/src/java/org/slf4j: . impl spi

ceki at slf4j.org ceki at slf4j.org
Sun Aug 28 17:59:30 CEST 2005


Author: ceki
Date: Sun Aug 28 17:59:29 2005
New Revision: 227

Modified:
   slf4j/trunk/src/java/org/slf4j/LoggerFactory.java
   slf4j/trunk/src/java/org/slf4j/MarkerFactory.java
   slf4j/trunk/src/java/org/slf4j/impl/SystemPropBinder.java
   slf4j/trunk/src/java/org/slf4j/spi/MarkerFactoryBinder.java
Log:
javadoc improvements

Modified: slf4j/trunk/src/java/org/slf4j/LoggerFactory.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/LoggerFactory.java	(original)
+++ slf4j/trunk/src/java/org/slf4j/LoggerFactory.java	Sun Aug 28 17:59:29 2005
@@ -59,7 +59,6 @@
  */
 public final class LoggerFactory {
   
-  static StaticBinder staticBinder = new StaticBinder();
   static ILoggerFactory loggerFactory;
 
   // private constructor prevents instantiation
@@ -80,11 +79,11 @@
        		+ "] adapter factory from system properties.");
     } else {
       try { // otherwise bind statically
-          loggerFactory = staticBinder.getLoggerFactory();
+          loggerFactory = StaticBinder.SINGLETON.getLoggerFactory();
       } catch (Exception e) {
         // we should never get here
         Util.reportFailure(
-          "Could not instantiate instance of class [" + staticBinder.getLoggerFactoryClassStr() + "]",
+          "Could not instantiate instance of class [" + StaticBinder.SINGLETON.getLoggerFactoryClassStr() + "]",
           e);
       }
     }

Modified: slf4j/trunk/src/java/org/slf4j/MarkerFactory.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/MarkerFactory.java	(original)
+++ slf4j/trunk/src/java/org/slf4j/MarkerFactory.java	Sun Aug 28 17:59:29 2005
@@ -39,63 +39,62 @@
 // WARNING $SLF4J_HOME/src/filtered-java/org/slf4j/MarkerFactory.java
 // WARNING
 
-
 /**
- * MarkerFactory is a utility class producing {@link Marker} instances as appropriate
- * for the logging system currently in use.
+ * MarkerFactory is a utility class producing {@link Marker}instances as
+ * appropriate for the logging system currently in use.
  * 
- * <p>This class is essentially implemented as a wrapper around an {@link IMarkerFactory}
- * instance bound at compile time.
+ * <p>
+ * This class is essentially implemented as a wrapper around an
+ * {@link IMarkerFactory}instance bound at compile time.
  * 
- * <p>Please note that all methods in this class are static.
+ * <p>
+ * Please note that all methods in this class are static.
  * 
- * @author <a href="http://www.qos.ch/log4j/">Ceki G&uuml;lc&uuml;</a>
+ * @author <a href="http://www.qos.ch/log4j/">Ceki G&uuml;lc&uuml; </a>
  */
 public class MarkerFactory {
   static IMarkerFactory markerFactory;
-  static StaticBinder staticBinder = new StaticBinder();
-  
-  private MarkerFactory() {      
+
+  private MarkerFactory() {
   }
-  
+
   // 
   // WARNING Do not modify copies but the original at
   //         $SLF4J_HOME/src/filtered-java/org/slf4j/
   //
   static {
-   
+
     try {
-      markerFactory = staticBinder.getMarkerFactory();
-     } catch (Exception e) {
-       // we should never get here
-       Util.reportFailure(
-           "Could not instantiate instance of class [" + staticBinder.getMarkerFactoryClassStr() + "]",
-           e);
-     }      
+      markerFactory = StaticBinder.SINGLETON.getMarkerFactory();
+    } catch (Exception e) {
+      // we should never get here
+      Util.reportFailure("Could not instantiate instance of class ["
+          + StaticBinder.SINGLETON.getMarkerFactoryClassStr() + "]", e);
+    }
   }
-  
+
   /**
    * Return a Marker instnace as specified by the name parameter using the
    * previously bound {@link IMarkerFactory}instance.
    * 
    * @param name
-   *            The name of the {@link Marker}object to return.
+   *          The name of the {@link Marker}object to return.
    * @return marker
    */
   public static Marker getMarker(String name) {
     return markerFactory.getMarker(name);
   }
-  
+
   /**
-   * Return the {@link IMarkerFactory} instance in use.
+   * Return the {@link IMarkerFactory}instance in use.
    * 
    * <p>
-   * Usually, the IMarkerFactory instance is bound with this class
-   * at compile time.
+   * Usually, the IMarkerFactory instance is bound with this class at compile
+   * time.
    * 
    * @return the IMarkerFactory instance in use
    */
   public static IMarkerFactory getIMarkerFactory() {
-    return  markerFactory;
+    return markerFactory;
   }
-}
+}
\ No newline at end of file

Modified: slf4j/trunk/src/java/org/slf4j/impl/SystemPropBinder.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/impl/SystemPropBinder.java	(original)
+++ slf4j/trunk/src/java/org/slf4j/impl/SystemPropBinder.java	Sun Aug 28 17:59:29 2005
@@ -1,5 +1,35 @@
-// TOTO
-
+/*
+ * Copyright (c) 2004-2005 SLF4J.ORG
+ * Copyright (c) 2004-2005 QOS.ch
+ *
+ * All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to  deal in  the Software without  restriction, including
+ * without limitation  the rights to  use, copy, modify,  merge, publish,
+ * distribute, and/or sell copies of  the Software, and to permit persons
+ * to whom  the Software is furnished  to do so, provided  that the above
+ * copyright notice(s) and this permission notice appear in all copies of
+ * the  Software and  that both  the above  copyright notice(s)  and this
+ * permission notice appear in supporting documentation.
+ *
+ * THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+ * EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR  A PARTICULAR PURPOSE AND NONINFRINGEMENT
+ * OF  THIRD PARTY  RIGHTS. IN  NO EVENT  SHALL THE  COPYRIGHT  HOLDER OR
+ * HOLDERS  INCLUDED IN  THIS  NOTICE BE  LIABLE  FOR ANY  CLAIM, OR  ANY
+ * SPECIAL INDIRECT  OR CONSEQUENTIAL DAMAGES, OR  ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS  OF USE, DATA OR PROFITS, WHETHER  IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE  OR OTHER TORTIOUS  ACTION, ARISING OUT OF  OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Except as  contained in  this notice, the  name of a  copyright holder
+ * shall not be used in advertising or otherwise to promote the sale, use
+ * or other dealings in this Software without prior written authorization
+ * of the copyright holder.
+ *
+ */
 package org.slf4j.impl;
 
 import org.slf4j.Constants;
@@ -7,17 +37,18 @@
 import org.slf4j.spi.LoggerFactoryBinder;
 
 /**
- * @author ceki
+ * Allows for dynamic binding as specified by information contained
+ * in the {@link Constants#LOGGER_FACTORY_PROPERTY} java system property.
  * 
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
+ * @author <a href="http://www.qos.ch/log4j/">Ceki G&uuml;lc&uuml;</a>
  */
 public class SystemPropBinder implements LoggerFactoryBinder {
   String factoryFactoryClassName = null;
 
   /**
-   * Fetch the appropriate ILoggerFactory as intructed by the system propties.
+   * Fetch the appropriate ILoggerFactory as instructed by the system properties.
    * 
+   * Constants.LOGGER_FACTORY_FACTORY_METHOD_NAME
    * @return The appropriate ILoggerFactory instance as directed from the system
    *         properties
    */
@@ -50,10 +81,10 @@
     if (factoryFactoryClassName == null) {
       try {
         factoryFactoryClassName = System
-            .getProperty(Constants.LOGGER_FACTORY_FACTORY_METHOD_NAME);
+            .getProperty(Constants.LOGGER_FACTORY_PROPERTY);
       } catch (Exception e) {
         Util.reportFailure("Failed to fetch "
-            + Constants.LOGGER_FACTORY_FACTORY_METHOD_NAME
+            + Constants.LOGGER_FACTORY_PROPERTY
             + " system property.", e);
       }
     }

Modified: slf4j/trunk/src/java/org/slf4j/spi/MarkerFactoryBinder.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/spi/MarkerFactoryBinder.java	(original)
+++ slf4j/trunk/src/java/org/slf4j/spi/MarkerFactoryBinder.java	Sun Aug 28 17:59:29 2005
@@ -48,8 +48,8 @@
    * Return the instance of {@link IMarkerFactory} that 
    * {@link org.slf4j.MarkerFactory} class should bind to.
    * 
-   * @return the instance of {@link ILoggerFactory} that 
-   * {@link org.slf4j.LoggerFactory} class should bind to.
+   * @return the instance of {@link IMarkerFactory} that 
+   * {@link org.slf4j.MarkerFactory} class should bind to.
    */
   public IMarkerFactory getMarkerFactory();
 



More information about the slf4j-dev mailing list