cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r168366 - in /cocoon/branches/BRANCH_2_1_X/src: blocks/linkrewriter/java/org/apache/cocoon/transformation/ blocks/portal/java/org/apache/cocoon/portal/coplets/basket/ blocks/portal/java/org/apache/cocoon/portal/tools/transformation/ blocks/portal/java/org/apache/cocoon/portal/transformation/ blocks/repository/java/org/apache/cocoon/transformation/ blocks/session-fw/java/org/apache/cocoon/webapps/session/transformation/ java/org/apache/cocoon/transformation/
Date Thu, 05 May 2005 18:23:19 GMT
Author: vgritsenko
Date: Thu May  5 11:23:18 2005
New Revision: 168366

URL: http://svn.apache.org/viewcvs?rev=168366&view=rev
Log:
AbstractSAXTransformer:
  - implement Disposable
  - group methods by interface
  - add method findPrefixMapping
Call super.recycle last.
Call super.dispose.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/VariableRewriterTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/AbstractBasketTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/FolderTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/CheckAccessTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/PortalToolsLayoutTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/EventLinkTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/transformation/SourcePropsWritingTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/transformation/AbstractSessionTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/JPathTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/LinkRewriterTransformer.java Thu May  5 11:23:18 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -171,9 +171,9 @@
  *   <dt>bad-link-str</dt>
  *   <dd>String to use for links with a correct InputModule prefix, but no value
  *   therein.  Defaults to the original URI.</dd>
- *   
+ *
  *   <dt>namespace-uri</dt>
- *   <dd>The namespace uri of elements whose attributes are considered for 
+ *   <dd>The namespace uri of elements whose attributes are considered for
  *   transformation. Defaults to the empty namespace ("").</dd>
  * </dl>
  *
@@ -216,10 +216,10 @@
  *
  * <p>
  *
- * @version CVS $Id$
+ * @version $Id$
  */
 public class LinkRewriterTransformer extends AbstractSAXTransformer
