cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap MountNode.java
Date Mon, 06 Oct 2003 16:42:39 GMT
sylvain     2003/10/06 09:42:39

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        MountNode.java
  Log:
  Fix bug#<don't remember...>
  
  Revision  Changes    Path
  1.7       +14 -6     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
  
  Index: MountNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MountNode.java	29 Sep 2003 21:06:39 -0000	1.6
  +++ MountNode.java	6 Oct 2003 16:42:39 -0000	1.7
  @@ -63,6 +63,8 @@
   import org.apache.cocoon.components.treeprocessor.TreeProcessor;
   import org.apache.cocoon.components.treeprocessor.variables.VariableResolver;
   import org.apache.cocoon.environment.Environment;
  +import org.apache.excalibur.source.Source;
  +import org.apache.excalibur.source.SourceResolver;
   
   /**
    *
  @@ -106,7 +108,7 @@
           Map objectModel = env.getObjectModel();
   
           String resolvedSource = this.source.resolve(context, objectModel);
  -        TreeProcessor processor = getProcessor(env, resolvedSource);
  +        TreeProcessor processor = getProcessor(resolvedSource);
   
           String resolvedPrefix = this.prefix.resolve(context, objectModel);
   
  @@ -138,7 +140,7 @@
           }
       }
   
  -    private synchronized TreeProcessor getProcessor(Environment env, String source) throws
Exception {
  +    private synchronized TreeProcessor getProcessor(String source) throws Exception {
   
           TreeProcessor processor = (TreeProcessor)processors.get(source);
   
  @@ -150,9 +152,15 @@
               } else {
                   actualSource = source;
               }
  -
  -            processor = this.parentProcessor.createChildProcessor(
  -                this.manager, this.language, env.resolveURI(actualSource));
  +            
  +            SourceResolver resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
  +            Source src = resolver.resolveURI(actualSource);
  +            try {
  +                processor = this.parentProcessor.createChildProcessor(this.manager, this.language,
src);
  +            } finally {
  +                resolver.release(src);
  +                this.manager.release(resolver);
  +            }
   
               // Associate to the original source
               processors.put(source, processor);
  
  
  

Mime
View raw message