cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/source/impl ContextSourceFactory.java
Date Wed, 08 Jan 2003 14:08:06 GMT
sylvain     2003/01/08 06:08:05

  Modified:    src/java/org/apache/cocoon/components/source/impl
                        ContextSourceFactory.java
  Log:
  Fix endless loop
  
  Revision  Changes    Path
  1.8       +14 -2     xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/ContextSourceFactory.java
  
  Index: ContextSourceFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/ContextSourceFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ContextSourceFactory.java	8 Jan 2003 11:04:53 -0000	1.7
  +++ ContextSourceFactory.java	8 Jan 2003 14:08:05 -0000	1.8
  @@ -99,7 +99,10 @@
        */
       public void compose(ComponentManager manager) throws ComponentException {
           this.manager = manager;
  -        this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
  +        // FIXME : Looking up the resolver here leads to an infinite loop
  +        // (is this because of Avalon or CocoonComponentManager ??)
  +        // So we delay this for to the first call to getSource().
  +        //this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
       }
   
       /**
  @@ -132,6 +135,15 @@
               this.getLogger().debug( "Creating source object for " + location );
           }
   
  +        // Lookup resolver if needed
  +        if (this.resolver == null) {
  +            try {
  +                this.resolver = (SourceResolver)this.manager.lookup( SourceResolver.ROLE
);
  +            } catch (ComponentException ce) {
  +            	throw new SourceException("Unable to lookup source resolver.", ce);
  +            }
  +        }
  +                
           // Remove the protocol and the first '/'
           int pos = location.indexOf(":/");
           String path = location.substring(pos+1);
  
  
  

----------------------------------------------------------------------
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