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.2/src/java/org/apache/cocoon Cocoon.java
Date Mon, 05 Jan 2004 08:16:01 GMT
cziegeler    2004/01/05 00:16:01

  Modified:    src/java/org/apache/cocoon/components/source/impl
                        SitemapSource.java
               src/java/org/apache/cocoon/bean CocoonBean.java
               src/java/org/apache/cocoon/components/cprocessor/sitemap
                        MountNode.java
               src/java/org/apache/cocoon/components/classloader
                        NonStaticClassLoaderManager.java
                        ClassLoaderManagerImpl.java ClassLoaderManager.java
               src/java/org/apache/cocoon/environment
                        EnvironmentHelper.java
               src/java/org/apache/cocoon/components/cprocessor
                        ProcessingNode.java InvokeContext.java
                        SitemapContainer.java TreeProcessor.java
               src/java/org/apache/cocoon/components/pipeline
                        AbstractProcessingPipeline.java
               src/java/org/apache/cocoon Cocoon.java
  Log:
  Another step: mounts now work partially - the environment handling is not bug free yet :(
  
  Revision  Changes    Path
  1.18      +2 -1      cocoon-2.2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- SitemapSource.java	31 Oct 2003 07:22:35 -0000	1.17
  +++ SitemapSource.java	5 Jan 2004 08:16:00 -0000	1.18
  @@ -381,6 +381,7 @@
               this.processKey = EnvironmentHelper.startProcessing(this.environment);
               this.processingPipeline = this.processor.buildPipeline(this.environment);
               this.pipelineProcessor = EnvironmentHelper.getLastProcessor(this.environment);
  +            //FIXME - set the context of the environment to the context of the pipeline
processor
               this.pipelineProcessor.getEnvironmentHelper().setContext(this.environment);
   
               String redirectURL = this.environment.getRedirectURL();
  
  
  
  1.44      +2 -1      cocoon-2.2/src/java/org/apache/cocoon/bean/CocoonBean.java
  
  Index: CocoonBean.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/bean/CocoonBean.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- CocoonBean.java	28 Dec 2003 20:50:52 -0000	1.43
  +++ CocoonBean.java	5 Jan 2004 08:16:00 -0000	1.44
  @@ -70,6 +70,7 @@
   import org.apache.cocoon.CompilingProcessor;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.components.CocoonContainer;
  +import org.apache.cocoon.components.ComponentContext;
   import org.apache.cocoon.components.SitemapConfigurableAccessor;
   
   /**
  @@ -310,7 +311,7 @@
           
           m_confBuilder.setLifecycleExtensionManager( getLifecycleExtensionManager() );
   
  -        DefaultContext initContext = new DefaultContext( m_confBuilder.getContext() );
  +        DefaultContext initContext = new ComponentContext( m_confBuilder.getContext() );
           Iterator it = m_properties.entrySet().iterator();
           while (it.hasNext())
           {
  
  
  
  1.3       +7 -10     cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/MountNode.java
  
  Index: MountNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/sitemap/MountNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MountNode.java	30 Dec 2003 11:33:16 -0000	1.2
  +++ MountNode.java	5 Jan 2004 08:16:00 -0000	1.3
  @@ -61,8 +61,6 @@
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.service.ServiceException;
  -import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.cocoon.components.cprocessor.AbstractProcessingNode;
   import org.apache.cocoon.components.cprocessor.InvokeContext;
   import org.apache.cocoon.components.cprocessor.ProcessingNode;
  @@ -72,8 +70,6 @@
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.sitemap.PatternException;
  -import org.apache.excalibur.source.Source;
  -import org.apache.excalibur.source.SourceResolver;
   
   /**
    *
  @@ -126,14 +122,14 @@
       }
   
       public final boolean invoke(Environment env, InvokeContext context)
  -      throws Exception {
  +    throws Exception {
   
           Map objectModel = env.getObjectModel();
   
           String resolvedSource = m_source.resolve(context, objectModel);
           String resolvedPrefix = m_prefix.resolve(context, objectModel);
   
  -        TreeProcessor processor = getProcessor(resolvedSource);
  +        TreeProcessor processor = this.getProcessor(resolvedSource, resolvedPrefix);
   
           String oldPrefix = env.getURIPrefix();
           String oldURI    = env.getURI();
  @@ -155,6 +151,7 @@
               }
           } finally {
               // Restore context
  +            //FIXME - Reset the context
               processor.getEnvironmentHelper().setContext(env);
   
               // Turning recomposing as a test, according to:
  @@ -168,9 +165,9 @@
        * Get the processor for the sub sitemap
        * FIXME Better synchronization strategy
        */
  -    private synchronized TreeProcessor getProcessor(String source) 
  +    private synchronized TreeProcessor getProcessor(String source, String prefix) 
       throws Exception {
  -        
  +        // FIXME - source is only relative, so we might get into name clashes, or?
           TreeProcessor processor = (TreeProcessor) m_processors.get(source);
           if (processor == null) {
               // Handle directory mounts
  @@ -181,7 +178,7 @@
                   actualSource = source;
               }
               
  -            processor = this.m_parentProcessor.createChildProcessor(actualSource,m_checkReload);
  +            processor = this.m_parentProcessor.createChildProcessor(actualSource, m_checkReload,
prefix);
   
               // Associate to the original source
               m_processors.put(source, processor);
  
  
  
  1.3       +1 -3      cocoon-2.2/src/java/org/apache/cocoon/components/classloader/NonStaticClassLoaderManager.java
  
  Index: NonStaticClassLoaderManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/classloader/NonStaticClassLoaderManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NonStaticClassLoaderManager.java	29 Dec 2003 13:27:36 -0000	1.2
  +++ NonStaticClassLoaderManager.java	5 Jan 2004 08:16:00 -0000	1.3
  @@ -57,8 +57,6 @@
   import java.util.Set;
   import java.util.Vector;
   
  -import org.apache.avalon.framework.thread.ThreadSafe;
  -
   /**
    * A singleton-like implementation of <code>ClassLoaderManager</code>
    *
  
  
  
  1.3       +1 -3      cocoon-2.2/src/java/org/apache/cocoon/components/classloader/ClassLoaderManagerImpl.java
  
  Index: ClassLoaderManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/classloader/ClassLoaderManagerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClassLoaderManagerImpl.java	29 Dec 2003 13:27:37 -0000	1.2
  +++ ClassLoaderManagerImpl.java	5 Jan 2004 08:16:00 -0000	1.3
  @@ -50,8 +50,6 @@
   */
   package org.apache.cocoon.components.classloader;
   
  -import org.apache.avalon.framework.thread.ThreadSafe;
  -
   import java.io.File;
   import java.io.IOException;
   import java.util.Collections;
  
  
  
  1.3       +1 -3      cocoon-2.2/src/java/org/apache/cocoon/components/classloader/ClassLoaderManager.java
  
  Index: ClassLoaderManager.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/classloader/ClassLoaderManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClassLoaderManager.java	29 Dec 2003 13:27:36 -0000	1.2
  +++ ClassLoaderManager.java	5 Jan 2004 08:16:00 -0000	1.3
  @@ -50,8 +50,6 @@
   */
   package org.apache.cocoon.components.classloader;
   
  -import org.apache.avalon.framework.component.Component;
  -
   import java.io.File;
   import java.io.IOException;
   
  
  
  
  1.12      +7 -3      cocoon-2.2/src/java/org/apache/cocoon/environment/EnvironmentHelper.java
  
  Index: EnvironmentHelper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/environment/EnvironmentHelper.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- EnvironmentHelper.java	31 Oct 2003 07:22:36 -0000	1.11
  +++ EnvironmentHelper.java	5 Jan 2004 08:16:00 -0000	1.12
  @@ -140,7 +140,7 @@
               } finally {
                   this.resolver.release(source);
               }
  -            this.context = null;
  +            //this.context = null;
           }
       }
   
  @@ -214,6 +214,8 @@
       
       public void setContext(Environment env) 
       throws ProcessingException {
  +        //TODO
  +        /*
           if ( this.prefix != null ) {
               String uris = env.getURI();
               if (!uris.startsWith(this.prefix)) {
  @@ -226,13 +228,15 @@
               final int l = this.prefix.length();
               env.setURI(this.prefix, uris.substring(l));
           }
  +        */
       }
   
       /**
        * Adds an prefix to the overall stripped off prefix from the request uri
        */
  -    public void changeContext(String newPrefix, String newContext)
  +    public void changeContext(Source newSource, String newPrefix)
       throws IOException {
  +        String newContext = newSource.getURI();
           if (getLogger().isDebugEnabled()) {
               getLogger().debug("Changing Cocoon context");
               getLogger().debug("  from context(" + this.context + ") and prefix(" + this.prefix
+ ")");
  
  
  
  1.2       +1 -2      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/ProcessingNode.java
  
  Index: ProcessingNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/ProcessingNode.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProcessingNode.java	28 Dec 2003 21:03:17 -0000	1.1
  +++ ProcessingNode.java	5 Jan 2004 08:16:00 -0000	1.2
  @@ -50,7 +50,6 @@
   */
   package org.apache.cocoon.components.cprocessor;
   
  -import org.apache.avalon.framework.thread.ThreadSafe;
   import org.apache.cocoon.environment.Environment;
   
   /**
  
  
  
  1.2       +1 -3      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/InvokeContext.java
  
  Index: InvokeContext.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/InvokeContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InvokeContext.java	28 Dec 2003 21:03:17 -0000	1.1
  +++ InvokeContext.java	5 Jan 2004 08:16:00 -0000	1.2
  @@ -58,8 +58,6 @@
   
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  -import org.apache.avalon.framework.logger.LogEnabled;
  -import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
  
  
  
  1.2       +0 -1      cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/SitemapContainer.java
  
  Index: SitemapContainer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/SitemapContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SitemapContainer.java	28 Dec 2003 21:03:17 -0000	1.1
  +++ SitemapContainer.java	5 Jan 2004 08:16:00 -0000	1.2
  @@ -53,7 +53,6 @@
   import org.apache.avalon.fortress.impl.ComponentHandlerMetaData;
   import org.apache.avalon.fortress.impl.DefaultContainer;
   import org.apache.avalon.fortress.util.CompositeException;
  -import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.service.ServiceException;
  
  
  
  1.4       +14 -11    cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/TreeProcessor.java
  
  Index: TreeProcessor.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/cprocessor/TreeProcessor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TreeProcessor.java	30 Dec 2003 12:24:00 -0000	1.3
  +++ TreeProcessor.java	5 Jan 2004 08:16:00 -0000	1.4
  @@ -51,7 +51,6 @@
   package org.apache.cocoon.components.cprocessor;
   
   import java.net.MalformedURLException;
  -import java.net.URL;
   import java.util.Map;
   
   import javax.xml.transform.sax.SAXResult;
  @@ -68,7 +67,6 @@
   import org.apache.avalon.framework.configuration.NamespacedSAXConfigurationHandler;
   import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  @@ -77,7 +75,6 @@
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.cocoon.Constants;
  -import org.apache.cocoon.Modifiable;
   import org.apache.cocoon.Processor;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper;
  @@ -151,16 +148,19 @@
       public TreeProcessor() {
       }
       
  -    private TreeProcessor(TreeProcessor parent, Source source, boolean checkReload) throws
Exception {
  +    private TreeProcessor(TreeProcessor parent, Source source, boolean checkReload, String
prefix) throws Exception {
           m_parent = parent;
           m_transform = parent.m_transform;
           m_checkReload = checkReload;
           m_source = source;
  -        m_environmentHelper = new EnvironmentHelper(parent.m_environmentHelper);
  -        ContainerUtil.enableLogging(this,parent.getLogger());
  -        ContainerUtil.contextualize(this,parent.m_context);
  -        ContainerUtil.service(this,parent.m_container.getServiceManager());
  +        ContainerUtil.enableLogging(this, parent.getLogger());
  +        ContainerUtil.contextualize(this, parent.m_context);
  +        ContainerUtil.service(this, parent.m_container.getServiceManager());
           ContainerUtil.initialize(this);
  +        m_environmentHelper = new EnvironmentHelper(parent.m_environmentHelper);
  +        ContainerUtil.enableLogging(m_environmentHelper, this.getLogger());
  +        ContainerUtil.service(m_environmentHelper, this.m_manager);
  +        m_environmentHelper.changeContext(source, prefix);
       }
       
       public void contextualize(Context context) {
  @@ -438,10 +438,13 @@
        * @param source  the location of the child sitemap.
        * @return  a new child processor.
        */
  -    public TreeProcessor createChildProcessor(String src, boolean checkReload) throws Exception
{
  +    public TreeProcessor createChildProcessor(String src, 
  +                                              boolean checkReload,
  +                                              String  prefix) 
  +    throws Exception {
           Source delayedSource = new DelayedRefreshSourceWrapper(
  -            m_resolver.resolveURI(src),m_lastModifiedDelay);
  -        return new TreeProcessor(this, delayedSource, checkReload);
  +            m_resolver.resolveURI(src), m_lastModifiedDelay);
  +        return new TreeProcessor(this, delayedSource, checkReload, prefix);
       }
       
       /**
  
  
  
  1.22      +1 -2      cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
  
  Index: AbstractProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- AbstractProcessingPipeline.java	28 Dec 2003 22:11:19 -0000	1.21
  +++ AbstractProcessingPipeline.java	5 Jan 2004 08:16:01 -0000	1.22
  @@ -65,7 +65,6 @@
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
  -import org.apache.avalon.framework.service.ServiceSelector;
   import org.apache.avalon.framework.service.Serviceable;
   import org.apache.cocoon.ConnectionResetException;
   import org.apache.cocoon.ProcessingException;
  
  
  
  1.32      +2 -4      cocoon-2.2/src/java/org/apache/cocoon/Cocoon.java
  
  Index: Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/Cocoon.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Cocoon.java	30 Dec 2003 11:24:15 -0000	1.31
  +++ Cocoon.java	5 Jan 2004 08:16:01 -0000	1.32
  @@ -60,7 +60,6 @@
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
  -import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
  @@ -69,7 +68,6 @@
   import org.apache.avalon.framework.service.ServiceException;
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.Serviceable;
  -import org.apache.cocoon.components.ComponentContext;
   import org.apache.cocoon.components.language.generator.ProgramGenerator;
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper;
  @@ -168,7 +166,7 @@
        * @exception  ContextException if a required context entry is missing.
        */
       public void contextualize(Context context) throws ContextException {
  -        this.context = new ComponentContext(context);
  +        this.context = context;
           configUrl = (URL) context.get(Constants.CONTEXT_CONFIG_URL);
       }
       
  
  
  

Mime
View raw message