cziegeler    2003/01/09 00:09:40

  Modified:    src/java/org/apache/cocoon/components/source/impl
                        SourceFactoryWrapper.java URLFactoryWrapper.java
                        ContextSourceFactory.java SitemapSourceFactory.java
                        CocoonToAvalonSource.java FileSourceFactory.java
                        SitemapSource.java DelayedRefreshSourceWrapper.java
               tools/bin ant.bat
               lib      jars.xml
  Added:       lib/core excalibur-sourceresolve-20030108.jar
  Removed:     lib/core excalibur-sourceresolve-20020820.jar
  Log:
  Updating to latest source resolver version
  
  Revision  Changes    Path
  1.7       +16 -2     
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SourceFactoryWrapper.java
  
  Index: SourceFactoryWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SourceFactoryWrapper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SourceFactoryWrapper.java 5 Dec 2002 10:17:29 -0000       1.6
  +++ SourceFactoryWrapper.java 9 Jan 2003 08:09:39 -0000       1.7
  @@ -50,6 +50,7 @@
   */
   package org.apache.cocoon.components.source.impl;
   
  +import org.apache.avalon.excalibur.pool.Recyclable;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
  @@ -171,7 +172,7 @@
           } catch (ProcessingException pe) {
               throw new CascadingIOException("ProcessingException: " + 
pe.getMessage(), pe);
           }
  -        return new CocoonToAvalonSource( source );
  +        return new CocoonToAvalonSource( location, source );
       }
   
       /**
  @@ -202,5 +203,18 @@
               ((Disposable) factory).dispose();
           }
       }
  +    
  +    /**
  +     * Release a {@link Source} object.
  +     */
  +    public void release( Source source ) {
  +        if ( null != source ) {
  +            if ( this.getLogger().isDebugEnabled() ) {
  +                this.getLogger().debug("Releasing source " + source.getSystemId());
  +            }
  +            ((Recyclable)source).recycle();
  +        }
  +    }
  +
   
   }
  
  
  
  1.5       +13 -1     
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/URLFactoryWrapper.java
  
  Index: URLFactoryWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/URLFactoryWrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- URLFactoryWrapper.java    5 Dec 2002 10:17:29 -0000       1.4
  +++ URLFactoryWrapper.java    9 Jan 2003 08:09:39 -0000       1.5
  @@ -198,4 +198,16 @@
           }
       }
   
  +    /**
  +     * Release a {@link Source} object.
  +     */
  +    public void release( Source source ) {
  +        if ( null != source ) {
  +            if ( this.getLogger().isDebugEnabled() ) {
  +                this.getLogger().debug("Releasing source " + source.getSystemId());
  +            }
  +            // do simply nothing
  +        }
  +    }
  +
   }
  
  
  
  1.9       +14 -1     
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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ContextSourceFactory.java 8 Jan 2003 14:08:05 -0000       1.8
  +++ ContextSourceFactory.java 9 Jan 2003 08:09:39 -0000       1.9
  @@ -167,4 +167,17 @@
               throw new MalformedURLException(message);
           }
       }
  +    
  +    /**
  +     * Release a {@link Source} object.
  +     */
  +    public void release( Source source ) {
  +        if ( null != source ) {
  +            if ( this.getLogger().isDebugEnabled() ) {
  +                this.getLogger().debug("Releasing source " + source.getSystemId());
  +            }
  +            this.resolver.release( source );
  +        }
  +    }
  +    
   }
  
  
  
  1.2       +15 -4     
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSourceFactory.java
  
  Index: SitemapSourceFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSourceFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SitemapSourceFactory.java 4 Dec 2002 11:06:44 -0000       1.1
  +++ SitemapSourceFactory.java 9 Jan 2003 08:09:39 -0000       1.2
  @@ -89,10 +89,8 @@
        * @param parameters This is optional.
        */
       public Source getSource( String location, Map parameters )
  -        throws MalformedURLException, IOException
  -    {
  -        if( getLogger().isDebugEnabled() )
  -        {
  +        throws MalformedURLException, IOException {
  +        if( getLogger().isDebugEnabled() ) {
               getLogger().debug( "Creating source object for " + location );
           }
   
  @@ -101,4 +99,17 @@
                                     parameters,
                                     getLogger());
       }
  +    
  +    /**
  +     * Release a {@link Source} object.
  +     */
  +    public void release( Source source ) {
  +        if ( null != source ) {
  +            if ( this.getLogger().isDebugEnabled() ) {
  +                this.getLogger().debug("Releasing source " + source.getSystemId());
  +            }
  +            ((SitemapSource)source).recycle();
  +        }
  +    }
  +    
   }
  
  
  
  1.5       +16 -2     
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/CocoonToAvalonSource.java
  
  Index: CocoonToAvalonSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/CocoonToAvalonSource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CocoonToAvalonSource.java 12 Jun 2002 10:14:53 -0000      1.4
  +++ CocoonToAvalonSource.java 9 Jan 2003 08:09:39 -0000       1.5
  @@ -73,14 +73,28 @@
   
   public final class CocoonToAvalonSource
       implements Source, XMLizable, Recyclable {
  +    
       /** The real source */
       protected org.apache.cocoon.environment.Source source;
   
  +    /** The protocol */
  +    protected String protocol;
  +    
       /**
        * Constructor
        */
  -    public CocoonToAvalonSource( org.apache.cocoon.environment.Source source ) {
  +    public CocoonToAvalonSource( String location,
  +                                  org.apache.cocoon.environment.Source source ) {
           this.source = source;
  +        int pos = location.indexOf(':');
  +        this.protocol = location.substring(0, pos);
  +    }
  +
  +    /**
  +     * Return the protocol identifier.
  +     */
  +    public String getProtocol() {
  +        return this.protocol;
       }
   
       /**
  
  
  
  1.2       +14 -1     
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/FileSourceFactory.java
  
  Index: FileSourceFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/FileSourceFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FileSourceFactory.java    8 May 2002 07:03:58 -0000       1.1
  +++ FileSourceFactory.java    9 Jan 2003 08:09:39 -0000       1.2
  @@ -90,4 +90,17 @@
           source.init( new URL(location), parameters );
           return source;
       }
  +    
  +    /**
  +     * Release a {@link Source} object.
  +     */
  +    public void release( Source source ) {
  +        if ( null != source ) {
  +            if ( this.getLogger().isDebugEnabled() ) {
  +                this.getLogger().debug("Releasing source " + source.getSystemId());
  +            }
  +            // do simply nothing
  +        }
  +    }
  +    
   }
  
  
  
  1.30      +18 -6     
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- SitemapSource.java        8 Jan 2003 16:07:37 -0000       1.29
  +++ SitemapSource.java        9 Jan 2003 08:09:39 -0000       1.30
  @@ -65,7 +65,6 @@
   import org.apache.cocoon.environment.wrapper.EnvironmentWrapper;
   import org.apache.cocoon.xml.ContentHandlerWrapper;
   import org.apache.cocoon.xml.XMLConsumer;
  -import org.apache.excalibur.source.Recyclable;
   import org.apache.excalibur.source.Source;
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceNotFoundException;
  @@ -94,7 +93,7 @@
    */
   public final class SitemapSource
   extends AbstractLogEnabled
  -implements Source, XMLizable, Recyclable {
  +implements Source, XMLizable {
   
       /** validities for the internal pipeline */
       private SourceValidity sourceValidity;
  @@ -138,6 +137,9 @@
       /** The unique key for this processing */
       private Object processKey;
       
  +    /** The used protocol */
  +    private String protocol;
  +
       /**
        * Construct a new object
        */
  @@ -159,11 +161,14 @@
           // remove the protocol
           int position = uri.indexOf(':') + 1;
           if (position != 0) {
  +            this.protocol = uri.substring(0, position);
               // check for subprotocol
               if (uri.startsWith("raw:", position)) {
                   position += 4;
                   rawMode = true;
               }
  +        } else {
  +            throw new MalformedURLException("Now protocol found for sitemap source 
in " + uri);
           }
   
           // does the uri point to this sitemap or to the root sitemap?
  @@ -199,8 +204,8 @@
   
           // create system ID
           this.systemId = queryString == null ?
  -            "cocoon://" + requestURI :
  -            "cocoon://" + requestURI + "?" + queryString;
  +            this.protocol + "://" + requestURI :
  +            this.protocol + "://" + requestURI + "?" + queryString;
   
           // create environment...
           this.environment = new EnvironmentWrapper(env, requestURI, 
  @@ -217,6 +222,13 @@
       }
   
       /**
  +     * Return the protocol identifier.
  +     */
  +    public String getProtocol() {
  +        return this.protocol;
  +    }
  +
  +    /**
        * Get the content length of the source or -1 if it
        * is not possible to determine the length.
        */
  @@ -342,7 +354,7 @@
                   }
               } else {
                   if (redirectURL.indexOf(":") == -1) {
  -                    redirectURL = "cocoon:/" + redirectURL;
  +                    redirectURL = this.protocol + ":/" + redirectURL;
                   }
                   this.redirectSource = this.environment.resolveURI(redirectURL);
                   this.redirectValidity = this.redirectSource.getValidity();
  
  
  
  1.3       +8 -1      
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/DelayedRefreshSourceWrapper.java
  
  Index: DelayedRefreshSourceWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/DelayedRefreshSourceWrapper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DelayedRefreshSourceWrapper.java  5 Dec 2002 10:17:29 -0000       1.2
  +++ DelayedRefreshSourceWrapper.java  9 Jan 2003 08:09:39 -0000       1.3
  @@ -110,6 +110,13 @@
       }
   
       /**
  +     * Return the protocol identifier.
  +     */
  +    public String getProtocol() {
  +        return this.source.getProtocol();
  +    }
  +
  +    /**
        * Get the last modification time for the wrapped <code>Source</code>. The
        * age of the returned information is guaranteed to be lower than or equal to
        * the delay specified in the constructor.
  
  
  
  1.1                  xml-cocoon2/lib/core/excalibur-sourceresolve-20030108.jar
  
        <<Binary file>>
  
  
  1.3       +2 -2      xml-cocoon2/tools/bin/ant.bat
  
  Index: ant.bat
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/tools/bin/ant.bat,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ant.bat   12 Jul 2002 09:36:51 -0000      1.2
  +++ ant.bat   9 Jan 2003 08:09:40 -0000       1.3
  @@ -94,11 +94,11 @@
   if not "%JIKESPATH%" == "" goto runAntWithJikes
   
   :runAnt
  -"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% 
org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS%
  +"%_JAVACMD%" -Xmx256m -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" 
%ANT_OPTS% org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS%
   goto end
   
   :runAntWithJikes
  -"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" 
-Djikes.class.path="%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_ARGS% 
%ANT_CMD_LINE_ARGS%
  +"%_JAVACMD%" -Xmx256m -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" 
-Djikes.class.path="%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_ARGS% 
%ANT_CMD_LINE_ARGS%
   
   :end
   set LOCALCLASSPATH=
  
  
  
  1.62      +1 -1      xml-cocoon2/lib/jars.xml
  
  Index: jars.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/lib/jars.xml,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- jars.xml  9 Jan 2003 05:35:07 -0000       1.61
  +++ jars.xml  9 Jan 2003 08:09:40 -0000       1.62
  @@ -155,7 +155,7 @@
        <description>Part of jakarta-avalon, it is a set of classes and patterns that
          support high level server development.</description>
        <used-by>Cocoon</used-by>
  -     <lib>core/excalibur-sourceresolve-20020820.jar</lib>
  +     <lib>core/excalibur-sourceresolve-20030108.jar</lib>
        <homepage>http://jakarta.apache.org/avalon/excalibur/</homepage>
    </file>
    <file>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to