-    implements Initializable, Disposable {
+                                     implements Initializable, Disposable {
 
     private final static String NAMESPACE = "";
 
@@ -360,7 +360,7 @@
                                                   this.origBadLinkStr); // else fall back to per-instance config
 
         this.namespaceURI = parameters.getParameter("namespace-uri", this.origNamespaceURI);
-        
+
         this.inSchemes = split(parameters.getParameter("schemes", this.origInSchemes), " ");
         this.outSchemes = split(parameters.getParameter("exclude-schemes", this.origOutSchemes), " ");
 
@@ -394,8 +394,6 @@
 
     /** Recycle this component for use in another map:transform. */
     public void recycle() {
-        super.recycle();
-
         // Note: configure() and initialize() are not called after every
         //       recycle, so don't null origConf, origLinkAttrs, etc.
         this.conf = null;
@@ -403,6 +401,8 @@
         this.linkAttrs = null;
         this.inSchemes = null;
         this.outSchemes = null;
+
+        super.recycle();
     }
 
     /**
@@ -605,5 +605,6 @@
             this.modHelper.releaseAll();
             this.modHelper = null;
         }
+        super.dispose();
     }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/VariableRewriterTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/VariableRewriterTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/VariableRewriterTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/linkrewriter/java/org/apache/cocoon/transformation/VariableRewriterTransformer.java Thu May  5 11:23:18 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -134,11 +134,10 @@
  * Note that currently, only links in the default ("") namespace are converted.
  *
  * @author <a href="mailto:jefft@apache.org">Jeff Turner</a>
- * @version CVS $Id$
+ * @version $Id$
  */
-public class VariableRewriterTransformer
-        extends AbstractSAXTransformer
-        implements Initializable, Disposable {
+public class VariableRewriterTransformer extends AbstractSAXTransformer
+                                         implements Initializable, Disposable {
 
     private static final String NAMESPACE = "";
 
@@ -330,7 +329,6 @@
 
     /** Recycle this component for use in another map:transform. */
     public void recycle() {
-        super.recycle();
         this.resolver = null;
         this.linkAttrs = null;
         this.inSchemes = null;
@@ -338,15 +336,17 @@
         this.conf = null;
         // Note: configure() and initialize() are not called after every
         //recycle, so don't null origConf
+        super.recycle();
     }
 
     /* (non-Javadoc)
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
-        if ( this.modHelper != null ) {
+        if (this.modHelper != null) {
             this.modHelper.releaseAll();
             this.modHelper = null;
         }
+        super.dispose();
     }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/AbstractBasketTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/AbstractBasketTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/AbstractBasketTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/AbstractBasketTransformer.java Thu May  5 11:23:18 2005
@@ -23,18 +23,17 @@
 /**
  * This is the base class for all basket transformers
  *
- * @version CVS $Id: BasketTransformer.java 47047 2004-09-22 12:27:27Z vgritsenko $
+ * @version $Id: BasketTransformer.java 47047 2004-09-22 12:27:27Z vgritsenko $
  */
-public abstract class AbstractBasketTransformer
-    extends AbstractSAXTransformer
-    implements Disposable {
+public abstract class AbstractBasketTransformer extends AbstractSAXTransformer
+                                               implements Disposable {
 
     /** The namespace URI to listen for. */
     public static final String NAMESPACE_URI = "http://apache.org/cocoon/portal/basket/1.0";
 
     /** The basket manager */
     protected BasketManager basketManager;
-    
+
     /**
      * Constructor
      */
@@ -47,16 +46,16 @@
      */
     public void service(ServiceManager manager) throws ServiceException {
         super.service(manager);
-        this.basketManager = (BasketManager)this.manager.lookup(BasketManager.ROLE);
+        this.basketManager = (BasketManager) this.manager.lookup(BasketManager.ROLE);
     }
-    
+
     /* (non-Javadoc)
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
-        if ( this.manager != null ) {
+        if (this.manager != null) {
             this.manager.release(this.basketManager);
         }
+        super.dispose();
     }
-    
-}
\ No newline at end of file
+}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/FolderTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/FolderTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/FolderTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplets/basket/FolderTransformer.java Thu May  5 11:23:18 2005
@@ -34,10 +34,9 @@
  * This transformer supports the basket feature. It can generate links to
  * add content and to upload files into the basket.
  *
- * @version CVS $Id: BasketTransformer.java 47047 2004-09-22 12:27:27Z vgritsenko $
+ * @version $Id: BasketTransformer.java 47047 2004-09-22 12:27:27Z vgritsenko $
  */
-public class FolderTransformer
-    extends AbstractBasketTransformer {
+public class FolderTransformer extends AbstractBasketTransformer {
 
     /** Element to upload an item */
     protected static final String UPLOAD_ITEM_ELEMENT = "upload-item";
@@ -52,8 +51,8 @@
      * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
      */
     public void recycle() {
-        super.recycle();
         this.uploadElements.clear();
+        super.recycle();
     }
 
     /* (non-Javadoc)
@@ -113,4 +112,4 @@
         }
     }
 
-}
\ No newline at end of file
+}

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/CheckAccessTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/CheckAccessTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/CheckAccessTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/CheckAccessTransformer.java Thu May  5 11:23:18 2005
@@ -1,12 +1,12 @@
 /*
  * Copyright 1999-2005 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,22 +27,22 @@
 import org.xml.sax.SAXException;
 
 /**
- * 
- * @version CVS $Id$
+ *
+ * @version $Id$
  */
-public class CheckAccessTransformer 
-extends AbstractSAXTransformer 
-implements Disposable {
+public class CheckAccessTransformer extends AbstractSAXTransformer
+                                    implements Disposable {
 
     public static final String RIGHTS_NAMESPACE_URI =
         "http://apache.org/cocoon/portal/tools/rights/1.0";
+
     public static final String ACCESS_TAG = "access";
     public static final String RIGHT_ID = "id";
-    
+
     private UserRightsService urs;
     private PortalToolManager ptm;
-    
-   /* (non-Javadoc)
+
+    /* (non-Javadoc)
      * @see org.apache.cocoon.transformation.AbstractSAXTransformer#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager manager) throws ServiceException {
@@ -50,23 +50,23 @@
         ptm = (PortalToolManager) this.manager.lookup(PortalToolManager.ROLE);
         urs = ptm.getUserRightsService();
     }
-    
+
     /* (non-Javadoc)
      * @see org.apache.cocoon.transformation.AbstractSAXTransformer#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
      */
-    public void startElement(String uri, String name, String raw, Attributes attr) 
+    public void startElement(String uri, String name, String raw, Attributes attr)
     throws SAXException {
         if (RIGHTS_NAMESPACE_URI.equals(uri) && ACCESS_TAG.equals(name)) {
             String id = attr.getValue(RIGHT_ID);
             if(!urs.userIsAllowed(id, this.ptm.getPortalObjects().getProfileManager().getUser())) {
                 this.stack.push(new Boolean(false));
-            } 
+            }
             this.startRecording();
         } else {
             super.startElement(uri, name, raw, attr);
         }
     }
-    
+
     /* (non-Javadoc)
      * @see org.apache.cocoon.transformation.AbstractSAXTransformer#endElement(java.lang.String, java.lang.String, java.lang.String)
      */
@@ -86,11 +86,11 @@
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
-        if ( this.manager != null ) {
+        if (this.manager != null) {
             this.manager.release(ptm);
             ptm = null;
             this.manager = null;
         }
+        super.dispose();
     }
-
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/PortalToolsLayoutTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/PortalToolsLayoutTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/PortalToolsLayoutTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/tools/transformation/PortalToolsLayoutTransformer.java Thu May  5 11:23:18 2005
@@ -1,12 +1,12 @@
 /*
  * Copyright 1999-2005 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,13 +36,14 @@
 
 /**
  * Adds the navigation etc. to the document
- * 
- * @version CVS $Id$
+ *
+ * @version $Id$
  */
-public class PortalToolsLayoutTransformer extends AbstractSAXTransformer implements Disposable /*, Parameterizable */{
+public class PortalToolsLayoutTransformer extends AbstractSAXTransformer
+                                          implements Disposable /*, Parameterizable */ {
 
 	public static final String ROLE = PortalToolsLayoutTransformer.class.getName();
-	
+
 	private PortalToolManager pm;
 	private String selected;
 
@@ -72,13 +73,13 @@
 	 * @see org.apache.avalon.framework.activity.Disposable#dispose()
 	 */
 	public void dispose() {
-        if ( this.manager != null ) {
-		    this.manager.release(pm);
-            pm = null;
-            this.manager = null;
+        if (this.manager != null) {
+            this.manager.release(pm);
+            this.pm = null;
         }
+        super.dispose();
 	}
-	
+
 
 	/* (non-Javadoc)
 	 * @see org.xml.sax.ContentHandler#startDocument()
@@ -86,7 +87,7 @@
 	public void startDocument() throws SAXException {
 		super.startDocument();
 		AttributesImpl a = new AttributesImpl();
-		
+
 		// took the div-tag as root, because it does not matter in the output, if it passes the xsl transformation
 		super.startPrefixMapping("i18n", "http://apache.org/cocoon/i18n/2.1");
 		super.startElement("", "div","div", a);
@@ -125,7 +126,7 @@
 	    }
 	}
 
-	
+
 	/* (non-Javadoc)
 	 * @see org.xml.sax.ContentHandler#endDocument()
 	 */

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/EventLinkTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/EventLinkTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/EventLinkTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/transformation/EventLinkTransformer.java Thu May  5 11:23:18 2005
@@ -1,12 +1,12 @@
 /*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
- * 
+ * Copyright 1999-2002,2004-2005 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,12 +26,12 @@
 import org.xml.sax.helpers.AttributesImpl;
 
 /**
- * This transformer searches for event descriptions in the XML. 
- * For each one an event is created and the event link is inserted into the XML 
+ * This transformer searches for event descriptions in the XML.
+ * For each one an event is created and the event link is inserted into the XML
  * instead of the description.<br><br>
- *  
+ *
  * Example:<br><br>
- * 
+ *
  * <pre>&lt;root xmlns:event="http://apache.org/cocoon/portal/eventlink/1.0"&gt;
  * 	&lt;event:event attribute="href"&gt;
  * 		&lt;a href="http://eventlinkexample"/&gt;
@@ -41,34 +41,32 @@
  * 	&lt;/event:event&gt;
  * &lt;/root&gt;<br></pre>
  *
- * The transformer will create two CopletLinkEvents and insert corresponding links 
- * to them to the XML instead of "http://eventlinkexample". If such a link is pressed 
+ * The transformer will create two CopletLinkEvents and insert corresponding links
+ * to them to the XML instead of "http://eventlinkexample". If such a link is pressed
  * the corresponding CopletLinkEvent is sent to the Subscribers to be handled.<br>
  * Please see also the documentation of superclass AbstractCopletTransformer for how
  * the coplet instance data are acquired.
- *   
+ *
  * @author <a href="mailto:bluetkemeier@s-und-n.de">Bj&ouml;rn L&uuml;tkemeier</a>
- * 
- * @version CVS $Id$
+ * @version $Id$
  */
-public class EventLinkTransformer 
-extends AbstractCopletTransformer {
-    
+public class EventLinkTransformer extends AbstractCopletTransformer {
+
     /**
      * The namespace URI to listen for.
      */
     public static final String NAMESPACE_URI = "http://apache.org/cocoon/portal/eventlink/1.0";
-    
+
     /**
      * The XML element name to listen for.
      */
     public static final String EVENT_ELEM = "event";
-    
+
     /**
      * An attribute's name of EVENT_ELEMENT.
      */
     public static final String ATTRIBUTE_ATTR = "attribute";
-    
+
     /**
      * An attribute's name of EVENT_ELEMENT.
      */
@@ -88,9 +86,9 @@
      * The element defining the link inside an EVENT_ELEM tag.
      */
     private String elementName;
-    
+
     /**
-     * Used to store elements' attributes between startTransformingElement and endTransformingElement. 
+     * Used to store elements' attributes between startTransformingElement and endTransformingElement.
      */
     private Stack attrStack = new Stack();
 
@@ -98,11 +96,12 @@
      * Overridden from superclass.
      */
     public void recycle() {
-        super.recycle();
         this.insideEvent = false;
         this.attributeName = null;
         this.elementName = null;
         this.attrStack.clear();
+
+        super.recycle();
     }
 
     /**
@@ -116,7 +115,7 @@
                 throw new SAXException("Elements "+EVENT_ELEM+" must not be nested.");
             }
             this.insideEvent = true;
-            
+
             // get element or attribute name that contains links
             this.attributeName = attr.getValue(ATTRIBUTE_ATTR);
             this.elementName = attr.getValue(ELEMENT_ATTR);
@@ -129,10 +128,10 @@
             if (this.insideEvent) {
                 // store attributes for endTransformingElement
                 this.attrStack.push(new AttributesImpl(attr));
-                
+
                 /* Record element content. In case of an element we asume, that no
-                 * children exist but only text content, since the text content shall 
-                 * be the link. Therefore we do startTextRecording. Otherwise we 
+                 * children exist but only text content, since the text content shall
+                 * be the link. Therefore we do startTextRecording. Otherwise we
                  * record the whole subtree.
                  */
                 if (this.elementName != null && name.equals(this.elementName)) {
@@ -167,26 +166,26 @@
 
                     // if attribute found that contains a link
                     if (link != null) {
-                        CopletInstanceData cid = this.getCopletInstanceData(attr.getValue("coplet"));                       
+                        CopletInstanceData cid = this.getCopletInstanceData(attr.getValue("coplet"));
                         LinkService linkService = this.getPortalService().getComponentManager().getLinkService();
-        
+
                         // create event link
                         CopletLinkEvent event = new CopletLinkEvent(cid, link);
                         String eventLink = linkService.getLinkURI(event);
-    
+
                         // insert event link
                         attr.setValue(index, eventLink);
                     }
                 }
-                
+
                 String eventLink = null;
                 DocumentFragment fragment = null;
-                                
+
                 // process element that contains link
                 if (this.elementName != null && name.equals(this.elementName)) {
                     String link = this.endTextRecording();
 
-                    CopletInstanceData cid = this.getCopletInstanceData();                       
+                    CopletInstanceData cid = this.getCopletInstanceData();
                     LinkService linkService = this.getPortalService().getComponentManager().getLinkService();
 
                     // create event link
@@ -195,7 +194,7 @@
                 } else {
                     fragment = this.endRecording();
                 }
-                
+
                 // stream element
                 super.startElement(uri, name, raw, attr);
                 if (eventLink != null) {
@@ -210,5 +209,4 @@
             }
         }
     }
-
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/transformation/SourcePropsWritingTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/transformation/SourcePropsWritingTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/transformation/SourcePropsWritingTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/transformation/SourcePropsWritingTransformer.java Thu May  5 11:23:18 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -52,10 +52,9 @@
  * </pre>
  *
  * @author <a href="mailto:gcasper@s-und-n.de">Guido Casper</a>
- * @version CVS $Id$
+ * @version $Id$
  */
-public class SourcePropsWritingTransformer
-        extends AbstractSAXTransformer {
+public class SourcePropsWritingTransformer extends AbstractSAXTransformer {
 
     public static final String SPWT_URI = "http://apache.org/cocoon/propwrite/1.0";
 
@@ -83,8 +82,8 @@
     }
 
     public void recycle() {
-        super.recycle();
         this.state = STATE_OUTSIDE;
+        super.recycle();
     }
 
     /**
@@ -235,7 +234,7 @@
     }
 
     private void setProperty(String src, Element element)
-    throws ProcessingException, IOException, SAXException {
+    throws ProcessingException {
         if (src != null && element != null) {
             try {
                 Source source = this.resolver.resolveURI(src);
@@ -244,19 +243,19 @@
                     ((InspectableSource)source).setSourceProperty(property);
 
                 } else {
-                    this.getLogger().error("Cannot set properties on " + src +
-                                           ": not an inspectable source");
+                    getLogger().error("Cannot set properties on " + src +
+                                      ": not an inspectable source");
                 }
             } catch (Exception e) {
                 throw new ProcessingException("Error setting properties on "+src, e);
             }
         } else {
-            this.getLogger().error("Error setting properties on "+src);
+            getLogger().error("Error setting properties on "+src);
         }
     }
 
     private void removeProperty(String src, Element element)
-    throws ProcessingException, IOException, SAXException {
+    throws ProcessingException {
 
         if (src != null && element != null) {
             try {
@@ -266,14 +265,14 @@
                         element.getNamespaceURI(),element.getLocalName());
 
                 } else {
-                    this.getLogger().error("Cannot remove properties on " + src +
-                                           ": not an inspectable source");
+                    getLogger().error("Cannot remove properties on " + src +
+                                      ": not an inspectable source");
                 }
             } catch (Exception e) {
                 throw new ProcessingException("Error removing properties on "+src, e);
             }
         } else {
-            this.getLogger().error("Error removing properties on "+src);
+            getLogger().error("Error removing properties on "+src);
         }
     }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/transformation/AbstractSessionTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/transformation/AbstractSessionTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/transformation/AbstractSessionTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/transformation/AbstractSessionTransformer.java Thu May  5 11:23:18 2005
@@ -1,12 +1,12 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
- * 
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -27,15 +27,14 @@
  *  This class is the basis for all session transformers.
  *
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: AbstractSessionTransformer.java,v 1.4 2004/03/05 13:02:23 bdelacretaz Exp $
+ * @version $Id$
 */
-public abstract class AbstractSessionTransformer
-extends AbstractSAXTransformer {
+public abstract class AbstractSessionTransformer extends AbstractSAXTransformer {
+
+    private SessionManager sessionManager;
+    private FormManager    formManager;
+    private ContextManager contextManager;
 
-    private SessionManager     sessionManager;
-    private FormManager        formManager;
-    private ContextManager     contextManager;
-    
     /**
      * Get the SessionManager component
      */
@@ -85,13 +84,14 @@
      *  Recycle this component.
      */
     public void recycle() {
-        super.recycle();
         this.manager.release( this.sessionManager);
         this.manager.release( this.formManager);
         this.manager.release( this.contextManager);
         this.sessionManager = null;
         this.formManager = null;
         this.contextManager = null;
+
+        super.recycle();
     }
 
     /**
@@ -102,5 +102,4 @@
     throws ProcessingException {
         return this.getSessionManager().getSession(false);
     }
-
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/AbstractSAXTransformer.java Thu May  5 11:23:18 2005
@@ -15,15 +15,8 @@
  */
 package org.apache.cocoon.transformation;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Stack;
-
 import org.apache.avalon.excalibur.pool.Recyclable;
+import org.apache.avalon.framework.activity.Disposable;
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -31,9 +24,8 @@
 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.ProcessingException;
-import org.apache.cocoon.util.ClassUtils;
-import org.apache.cocoon.util.TraxErrorHandler;
 import org.apache.cocoon.environment.Context;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
@@ -41,11 +33,14 @@
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.transformation.helpers.ParametersRecorder;
 import org.apache.cocoon.transformation.helpers.TextRecorder;
+import org.apache.cocoon.util.ClassUtils;
+import org.apache.cocoon.util.TraxErrorHandler;
 import org.apache.cocoon.xml.IncludeXMLConsumer;
 import org.apache.cocoon.xml.SaxBuffer;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.apache.cocoon.xml.XMLUtils;
 import org.apache.cocoon.xml.dom.DOMBuilder;
+
 import org.apache.excalibur.source.SourceParameters;
 import org.apache.excalibur.xml.sax.XMLizable;
 import org.w3c.dom.Document;
@@ -57,8 +52,15 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.ext.LexicalHandler;
 
-import javax.xml.transform.sax.SAXTransformerFactory;
 import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXTransformerFactory;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Stack;
 
 /**
  * This class is the basis for all transformers. It provides various useful
@@ -102,9 +104,8 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @version $Id$
 */
-public abstract class AbstractSAXTransformer
-        extends AbstractTransformer
-        implements Serviceable, Configurable, Recyclable {
+public abstract class AbstractSAXTransformer extends AbstractTransformer
+                                             implements Serviceable, Configurable, Recyclable, Disposable {
 
     /**
      * Empty immutable attributes (for performance). Use them
@@ -227,6 +228,16 @@
      */
     private String ourPrefix;
 
+    //
+    // Lifecycle
+    //
+
+    /* (non-Javadoc)
+     * @see org.apache.avalon.framework.service.Serviceable#service(ServiceManager)
+     */
+    public void service(ServiceManager manager) throws ServiceException {
+        this.manager = manager;
+    }
 
     /* (non-Javadoc)
      * @see Configurable#configure(Configuration)
@@ -293,8 +304,6 @@
      * @see org.apache.avalon.excalibur.pool.Recyclable#recycle()
      */
     public void recycle() {
-        super.recycle();
-
         this.namespaceURI = null;
         this.objectModel = null;
         this.request = null;
@@ -307,20 +316,32 @@
         this.source = null;
         this.namespaces.clear();
         this.ourPrefix = null;
+
+        super.recycle();
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.avalon.framework.service.Serviceable#service(ServiceManager)
+    public void dispose() {
+        this.manager = null;
+    }
+
+    //
+    // SAX ContentHandler methods
+    //
+
+    /**
+     * Process the SAX event.
+     * @see ContentHandler#setDocumentLocator
      */
-    public void service(ServiceManager manager) throws ServiceException {
-        this.manager = manager;
+    public void setDocumentLocator(Locator locator) {
+        if (this.ignoreEventsCount == 0) {
+            super.setDocumentLocator(locator);
+        }
     }
 
     /**
-     *  Process the SAX event. A new document is processed. The hook (method)
-     *  <code>setupTransforming()</code> is invoked.
-     *
-     *  @see org.xml.sax.ContentHandler#startDocument()
+     * Process the SAX event. A new document is processed. The hook method
+     * {@link #setupTransforming} is invoked.
+     * @see ContentHandler#startDocument
      */
     public void startDocument()
     throws SAXException {
@@ -341,8 +362,8 @@
     }
 
     /**
-     *  Process the SAX event. The processing of the document is finished.
-     *  @see org.xml.sax.ContentHandler#endDocument()
+     * Process the SAX event. The processing of the document is finished.
+     * @see org.xml.sax.ContentHandler#endDocument
      */
     public void endDocument()
     throws SAXException {
@@ -353,8 +374,68 @@
 
     /**
      * Process the SAX event.
-     * The namespace of the event is checked. If it is the defined namespace
-     * for this transformer the startTransformingElement() hook is called.
+     * @see org.xml.sax.ContentHandler#startPrefixMapping
+     */
+    public void startPrefixMapping(String prefix, String uri)
+    throws SAXException {
+        if (prefix != null) {
+            this.namespaces.add(new String[] {prefix, uri});
+        }
+        if (namespaceURI.equals(uri)) {
+            this.ourPrefix = prefix;
+        }
+        if (this.ignoreEventsCount == 0) {
+            super.startPrefixMapping(prefix, uri);
+        }
+    }
+
+    /**
+     * Process the SAX event.
+     * @see org.xml.sax.ContentHandler#endPrefixMapping
+     */
+    public void endPrefixMapping(String prefix)
+    throws SAXException {
+
+        if (prefix != null) {
+            // Find and remove the namespace prefix
+            boolean found = false;
+            for (int i = this.namespaces.size() - 1; i >= 0; i--) {
+                final String[] prefixAndUri = (String[]) this.namespaces.get(i);
+                if (prefixAndUri[0].equals(prefix)) {
+                    this.namespaces.remove(i);
+                    found = true;
+                    break;
+                }
+            }
+            if (!found) {
+                throw new SAXException("Namespace for prefix '" + prefix + "' not found.");
+            }
+
+            if (prefix.equals(this.ourPrefix)) {
+                // Reset our current prefix
+                this.ourPrefix = null;
+
+                // Now search if we have a different prefix for our namespace
+                for (int i = this.namespaces.size() - 1; i >= 0; i--) {
+                    final String[] prefixAndUri = (String[]) this.namespaces.get(i);
+                    if (namespaceURI.equals(prefixAndUri[1])) {
+                        this.ourPrefix = prefixAndUri[0];
+                        break;
+                    }
+                }
+            }
+        }
+
+        if (this.ignoreEventsCount == 0) {
+            super.endPrefixMapping(prefix);
+        }
+    }
+
+    /**
+     * Process the SAX event. The namespace of the event is checked.
+     * If it is the defined namespace for this transformer,
+     * the {@link #startTransformingElement} hook is called.
+     * @see org.xml.sax.ContentHandler#startElement
      */
     public void startElement(String uri,
                              String name,
@@ -378,9 +459,10 @@
     }
 
     /**
-     * Process the SAX event.
-     * The namespace of the event is checked. If it is the defined namespace
-     * for this transformer the endTransformingElement() hook is called.
+     * Process the SAX event. The namespace of the event is checked.
+     * If it is the defined namespace for this transformer,
+     * the {@link #endTransformingElement} hook is called.
+     * @see org.xml.sax.ContentHandler#endElement
      */
     public void endElement(String uri, String name, String raw)
     throws SAXException {
@@ -402,6 +484,7 @@
 
     /**
      * Process the SAX event.
+     * @see org.xml.sax.ContentHandler#characters
      */
     public void characters(char[] p0, int p1, int p2)
     throws SAXException {
@@ -419,6 +502,7 @@
 
     /**
      * Process the SAX event.
+     * @see org.xml.sax.ContentHandler#ignorableWhitespace
      */
     public void ignorableWhitespace(char[] p0, int p1, int p2)
     throws SAXException {
@@ -427,6 +511,99 @@
         }
     }
 
+    /**
+     * Process the SAX event.
+     * @see ContentHandler#processingInstruction
+     */
+    public void processingInstruction(String target, String data)
+    throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.processingInstruction(target, data);
+        }
+    }
+
+    /**
+     * Process the SAX event.
+     * @see ContentHandler#skippedEntity
+     */
+    public void skippedEntity(String name)
+    throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.skippedEntity(name);
+        }
+    }
+
+    //
+    // SAX LexicalHandler methods
+    //
+
+    /**
+     * @see LexicalHandler#startDTD
+     */
+    public void startDTD(String name, String public_id, String system_id)
+    throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.startDTD(name, public_id, system_id);
+        }
+    }
+
+    /**
+     * @see LexicalHandler#endDTD
+     */
+    public void endDTD() throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.endDTD();
+        }
+    }
+
+    /**
+     * @see LexicalHandler#startEntity
+     */
+    public void startEntity (String name)
+    throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.startEntity(name);
+        }
+    }
+
+    /**
+     * @see LexicalHandler#endEntity
+     */
+    public void endEntity (String name)
+    throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.endEntity(name);
+        }
+    }
+
+    /**
+     * @see LexicalHandler#startCDATA
+     */
+    public void startCDATA() throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.startCDATA();
+        }
+    }
+
+    /**
+     * @see LexicalHandler#endCDATA
+     */
+    public void endCDATA() throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.endCDATA();
+        }
+    }
+
+    /**
+     * @see LexicalHandler#comment
+     */
+    public void comment(char ary[], int start, int length)
+    throws SAXException {
+        if (this.ignoreEventsCount == 0) {
+            super.comment(ary, start, length);
+        }
+    }
+
 
     /*
      * Recording of events.
@@ -678,9 +855,9 @@
         return fragment;
     }
 
-    // ************
+    //
     // Hooks
-    // ************
+    //
 
     /**
      * Setup the transformation of an xml document.
@@ -858,26 +1035,6 @@
     }
 
     /**
-     * SAX Event handling
-     */
-    public void startEntity (String name)
-    throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.startEntity(name);
-        }
-    }
-
-    /**
-     * SAX Event handling
-     */
-    public void endEntity (String name)
-    throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.endEntity(name);
-        }
-    }
-
-    /**
      * Send all start prefix mapping events to the current content handler
      */
     protected void sendStartPrefixMapping()
