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 Sun, 19 Oct 2003 17:27:32 GMT
cziegeler    2003/10/19 10:27:32

  Modified:    src/java/org/apache/cocoon/environment
                        EnvironmentHelper.java
               src/java/org/apache/cocoon Cocoon.java
  Log:
  Setting source resolver for main processor
  
  Revision  Changes    Path
  1.2       +2 -1      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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EnvironmentHelper.java	19 Oct 2003 14:34:40 -0000	1.1
  +++ EnvironmentHelper.java	19 Oct 2003 17:27:32 -0000	1.2
  @@ -96,6 +96,7 @@
        */
       public EnvironmentHelper(String context) {
           this.context = context;
  +        this.rootContext = context;
       }
       
       
  
  
  
  1.23      +20 -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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Cocoon.java	19 Oct 2003 16:12:54 -0000	1.22
  +++ Cocoon.java	19 Oct 2003 17:27:32 -0000	1.23
  @@ -53,10 +53,12 @@
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   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;
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +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;
  @@ -64,6 +66,7 @@
   import org.apache.cocoon.components.pipeline.ProcessingPipeline;
   import org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper;
   import org.apache.cocoon.environment.Environment;
  +import org.apache.cocoon.environment.EnvironmentHelper;
   import org.apache.cocoon.environment.ObjectModelHelper;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Session;
  @@ -114,6 +117,9 @@
       /** The source resolver */
       protected SourceResolver sourceResolver;
   
  +    /** The environment helper */
  +    protected EnvironmentHelper environmentHelper;
  +    
       /**
        * Creates a new <code>Cocoon</code> instance.
        *
  @@ -130,8 +136,18 @@
        *
        * @param manager the parent component manager. May be <code>null</code>
        */
  -    public void service(ServiceManager manager) {
  +    public void service(ServiceManager manager) 
  +    throws ServiceException {
           this.serviceManager = manager;
  +        this.sourceResolver = (SourceResolver)this.serviceManager.lookup(SourceResolver.ROLE);
  +        try {
  +            this.environmentHelper = new EnvironmentHelper(
  +                         (String) this.context.get(Constants.CONTEXT_ROOT_URL));
  +            ContainerUtil.enableLogging(this.environmentHelper, this.getLogger());
  +            ContainerUtil.service(this.environmentHelper, this.serviceManager);
  +        } catch (ContextException e) {
  +            throw new ServiceException("Unable to get context root url from context.",
e);
  +        }
       }
   
       /**
  @@ -234,6 +250,7 @@
        * Dispose this instance
        */
       public void dispose() {
  +        ContainerUtil.dispose(this.environmentHelper);
           this.context = null;
           this.disposed = true;
       }
  @@ -486,8 +503,7 @@
        * @see org.apache.cocoon.Processor#getSourceResolver()
        */
       public org.apache.cocoon.environment.SourceResolver getSourceResolver() {
  -        // TODO (CZ) Implement me
  -        return (org.apache.cocoon.environment.SourceResolver)this.sourceResolver;
  +        return this.environmentHelper;
       }
   
   }
  
  
  

Mime
View raw message