You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mi...@apache.org on 2001/12/20 00:36:25 UTC

cvs commit: jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/logger/factory JMSTargetFactory.java

mirceatoma    01/12/19 15:36:25

  Modified:    src/java/org/apache/avalon/excalibur/logger/factory
                        JMSTargetFactory.java
  Log:
  Move formatter generation in a protected method.
  
  Revision  Changes    Path
  1.2       +15 -12    jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/logger/factory/JMSTargetFactory.java
  
  Index: JMSTargetFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/java/org/apache/avalon/excalibur/logger/factory/JMSTargetFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JMSTargetFactory.java	2001/09/10 19:47:04	1.1
  +++ JMSTargetFactory.java	2001/12/19 23:36:25	1.2
  @@ -62,7 +62,7 @@
    * </pre>
    *
    * @author <a href="mailto:mirceatoma@home.com">Mircea Toma</a>;
  - * @version CVS $Revision: 1.1 $ $Date: 2001/09/10 19:47:04 $
  + * @version CVS $Revision: 1.2 $ $Date: 2001/12/19 23:36:25 $
    */
   public class JMSTargetFactory implements LogTargetFactory
   {
  @@ -139,21 +139,24 @@
                   properties[i] = new PropertyInfo(name, type, aux);
               }
   
  -            final Formatter formatter;
  +            final Formatter formatter = getFormatter( formatterConf );
               
  -            if ( null != formatterConf )
  -            {
  -                final FormatterFactory formatterFactory = new FormatterFactory();
  -                formatter = formatterFactory.createFormatter( formatterConf );
  -            }
  -            else
  -            {
  -                formatter = null;
  -            }                
  -            
               return new TextMessageBuilder( properties, formatter );
           }
                   
           return new ObjectMessageBuilder();        
  +    }
  +
  +    protected Formatter getFormatter( final Configuration conf )
  +    {
  +        Formatter formatter = null;
  +
  +        if ( null != conf )
  +        {
  +            final FormatterFactory formatterFactory = new FormatterFactory();
  +            formatter = formatterFactory.createFormatter( conf );
  +        }
  +        
  +        return formatter;
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>