cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation TraxTransformer.java
Date Thu, 06 Jun 2002 13:05:13 GMT
cziegeler    2002/06/06 06:05:13

  Modified:    src/java/org/apache/cocoon/transformation
                        TraxTransformer.java
  Log:
  Cached logicsheet paramters, so that they are not generated twice
  
  Revision  Changes    Path
  1.29      +12 -5     xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java
  
  Index: TraxTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- TraxTransformer.java	4 Jun 2002 07:31:52 -0000	1.28
  +++ TraxTransformer.java	6 Jun 2002 13:05:13 -0000	1.29
  @@ -158,7 +158,7 @@
    * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
    * @author <a href="mailto:marbut@hplb.hpl.hp.com">Mark H. Butler</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Id: TraxTransformer.java,v 1.28 2002/06/04 07:31:52 cziegeler Exp $
  + * @version CVS $Id: TraxTransformer.java,v 1.29 2002/06/06 13:05:13 cziegeler Exp $
    */
   public class TraxTransformer extends AbstractTransformer
   implements Transformer, Composable, Configurable, CacheableProcessingComponent, Disposable
{
  @@ -208,6 +208,9 @@
       /** Did we finish the processing (is endDocument() called) */
       private boolean finishedDocument = false;
   
  +    /** Cache logicsheet parameters */
  +    private Map logicSheetParameters;
  +
       /**
        * Configure this transformer.
        */
  @@ -331,7 +334,7 @@
        * @return The generated key hashes the src
        */
       public java.io.Serializable generateKey() {
  -        HashMap map = this.getLogicSheetParameters();
  +        Map map = this.getLogicSheetParameters();
           if (map == null) {
               return this.inputSource.getSystemId();
           }
  @@ -370,7 +373,7 @@
        */
       public void setConsumer(XMLConsumer consumer) {
   
  -        HashMap map = getLogicSheetParameters();
  +        Map map = getLogicSheetParameters();
           if (map != null) {
               Iterator iterator = map.keySet().iterator();
               while(iterator.hasNext()) {
  @@ -391,7 +394,10 @@
           transformerHandler.setResult(result);
       }
   
  -    private HashMap getLogicSheetParameters() {
  +    private Map getLogicSheetParameters() {
  +        if (this.logicSheetParameters != null) {
  +            return this.logicSheetParameters;
  +        }
           HashMap map = null;
           if (par != null) {
               String[] params = par.getNames();
  @@ -522,7 +528,7 @@
                   getLogger().error("Error setting DELI info", e);
               }
           }
  -
  +        this.logicSheetParameters = map;
           return map;
       }
   
  @@ -576,6 +582,7 @@
               } catch (Exception ignore) {}
           }
           this.finishedDocument = false;
  +        this.logicSheetParameters = null;
           super.recycle();
       }
   
  
  
  

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