vgritsenko    02/01/29 07:46:08

  Modified:    .        changes.xml
               src/java/org/apache/cocoon/components/language/markup
                        AbstractMarkupLanguage.java
               src/java/org/apache/cocoon/components/language/markup/sitemap
                        SitemapMarkupLanguage.java
               src/java/org/apache/cocoon/components/language/markup/xsp
                        XSPMarkupLanguage.java
  Log:
  XSP Engine fixes
   - dispose abstract markup language
   - reflect changes
  
  Revision  Changes    Path
  1.81      +6 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- changes.xml       28 Jan 2002 23:06:32 -0000      1.80
  +++ changes.xml       29 Jan 2002 15:46:07 -0000      1.81
  @@ -4,7 +4,7 @@
   
   <!--
     History of Cocoon changes
  -  $Id: changes.xml,v 1.80 2002/01/28 23:06:32 vgritsenko Exp $
  +  $Id: changes.xml,v 1.81 2002/01/29 15:46:07 vgritsenko Exp $
   -->
   
   <changes title="History of Changes">
  @@ -31,6 +31,11 @@
    </devs>
   
    <release version="@version@" date="@date@">
  +  <action dev="VG" type="fix">
  +    XSP engine now correctly works with dynamically generated sources
  +    with last modification date of 0, and it is correctly reloaded on Cocoon
  +    reload.
  +  </action>
     <action dev="VG" type="update">
       Logicsheets are resolved using instance of url factory source resolver 
       (URLFactorySourceResolver), and not the current request resolver (which
  
  
  
  1.6       +51 -35    
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/AbstractMarkupLanguage.java
  
  Index: AbstractMarkupLanguage.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/AbstractMarkupLanguage.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractMarkupLanguage.java       28 Jan 2002 23:06:10 -0000      1.5
  +++ AbstractMarkupLanguage.java       29 Jan 2002 15:46:08 -0000      1.6
  @@ -15,6 +15,7 @@
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.logger.AbstractLoggable;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.excalibur.pool.Recyclable;
   
   import org.apache.cocoon.ProcessingException;
  @@ -51,10 +52,10 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Ricardo Rocha</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Davanum Srinivas</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Ovidiu Predescu</a>
  - * @version CVS $Revision: 1.5 $ $Date: 2002/01/28 23:06:10 $
  + * @version CVS $Revision: 1.6 $ $Date: 2002/01/29 15:46:08 $
    */
   public abstract class AbstractMarkupLanguage extends AbstractLoggable
  -    implements MarkupLanguage, Composable, Configurable, Recyclable
  +    implements MarkupLanguage, Composable, Configurable, Recyclable, Disposable
   {
       /** The 'file' URL protocol. */
       private static final String FILE = "file:";
  @@ -77,34 +78,15 @@
       /** The component manager */
       protected ComponentManager manager;
       
  -    /**
  -     * The URL factory used to resolve URIs.
  -     */
  +    /** The URL factory to create source resolver */
  +    private URLFactory urlFactory;
  +
  +    /** The URL factory source resolver used to resolve URIs */
       private URLFactorySourceResolver urlResolver;
   
       private final LinkedList logicSheetList = new LinkedList();
   
   
  -    public void recycle()
  -    {
  -        this.logicSheetList.clear();
  -    }
  -
  -    /**
  -     * Set the global component manager.
  -     * @param manager The sitemap-specified component manager
  -     */
  -    public void compose(ComponentManager manager) throws ComponentException {
  -        this.manager = manager;
  -
  -        // Initialize logicsheet cache
  -        this.logicsheetCache = (Store) manager.lookup(Store.ROLE);
  -
  -        // Initialize the URL factory source resolver
  -        URLFactory urlFactory = (URLFactory)this.manager.lookup(URLFactory.ROLE);
  -        this.urlResolver = new URLFactorySourceResolver(urlFactory, manager);
  -    }
  -
       /** The default constructor. */
       public AbstractMarkupLanguage() throws SAXException, IOException {
           // Initialize language table
  @@ -112,16 +94,6 @@
       }
   
       /**
  -     * Initialize the (required) markup language namespace definition.
  -     * @param params The sitemap-supplied parameters
  -     * @exception Exception Not actually thrown
  -     */
  -    protected void setParameters(Parameters params) throws Exception {
  -        this.uri = params.getParameter("uri", null);
  -        this.prefix = params.getParameter("prefix", null);
  -    }
  -
  -    /**
        * Process additional configuration. Load supported programming
        * language definitions
        *
  @@ -191,6 +163,50 @@
   
           return logicsheet;
       }
  +
  +    /**
  +     * Set the global component manager.
  +     * @param manager The sitemap-specified component manager
  +     */
  +    public void compose(ComponentManager manager) throws ComponentException {
  +        this.manager = manager;
  +
  +        // Initialize logicsheet cache
  +        this.logicsheetCache = (Store) manager.lookup(Store.ROLE);
  +
  +        // Initialize the URL factory source resolver
  +        this.urlFactory = (URLFactory)this.manager.lookup(URLFactory.ROLE);
  +        this.urlResolver = new URLFactorySourceResolver(this.urlFactory, manager);
  +    }
  +
  +    public void recycle()
  +    {
  +        this.logicSheetList.clear();
  +    }
  +
  +    public void dispose() {
  +        if (this.logicsheetCache != null)
  +            this.manager.release(this.logicsheetCache);
  +        this.logicsheetCache = null;
  +
  +        if (this.urlFactory != null)
  +            this.manager.release(this.urlFactory);
  +        this.urlFactory = null;
  +        this.urlResolver = null;
  +        this.manager = null;
  +        this.languages.clear();
  +    }
  +
  +    /**
  +     * Initialize the (required) markup language namespace definition.
  +     * @param params The sitemap-supplied parameters
  +     * @exception Exception Not actually thrown
  +     */
  +    protected void setParameters(Parameters params) throws Exception {
  +        this.uri = params.getParameter("uri", null);
  +        this.prefix = params.getParameter("prefix", null);
  +    }
  +
   
       /**
        * Return the source document's encoding. This can be <code>null</code> for
  
  
  
  1.4       +8 -7      
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/sitemap/SitemapMarkupLanguage.java
  
  Index: SitemapMarkupLanguage.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/sitemap/SitemapMarkupLanguage.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SitemapMarkupLanguage.java        26 Jan 2002 17:13:33 -0000      1.3
  +++ SitemapMarkupLanguage.java        29 Jan 2002 15:46:08 -0000      1.4
  @@ -32,7 +32,7 @@
    * <a 
href="http://xml.apache.org/cocoon2/userdocs/concepts/sitemap.html";>Sitemap</a>.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Giacomo Pati</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/01/26 17:13:33 $
  + * @version CVS $Revision: 1.4 $ $Date: 2002/01/29 15:46:08 $
    */
   public class SitemapMarkupLanguage extends AbstractMarkupLanguage {
   
  @@ -41,12 +41,6 @@
        */
       private Set dependencies;
   
  -    public void recycle()
  -    {
  -        super.recycle();
  -        this.dependencies.clear();
  -    }
  -
       /**
       * The default constructor.
       */
  @@ -54,6 +48,13 @@
           super();
           dependencies = new HashSet();
       }
  +
  +    public void recycle()
  +    {
  +        super.recycle();
  +        this.dependencies.clear();
  +    }
  +
   
       /**
       * Return the Sitemap language name: <i>map</i> :-)
  
  
  
  1.4       +8 -7      
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java
  
  Index: XSPMarkupLanguage.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPMarkupLanguage.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XSPMarkupLanguage.java    26 Jan 2002 17:13:33 -0000      1.3
  +++ XSPMarkupLanguage.java    29 Jan 2002 15:46:08 -0000      1.4
  @@ -34,7 +34,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Ricardo Rocha</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Sahuc</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/01/26 17:13:33 $
  + * @version CVS $Revision: 1.4 $ $Date: 2002/01/29 15:46:08 $
    */
   public class XSPMarkupLanguage extends AbstractMarkupLanguage {
   
  @@ -46,12 +46,6 @@
        */
       private Set dependencies;
   
  -    public void recycle()
  -    {
  -        super.recycle();
  -        this.dependencies.clear();
  -    }
  -
       /**
        * The default constructor.
        */
  @@ -59,6 +53,13 @@
           super();
           dependencies = new HashSet();
       }
  +
  +    public void recycle()
  +    {
  +        super.recycle();
  +        this.dependencies.clear();
  +    }
  +
   
       /**
        * Return the XSP language name: <i>xsp</i> :-)
  
  
  

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