commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl StaticTagScript.java TagScript.java
Date Thu, 18 Dec 2003 17:05:23 GMT
morgand     2003/12/18 09:05:23

  Modified:    jelly/src/java/org/apache/commons/jelly JellyContext.java
               jelly/src/java/org/apache/commons/jelly/impl
                        StaticTagScript.java TagScript.java
  Log:
  applied Scott Howlett's patch to TagScript and StaticTagScript to prevent
  excessive memory usage within a thread pool; removed ThreadLocal
  cache of XML parsers from JellyContext for the same reason
  
  Revision  Changes    Path
  1.49      +1 -8      jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java
  
  Index: JellyContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/JellyContext.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- JellyContext.java	9 Oct 2003 21:21:27 -0000	1.48
  +++ JellyContext.java	18 Dec 2003 17:05:23 -0000	1.49
  @@ -118,9 +118,6 @@
           
       /** Should we cache Tag instances, per thread, to reduce object contruction overhead?
*/
       private boolean cacheTags = false;
  -
  -    /** a Thread local cache of XMLParsers to avoid startup overhead of an XMLParser */
  -    private ThreadLocal parserPool = new ThreadLocal();
       
       /**
        * The class loader to use for instantiating application objects.
  @@ -500,11 +497,7 @@
        * of the XMLParser
        */
       protected XMLParser getXMLParser() {
  -        XMLParser parser = (XMLParser) parserPool.get();
  -        if (parser == null) {
  -            parser = createXMLParser();
  -            parserPool.set(parser);
  -        }
  +        XMLParser parser = createXMLParser();
           return parser;
       }
   
  
  
  
  1.20      +8 -0      jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/StaticTagScript.java
  
  Index: StaticTagScript.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/StaticTagScript.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- StaticTagScript.java	9 Oct 2003 21:21:28 -0000	1.19
  +++ StaticTagScript.java	18 Dec 2003 17:05:23 -0000	1.20
  @@ -103,6 +103,9 @@
               throw new JellyTagException("could not start namespace prefixes",e);
           }
               
  +        if ( ! context.isCacheTags() ) {
  +            clearTag();
  +        }
           Tag tag = null;
           try {
               tag = getTag();                
  @@ -149,6 +152,11 @@
           }
           catch (RuntimeException e) {
               handleException(e);
  +        }
  +        finally {
  +            if ( ! context.isCacheTags() ) {
  +                clearTag();
  +            }
           }
           
           try {
  
  
  
  1.39      +10 -5     jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TagScript.java
  
  Index: TagScript.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/src/java/org/apache/commons/jelly/impl/TagScript.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- TagScript.java	9 Oct 2003 21:21:28 -0000	1.38
  +++ TagScript.java	18 Dec 2003 17:05:23 -0000	1.39
  @@ -295,6 +295,11 @@
               */
               handleException(e);
           }
  +        finally {
  +            if ( ! context.isCacheTags() ) {
  +                clearTag();
  +            }
  +        }
           
       }
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message