Author: remy.maucherat(a)jboss.com
Date: 2011-05-24 07:53:52 -0400 (Tue, 24 May 2011)
New Revision: 1726
Modified:
branches/3.0.x/java/org/apache/jasper/compiler/Generator.java
branches/3.0.x/java/org/apache/jasper/runtime/TagHandlerPool.java
branches/3.0.x/webapps/docs/changelog.xml
Log:
- JBWEB-200: Port the tag classloading tweaks from 7.
Modified: branches/3.0.x/java/org/apache/jasper/compiler/Generator.java
===================================================================
--- branches/3.0.x/java/org/apache/jasper/compiler/Generator.java 2011-05-17 09:39:15 UTC
(rev 1725)
+++ branches/3.0.x/java/org/apache/jasper/compiler/Generator.java 2011-05-24 11:53:52 UTC
(rev 1726)
@@ -2312,9 +2312,9 @@
out.print(tagHandlerClassName);
out.print(")");
out.print(VAR_INSTANCEMANAGER);
- out.print(".newInstance(\"");
+ out.print(".newInstance(");
out.print(tagHandlerClassName);
- out.println("\", this.getClass().getClassLoader());");
+ out.println(".class);");
} else {
out.printin(tagHandlerClassName);
out.print(" ");
@@ -2333,7 +2333,7 @@
}
private void writeDestroyInstance(String tagHandlerVar) {
- if (Constants.INJECT_TAGS) {
+ if (Constants.INJECT_TAGS || Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
out.printin(VAR_INSTANCEMANAGER);
out.print(".destroyInstance(");
out.print(tagHandlerVar);
Modified: branches/3.0.x/java/org/apache/jasper/runtime/TagHandlerPool.java
===================================================================
--- branches/3.0.x/java/org/apache/jasper/runtime/TagHandlerPool.java 2011-05-17 09:39:15
UTC (rev 1725)
+++ branches/3.0.x/java/org/apache/jasper/runtime/TagHandlerPool.java 2011-05-24 11:53:52
UTC (rev 1726)
@@ -121,15 +121,15 @@
// Out of sync block - there is no need for other threads to
// wait for us to construct a tag for this thread.
try {
- if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
- return (Tag) instanceManager.newInstance(handlerClass.getName(),
handlerClass.getClassLoader());
- } else {
+ if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+ return (Tag) instanceManager.newInstance(handlerClass);
+ } else {
Tag instance = (Tag) handlerClass.newInstance();
if (Constants.INJECT_TAGS) {
instanceManager.newInstance(instance);
}
return instance;
- }
+ }
} catch (Exception e) {
throw new JspException(e.getMessage(), e);
}
@@ -151,14 +151,6 @@
}
// There is no need for other threads to wait for us to release
handler.release();
- if (Constants.INJECT_TAGS) {
- try {
- instanceManager.destroyInstance(handler);
- } catch (Exception e) {
- log.warn("Error processing preDestroy on tag instance of "
- + handler.getClass().getName(), e);
- }
- }
}
/**
Modified: branches/3.0.x/webapps/docs/changelog.xml
===================================================================
--- branches/3.0.x/webapps/docs/changelog.xml 2011-05-17 09:39:15 UTC (rev 1725)
+++ branches/3.0.x/webapps/docs/changelog.xml 2011-05-24 11:53:52 UTC (rev 1726)
@@ -51,6 +51,9 @@
<fix>
Close reader in JDT compiler. (markt)
</fix>
+ <fix>
+ <jira>200</jira>: Improve tags classloading. (remm)
+ </fix>
</changelog>
</subsection>
</section>