@@ -902,135 +1059,18 @@
     }
 
     /**
-     * SAX Event handling
-     */
-    public void setDocumentLocator(Locator locator) {
-        if (this.ignoreEventsCount == 0) {
-            super.setDocumentLocator(locator);
-        }
-    }
-
-    /**
-     * SAX Event handling
-     */
-    public void startPrefixMapping(String prefix, String uri)
-    throws SAXException {
-        if (prefix != null) {
-            this.namespaces.add(new String[] {prefix, uri});
-        }
-        if (namespaceURI.equals(uri)) {
-            this.ourPrefix = prefix;
-        }
-        if (this.ignoreEventsCount == 0) {
-            super.startPrefixMapping(prefix, uri);
-        }
-    }
-
-    /**
-     * SAX Event handling
+     * Find prefix mapping for the given namespace URI.
+     * @return Prefix mapping or null if no prefix defined
      */
-    public void endPrefixMapping(String prefix)
-    throws SAXException {
-
-        if (prefix != null) {
-            // Find and remove the namespace prefix
-            boolean found = false;
-            for (int i = this.namespaces.size() - 1; i >= 0; i--) {
-                final String[] prefixAndUri = (String[]) this.namespaces.get(i);
-                if (prefixAndUri[0].equals(prefix)) {
-                    this.namespaces.remove(i);
-                    found = true;
-                    break;
-                }
-            }
-            if (!found) {
-                throw new SAXException("Namespace for prefix '" + prefix + "' not found.");
-            }
-
-            if (prefix.equals(this.ourPrefix)) {
-                // Reset our current prefix
-                this.ourPrefix = null;
-
-                // Now search if we have a different prefix for our namespace
-                for (int i = this.namespaces.size() - 1; i >= 0; i--) {
-                    final String[] prefixAndUri = (String[]) this.namespaces.get(i);
-                    if (namespaceURI.equals(prefixAndUri[1])) {
-                        this.ourPrefix = prefixAndUri[0];
-                        break;
-                    }
-                }
+    protected String findPrefixMapping(String uri) {
+        final int l = this.namespaces.size();
+        for (int i = 0; i < l; i++) {
+            String[] prefixAndUri = (String[]) this.namespaces.get(i);
+            if (prefixAndUri[1].equals(uri)) {
+                return prefixAndUri[0];
             }
         }
 
-        if (this.ignoreEventsCount == 0) {
-            super.endPrefixMapping(prefix);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String)
-     */
-    public void processingInstruction(String target, String data)
-    throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.processingInstruction(target, data);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ContentHandler#skippedEntity(java.lang.String)
-     */
-    public void skippedEntity(String name)
-    throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.skippedEntity(name);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.LexicalHandler#startDTD(java.lang.String, java.lang.String, java.lang.String)
-     */
-    public void startDTD(String name, String public_id, String system_id)
-    throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.startDTD(name, public_id, system_id);
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.LexicalHandler#endDTD()
-     */
-    public void endDTD() throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.endDTD();
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.LexicalHandler#startCDATA()
-     */
-    public void startCDATA() throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.startCDATA();
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.LexicalHandler#endCDATA()
-     */
-    public void endCDATA() throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.endCDATA();
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.xml.sax.ext.LexicalHandler#comment(char[], int, int)
-     */
-    public void comment(char ary[], int start, int length)
-    throws SAXException {
-        if (this.ignoreEventsCount == 0) {
-            super.comment(ary, start, length);
-        }
+        return null;
     }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java Thu May  5 11:23:18 2005
@@ -222,10 +222,11 @@
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
     public void dispose() {
-        if ( null != this.manager ) {
-            this.manager.release( this.cacheManager );
+        if (null != this.manager) {
+            this.manager.release(this.cacheManager);
             this.manager = null;
         }
+        super.dispose();
     }
 
     /**
@@ -240,7 +241,7 @@
             this.manager.release( this.recorder );
             this.recorder = null;
         }
-        super.recycle();
+
         this.configurationParameters = null;
         this.resourceParameters = null;
         if (getLogger().isDebugEnabled()) {
@@ -249,6 +250,8 @@
             this.startTime = 0;
         }
         this.filter = null;
+
+        super.recycle();
     }
 
     public void startTransformingElement(String uri, String name, String raw, Attributes attr)

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/JPathTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/JPathTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/JPathTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/JPathTransformer.java Thu May  5 11:23:18 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,10 +54,10 @@
  * </p>
  *
  * @author <a href="mailto:crafterm@apache.org">Marcus Crafter</a>
- * @version CVS $Id$
+ * @version $Id$
  */
-public class JPathTransformer
-extends AbstractSAXTransformer implements Initializable {
+public class JPathTransformer extends AbstractSAXTransformer
+                              implements Initializable {
 
     /** namespace constant */
     public static final String JPATH_NAMESPACE_URI  = "http://apache.org/xsp/jpath/1.0";
@@ -360,10 +360,10 @@
      * Release all held resources.
      */
     public void recycle() {
-        super.recycle();
-
         m_cache.clear();
         m_kont = null;
         m_jxpathContext = null;
+
+        super.recycle();
     }
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SimpleFormTransformer.java Thu May  5 11:23:18 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -145,7 +145,7 @@
  * </pre></p>
  *
  * @author <a href="mailto:haul@apache.org">Christian Haul</a>
- * @version CVS $Id$
+ * @version $Id$
  */
 public class SimpleFormTransformer extends AbstractSAXTransformer implements Recyclable {
 
@@ -235,46 +235,46 @@
     }
 
     /** current element's request parameter values */
-    protected Object[] values = null;
+    protected Object[] values;
 
     /** current request's validation results (all validated elements) */
-    protected Map validationResults = null;
+    protected Map validationResults;
 
     /** Should we skip inserting values? */
-    private boolean fixed = false;
+    private boolean fixed;
     /** Is the complete document protected? */
-    private boolean documentFixed = false;
+    private boolean documentFixed;
 
     private String fixedName = "fixed";
-    private String prefix = null;
-    private String suffix = null;
-    private String defaultPrefix = null;
-    private String defaultSuffix = null;
-    private String separator = null;
-    private String formName = null;
-    private boolean useFormName = false;
-    private boolean useFormNameTwice = false;
-    private boolean ignoreValidation = false;
+    private String prefix;
+    private String suffix;
+    private String defaultPrefix;
+    private String defaultSuffix;
+    private String separator;
+    private String formName;
+    private boolean useFormName;
+    private boolean useFormNameTwice;
+    private boolean ignoreValidation;
     private int decorationSize = 1;
 
     private String defaultInput = "request-param";
-    private Configuration defaultInputConf = null;
-    private Configuration inputConf = null;
-    private InputModule input = null;
-    private ServiceSelector inputSelector = null;
-    private String inputName = null;
+    private Configuration defaultInputConf;
+    private Configuration inputConf;
+    private InputModule input;
+    private ServiceSelector inputSelector;
+    private String inputName;
 
     /** Skip element's content only. Otherwise skip also surrounding element. */
-    protected boolean skipChildrenOnly = false;
+    protected boolean skipChildrenOnly;
 
     /** Count nested repeat elements. */
-    protected int recordingCount = 0;
+    protected int recordingCount;
 
     /** List of {@link RepeaterStatus} elements keeping track of nested repeat blocks. */
-    protected List repeater = null;
+    protected List repeater;
 
     /** Map of {@link ValueList} to track multiple parameters. */
-    protected Map formValues = null;
+    protected Map formValues;
 
     /**
      * Keep track of repeater status.
@@ -461,8 +461,8 @@
      *  Recycle this component.
      */
     public void recycle() {
+        reset();
         super.recycle();
-        this.reset();
     }
 
     /**

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java?rev=168366&r1=168365&r2=168366&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java Thu May  5 11:23:18 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -229,11 +229,10 @@
  * @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
  * @author <a href="mailto:jeremy@apache.org">Jeremy Quinn</a>
  * @author <a href="mailto:gianugo@apache.org">Gianugo Rabellino</a>
- * @version CVS $Id$
+ * @version $Id$
  */
-public class SourceWritingTransformer
-    extends AbstractSAXTransformer
-    implements Disposable {
+public class SourceWritingTransformer extends AbstractSAXTransformer
+                                      implements Disposable {
 
     public static final String SWT_URI = "http://apache.org/cocoon/source/1.0";
     public static final String DEFAULT_SERIALIZER = "xml";
@@ -816,5 +815,6 @@
             this.manager.release(this.xpathProcessor);
             this.xpathProcessor = null;
         }
+        super.dispose();
     }
 }



Mime
View raw message