logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject cvs commit: logging-log4j/src/java/org/apache/log4j/or RendererMap.java
Date Fri, 08 Jul 2005 04:52:21 GMT
hoju        2005/07/07 21:52:21

  Modified:    src/java/org/apache/log4j/or RendererMap.java
  Log:
  Provide Log4j-1.2.xx binary compatibility along with deprecation warning
  
  Revision  Changes    Path
  1.16      +30 -2     logging-log4j/src/java/org/apache/log4j/or/RendererMap.java
  
  Index: RendererMap.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/or/RendererMap.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- RendererMap.java	8 Jan 2005 14:05:28 -0000	1.15
  +++ RendererMap.java	8 Jul 2005 04:52:21 -0000	1.16
  @@ -38,8 +38,11 @@
     }
   
     /**
  -     Add a renderer to a hierarchy passed as parameter.
  -  */
  +   * Add a renderer to the current logger repository
  +   * 
  +   * @param renderedClassName
  +   * @param renderingClassName
  +   */
     public void addRenderer(String renderedClassName,
       String renderingClassName) {
       getLogger().debug(
  @@ -67,6 +70,31 @@
     }
   
     /**
  +   * Add a renderer to a hierarchy passed as parameter
  +   * 
  +   * @deprecated As of release 1.3, replaced by {@link #addRenderer(String,String)}.  Left
here only to provide binary compatibility with 1.2.xx and will be removed in a future release.
  +   */
  +  static public void addRenderer(RendererSupport repository, String renderedClassName,
  +           String renderingClassName) {
  +    ObjectRenderer renderer =
  +      (ObjectRenderer) OptionConverter.instantiateByClassName(
  +          renderingClassName, ObjectRenderer.class, null);
  +      
  +    if (renderer == null) {
  +      return;
  +    } else {
  +      try {
  +        Class renderedClass = Loader.loadClass(renderedClassName);
  +        if(repository != null) {
  +          repository.setRenderer(renderedClass, renderer);
  +        }
  +      } catch (ClassNotFoundException e) {
  +        ;
  +      }
  +    }
  +  }
  +
  +  /**
        Find the appropriate renderer for the class type of the
        <code>o</code> parameter. This is accomplished by calling the
        {@link #get(Class)} method. Once a renderer is found, it is
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message