cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon Cocoon.java
Date Wed, 15 Oct 2003 20:01:59 GMT
cziegeler    2003/10/15 13:01:59

  Modified:    src/java/org/apache/cocoon Cocoon.java
  Log:
  Remove hacky cast from environment to SourceResolver
  
  Revision  Changes    Path
  1.18      +16 -6     cocoon-2.1/src/java/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Cocoon.java	8 Oct 2003 20:18:34 -0000	1.17
  +++ Cocoon.java	15 Oct 2003 20:01:59 -0000	1.18
  @@ -66,6 +66,7 @@
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.component.Component;
  +import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -101,6 +102,7 @@
   import org.apache.excalibur.instrument.InstrumentManageable;
   import org.apache.excalibur.instrument.InstrumentManager;
   import org.apache.excalibur.source.Source;
  +import org.apache.excalibur.source.SourceResolver;
   import org.apache.excalibur.source.impl.URLSource;
   import org.apache.excalibur.xml.impl.XercesParser;
   import org.apache.excalibur.xml.sax.SAXParser;
  @@ -165,8 +167,11 @@
       private volatile int activeRequestCount = 0;
   
       /** the Processor if it is ThreadSafe */
  -    private Processor threadSafeProcessor = null;
  +    private Processor threadSafeProcessor;
   
  +    /** The source resolver */
  +    protected SourceResolver sourceResolver;
  +    
       /**
        * Creates a new <code>Cocoon</code> instance.
        *
  @@ -183,7 +188,8 @@
        *
        * @param manager the parent component manager. May be <code>null</code>
        */
  -    public void compose(ComponentManager manager) {
  +    public void compose(ComponentManager manager)
  +    throws ComponentException {
           this.parentComponentManager = manager;
       }
   
  @@ -340,6 +346,7 @@
               this.componentManager.release(processor);
           }
   
  +        this.sourceResolver = (SourceResolver)this.componentManager.lookup(SourceResolver.ROLE);
       }
   
       /** Dump System Properties */
  @@ -505,8 +512,11 @@
               this.componentManager.release(this.threadSafeProcessor);
               this.threadSafeProcessor = null;
               
  +            this.componentManager.release(this.sourceResolver);
  +            this.sourceResolver = null;
  +
               ContainerUtil.dispose(this.componentManager);
  -            this.componentManager = null;
  +            this.componentManager = null;            
           }
           
           this.context = null;
  @@ -738,7 +748,7 @@
               }
   
               programGenerator = (ProgramGenerator) this.componentManager.lookup(ProgramGenerator.ROLE);
  -            source = environment.resolveURI(fileName);
  +            source = this.sourceResolver.resolveURI(fileName);
               CompiledComponent xsp = programGenerator.load(this.componentManager,
                       source,
                       markupLanguage, programmingLanguage, environment);
  @@ -746,7 +756,7 @@
                   getLogger().debug("XSP generation complete:" + xsp);
               }
           } finally {
  -            environment.release(source);
  +            this.sourceResolver.release(source);
               this.componentManager.release(programGenerator);
           }
       }
  
  
  

Mime
View raw message