tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject svn commit: r399545 - /tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java
Date Thu, 04 May 2006 04:49:11 GMT
Author: billbarker
Date: Wed May  3 21:49:09 2006
New Revision: 399545

URL: http://svn.apache.org/viewcvs?rev=399545&view=rev
Log:
Enable Annotation processing for Tags even when pooling is disabled.

Of course, this will be horrible slow at least until Jasper looks for metadata-complete.

Also style fixes on the tagPoolHandler Vector.


Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewcvs/tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java?rev=399545&r1=399544&r2=399545&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/compiler/Generator.java Wed May  3 21:49:09
2006
@@ -93,7 +93,7 @@
 
     private PageInfo pageInfo;
 
-    private Vector tagHandlerPoolNames;
+    private Vector<String> tagHandlerPoolNames;
 
     private GenBuffer charArrayBuffer;
 
@@ -385,7 +385,7 @@
         out.pushIndent();
         if (isPoolingEnabled) {
             for (int i = 0; i < tagHandlerPoolNames.size(); i++) {
-                out.printin((String) tagHandlerPoolNames.elementAt(i));
+                out.printin(tagHandlerPoolNames.elementAt(i));
                 out
                         .print(" = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(");
                 if (ctxt.isTagFile()) {
@@ -422,8 +422,20 @@
         
         if (isPoolingEnabled) {
             for (int i = 0; i < tagHandlerPoolNames.size(); i++) {
-                out.printin((String) tagHandlerPoolNames.elementAt(i));
-                out.println(".release();");
+                out.printin("Tag handler = ");
+                out.printin(tagHandlerPoolNames.elementAt(i));
+                out.println(";");
+                out.println("handler.release();");
+                out.println("try {");
+                out.pushIndent();
+                out.println("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(handler);");
+                out.popIndent();
+                out.println("} catch (Exception e) {");
+                out.pushIndent();
+                out.println("log(\"Error processing preDestroy on tag instance of \" ");
+                out.println(" + handler.getClass().getName());");
+                out.popIndent();
+                out.println("}");
             }
         }
         
@@ -2143,6 +2155,9 @@
                 out.print("new ");
                 out.print(tagHandlerClassName);
                 out.println("();");
+                out.printin("org.apache.jasper.runtime.AnnotationProcessor.postConstruct(");
+                out.print(tagHandlerVar);
+                out.println(");");
             }
 
             // includes setting the context
@@ -2288,6 +2303,19 @@
                 } else {
                     out.printin(tagHandlerVar);
                     out.println(".release();");
+                    out.println("try {");
+                    out.pushIndent();
+                    out.printin("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(");
+                    out.print(tagHandlerVar);
+                    out.println(");");
+                    out.popIndent();
+                    out.println("} catch (Exception e) {");
+                    out.pushIndent();
+                    out.println("log(\"Error processing preDestroy on tag instance of \"
+");
+                    out.printin(tagHandlerVar);
+                    out.println(".getClass().getName());");
+                    out.popIndent();
+                    out.println("}");
                 }
             }
             if (isTagFile || isFragment) {
@@ -2330,6 +2358,17 @@
             } else {
                 out.printin(tagHandlerVar);
                 out.println(".release();");
+                out.println("try {");
+                out.pushIndent();
+                out.printin("org.apache.jasper.runtime.AnnotationProcessor.preDestroy(");
+                out.print(tagHandlerVar);
+                out.println(");");
+                out.println("} catch (Exception e) {");
+                out.println("log(\"Error processing preDestroy on tag instance of \" +");
+                out.printin(tagHandlerVar);
+                out.println(".getClass().getName());");
+                out.popIndent();
+                out.println("}");
             }
 
             if (n.implementsTryCatchFinally()) {



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


Mime
View raw message