cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/sitemap Handler.java
Date Wed, 23 May 2001 09:03:57 GMT
cziegeler    01/05/23 02:03:57

  Modified:    src/org/apache/cocoon/sitemap Handler.java
  Log:
  Avoid recreation of URLResolver
  
  Revision  Changes    Path
  1.4       +14 -5     xml-cocoon2/src/org/apache/cocoon/sitemap/Handler.java
  
  Index: Handler.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/Handler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Handler.java	2001/05/22 19:23:16	1.3
  +++ Handler.java	2001/05/23 09:03:56	1.4
  @@ -30,6 +30,8 @@
   import org.apache.cocoon.components.pipeline.StreamPipeline;
   import org.apache.cocoon.components.url.URLFactory;
   import org.apache.cocoon.environment.Environment;
  +import org.apache.cocoon.environment.FactoryURLResolver;
  +import org.apache.cocoon.environment.URLResolver;
   import org.xml.sax.InputSource;
   import org.xml.sax.SAXException;
   
  @@ -39,9 +41,11 @@
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2001/05/22 19:23:16 $
  + * @version CVS $Revision: 1.4 $ $Date: 2001/05/23 09:03:56 $
    */
  -public class Handler extends AbstractLoggable implements Runnable, Configurable, Composable,
Contextualizable, Processor, Disposable {
  +public class Handler extends AbstractLoggable
  +implements Runnable, Configurable, Composable, Contextualizable, Processor, Disposable
{
  +
       private Context context;
   
       /** the configuration */
  @@ -57,6 +61,9 @@
       /** the URLFactory */
       private URLFactory urlFactory;
   
  +    /** The URLResolver for the sitemap components */
  +    private URLResolver urlResolver;
  +
       /** the last error */
       private Exception exception;
   
  @@ -77,6 +84,7 @@
           this.manager = manager;
           try {
               urlFactory = (URLFactory) manager.lookup(Roles.URL_FACTORY);
  +            this.urlResolver = new FactoryURLResolver(urlFactory);
           } catch (Exception e) {
               getLogger().error ("cannot obtain URLFactory", e);
           }
  @@ -123,7 +131,7 @@
               s = this.source;
           }
           try {
  -            environment.setURLResolver(new org.apache.cocoon.environment.FactoryURLResolver(urlFactory));
  +            environment.setURLResolver(this.urlResolver);
               this.sourceFile = environment.resolve(s).getFile();
           } finally {
               environment.setURLResolver(null);
  @@ -163,7 +171,7 @@
       throws Exception {
           checkSanity();
           try {
  -            environment.setURLResolver(new org.apache.cocoon.environment.FactoryURLResolver(urlFactory));
  +            environment.setURLResolver(this.urlResolver);
           return sitemap.process(environment);
           } finally {
               environment.setURLResolver(null);
  @@ -174,7 +182,7 @@
       throws Exception {
           checkSanity();
           try {
  -            environment.setURLResolver(new org.apache.cocoon.environment.FactoryURLResolver(urlFactory));
  +            environment.setURLResolver(this.urlResolver);
           return sitemap.process(environment, pipeline, eventPipeline);
           } finally {
               environment.setURLResolver(null);
  @@ -252,5 +260,6 @@
        */
       public void dispose() {
           if(urlFactory != null) manager.release((Component)urlFactory);
  +        this.urlResolver = null;
       }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message