avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xmlizer/impl TextXMLizer.java
Date Wed, 10 Jul 2002 08:59:10 GMT
donaldp     2002/07/10 01:59:10

  Modified:    xmlutil/src/java/org/apache/excalibur/xmlizer/impl
                        TextXMLizer.java
  Log:
  Parser is always threadsafe so no need to release it.
  
  Revision  Changes    Path
  1.4       +9 -18     jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xmlizer/impl/TextXMLizer.java
  
  Index: TextXMLizer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/xmlutil/src/java/org/apache/excalibur/xmlizer/impl/TextXMLizer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TextXMLizer.java	10 Jul 2002 08:53:17 -0000	1.3
  +++ TextXMLizer.java	10 Jul 2002 08:59:10 -0000	1.4
  @@ -31,15 +31,16 @@
       extends AbstractLogEnabled
       implements XMLizer, ThreadSafe, Composable
   {
  -    /** The component manager */
  -    private ComponentManager m_manager;
  +    private static final String XML_MIME_TYPE = "text/xml";
   
       /**
  -     * Composable interface
  +     * The parser to use.
        */
  +    private Parser m_parser;
  +
       public void compose( final ComponentManager manager )
       {
  -        m_manager = manager;
  +        m_parser = (Parser)manager.lookup( Parser.ROLE );
       }
   
       /**
  @@ -80,7 +81,7 @@
                   getLogger().debug( message );
               }
           }
  -        else if( !mimeType.equalsIgnoreCase( "text/xml" ) )
  +        else if( !mimeType.equalsIgnoreCase( XML_MIME_TYPE ) )
           {
               if( getLogger().isDebugEnabled() )
               {
  @@ -97,16 +98,6 @@
               inputSource.setSystemId( systemID );
           }
   
  -        final Parser parser = (Parser)m_manager.lookup( Parser.ROLE );
  -        try
  -        {
  -            parser.parse( inputSource, handler );
  -        }
  -        finally
  -        {
  -            m_manager.release( parser );
  -        }
  +        m_parser.parse( inputSource, handler );
       }
  -
  -}
  -
  +}
  \ No newline at end of file
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message