geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From de...@apache.org
Subject svn commit: r906867 [2/2] - in /geronimo/external/trunk/tomcat-parent-6.0.24: catalina/src/main/java/org/apache/catalina/core/ catalina/src/main/java/org/apache/catalina/deploy/ catalina/src/main/java/org/apache/catalina/servlets/ catalina/src/main/jav...
Date Fri, 05 Feb 2010 09:23:36 GMT
Modified: geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/core/LocalStrings.properties
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/core/LocalStrings.properties?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/core/LocalStrings.properties
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/core/LocalStrings.properties
Fri Feb  5 09:23:34 2010
@@ -206,7 +206,6 @@
 standardWrapper.notContext=Parent container of a Wrapper must be a Context
 standardWrapper.notFound=Servlet {0} is not available
 standardWrapper.notServlet=Class {0} is not a Servlet
-standardWrapper.privilegedServlet=Servlet of class {0} is privileged and cannot be loaded
by this web application
 standardWrapper.releaseFilters=Release filters exception for servlet {0}
 standardWrapper.serviceException=Servlet.service() for servlet {0} threw exception
 standardWrapper.statusHeader=HTTP Status {0} - {1}
@@ -215,7 +214,9 @@
 standardWrapper.unloadException=Servlet {0} threw unload() exception
 standardWrapper.unloading=Cannot allocate servlet {0} because it is being unloaded
 standardWrapper.waiting=Waiting for {0} instance(s) to be deallocated
-standardWrapper.restrictedServletsResource=Restricted servlets property file not found
 
-applicationFilterConfig.restrictedFiltersResource=Restricted filters property file not found
-applicationFilterConfig.privilegedFilter=Filter of class {0} is privileged and cannot be
loaded by this web application
+defaultInstanceManager.restrictedServletsResource=Restricted servlets property file not found
+defaultInstanceManager.privilegedServlet=Servlet of class {0} is privileged and cannot be
loaded by this web application
+defaultInstanceManager.restrictedFiltersResource=Restricted filters property file not found
+defaultInstanceManager.privilegedFilter=Filter of class {0} is privileged and cannot be loaded
by this web application
+defaultInstanceManager.restrictedListenersResources="Restricted listeners property file not
found
\ No newline at end of file

Modified: geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/core/mbeans-descriptors.xml
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/core/mbeans-descriptors.xml?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/core/mbeans-descriptors.xml
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/core/mbeans-descriptors.xml
Fri Feb  5 09:23:34 2010
@@ -64,9 +64,9 @@
                is="true"
                type="boolean"/>
       
-     <attribute name="annotationProcessor"
-                description="Object that processes things like injection annotations"
-                type="org.apache.AnnotationProcessor" />
+    <attribute name="instanceManager"
+                description="Object that creates and destroys servlets, filters, and listeners.
Include dependency injection and postConstruct/preDestory handling"
+                type="org.apache.catalina.instanceManagement.InstanceManager" />
 
     <attribute name="antiJARLocking"
                description="Take care to not lock jar files"

Modified: geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/servlets/LocalStrings.properties
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/servlets/LocalStrings.properties?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/servlets/LocalStrings.properties
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/servlets/LocalStrings.properties
Fri Feb  5 09:23:34 2010
@@ -25,7 +25,6 @@
 invokerServlet.notNamed=Cannot call invoker servlet with a named dispatcher
 invokerServlet.noWrapper=Container has not called setWrapper() for this servlet
 webdavservlet.jaxpfailed=JAXP initialization failed
-webdavservlet.enternalEntityIgnored=The request included a reference to an external entity
with PublicID {0} and SystemID {1} which was ignored
 directory.filename=Filename
 directory.lastModified=Last Modified
 directory.parent=Up To {0}

Modified: geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/util/ServerInfo.properties
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/util/ServerInfo.properties?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/util/ServerInfo.properties
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/catalina/src/main/resources/org/apache/catalina/util/ServerInfo.properties
Fri Feb  5 09:23:34 2010
@@ -13,6 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-server.info=Apache Tomcat/@VERSION@
+server.info=Apache Geronimo (Embedded Tomcat/@VERSION@)
 server.number=@VERSION_NUMBER@
-server.built=@VERSION_BUILT@
\ No newline at end of file
+server.built=@VERSION_BUILT@

Modified: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/Constants.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/Constants.java?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/Constants.java
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/Constants.java
Fri Feb  5 09:23:34 2010
@@ -204,5 +204,6 @@
     public static final String SESSION_PARAMETER_NAME =
         System.getProperty("org.apache.catalina.SESSION_PARAMETER_NAME",
                 "jsessionid");
-
+    public static final boolean USE_INSTANCE_MANAGER_FOR_TAGS =
+      Boolean.valueOf(System.getProperty("org.apache.jasper.Constants.USE_INSTANCE_MANAGER_FOR_TAGS",
"false")).booleanValue();
 }

Modified: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/JspCompilationContext.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/JspCompilationContext.java?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/JspCompilationContext.java
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/JspCompilationContext.java
Fri Feb  5 09:23:34 2010
@@ -612,12 +612,7 @@
         try {
             getJspLoader();
             
-            String name;
-            if (isTagFile()) {
-                name = tagInfo.getTagClassName();
-            } else {
-                name = getServletPackageName() + "." + getServletClassName();
-            }
+            String name = getFQCN();
             servletClass = jspLoader.loadClass(name);
         } catch (ClassNotFoundException cex) {
             throw new JasperException(Localizer.getMessage("jsp.error.unable.load"),
@@ -630,6 +625,16 @@
         return servletClass;
     }
 
+    public String getFQCN() {
+        String name;
+        if (isTagFile()) {
+            name = tagInfo.getTagClassName();
+        } else {
+            name = getServletPackageName() + "." + getServletClassName();
+        }
+        return name;
+    }
+
     // ==================== protected methods ==================== 
 
     static Object outputDirLock = new Object();

Modified: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/compiler/Generator.java?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/compiler/Generator.java
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/compiler/Generator.java
Fri Feb  5 09:23:34 2010
@@ -75,8 +75,8 @@
 
     private static final String VAR_EXPRESSIONFACTORY = 
         System.getProperty("org.apache.jasper.compiler.Generator.VAR_EXPRESSIONFACTORY",
"_el_expressionfactory");
-    private static final String VAR_ANNOTATIONPROCESSOR = 
-        System.getProperty("org.apache.jasper.compiler.Generator.VAR_ANNOTATIONPROCESSOR",
"_jsp_annotationprocessor");
+     private static final String VAR_INSTANCEMANAGER =
+        System.getProperty("org.apache.jasper.compiler.Generator.VAR_INSTANCEMANAGER", "_jsp_instancemanager");
 
     private ServletWriter out;
 
@@ -423,14 +423,14 @@
         }
         out.println(".getServletContext()).getExpressionFactory();");
 
-        out.printin(VAR_ANNOTATIONPROCESSOR);
-        out.print(" = (org.apache.AnnotationProcessor) ");
+        out.printin(VAR_INSTANCEMANAGER);
+        out.print(" = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(");
         if (ctxt.isTagFile()) {
             out.print("config");
         } else {
             out.print("getServletConfig()");
         }
-        out.println(".getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());");
+         out.println(");");
 
         out.popIndent();
         out.printil("}");
@@ -534,8 +534,8 @@
         out.printin("private javax.el.ExpressionFactory ");
         out.print(VAR_EXPRESSIONFACTORY);
         out.println(";");
-        out.printin("private org.apache.AnnotationProcessor ");
-        out.print(VAR_ANNOTATIONPROCESSOR);
+        out.printin("private org.apache.InstanceManager ");
+        out.print(VAR_INSTANCEMANAGER);
         out.println(";");
         out.println();
     }
@@ -2158,11 +2158,11 @@
 
             String tagHandlerClassName = JspUtil
                     .getCanonicalName(tagHandlerClass);
-            out.printin(tagHandlerClassName);
-            out.print(" ");
-            out.print(tagHandlerVar);
-            out.print(" = ");
             if (isPoolingEnabled && !(n.implementsJspIdConsumer())) {
+                out.printin(tagHandlerClassName);
+                out.print(" ");
+                out.print(tagHandlerVar);
+                out.print(" = ");
                 out.print("(");
                 out.print(tagHandlerClassName);
                 out.print(") ");
@@ -2171,14 +2171,7 @@
                 out.print(tagHandlerClassName);
                 out.println(".class);");
             } else {
-                out.print("new ");
-                out.print(tagHandlerClassName);
-                out.println("();");
-                out.printin("org.apache.jasper.runtime.AnnotationHelper.postConstruct(");
-                out.print(VAR_ANNOTATIONPROCESSOR);
-                out.print(", ");
-                out.print(tagHandlerVar);
-                out.println(");");
+               writeNewInstance(tagHandlerVar, tagHandlerClassName);
             }
 
             // includes setting the context
@@ -2236,8 +2229,7 @@
                         out.println("[0]++;");
                     }
                     out.printin(tagHandlerVar);
-                    out
-                            .println(".setBodyContent((javax.servlet.jsp.tagext.BodyContent)
out);");
+                   out.println(".setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);");
                     out.printin(tagHandlerVar);
                     out.println(".doInitBody();");
 
@@ -2263,6 +2255,40 @@
             n.setEndJavaLine(out.getJavaLine());
         }
 
+        private void writeNewInstance(String tagHandlerVar, String tagHandlerClassName) {
+        	if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+        		out.printin(tagHandlerClassName);
+        		out.print(" ");
+        		out.print(tagHandlerVar);
+        		out.print(" = (");
+        		out.print(tagHandlerClassName);
+        		out.print(")");
+        		out.print(VAR_INSTANCEMANAGER);
+        		out.print(".newInstance(\"");
+        		out.print(tagHandlerClassName);
+        		out.println("\", this.getClass().getClassLoader());");
+        	} else {
+        		out.printin(tagHandlerClassName);
+        		out.print(" ");
+        		out.print(tagHandlerVar);
+        		out.print(" = (");
+        		out.print("new ");
+        		out.print(tagHandlerClassName);
+        		out.println("());");
+        		out.printin(VAR_INSTANCEMANAGER);
+        		out.print(".newInstance(");
+        		out.print(tagHandlerVar);
+        		out.println(");");
+        	}
+        }
+
+        private void writeDestroyInstance(String tagHandlerVar) {
+            out.printin(VAR_INSTANCEMANAGER);
+            out.print(".destroyInstance(");
+            out.print(tagHandlerVar);
+            out.println(");");
+        }
+
         private void generateCustomEnd(Node.CustomTag n, String tagHandlerVar,
                 String tagEvalVar, String tagPushBodyCountVar) {
 
@@ -2324,11 +2350,7 @@
                 } else {
                     out.printin(tagHandlerVar);
                     out.println(".release();");
-                    out.printin("org.apache.jasper.runtime.AnnotationHelper.preDestroy(");
-                    out.print(VAR_ANNOTATIONPROCESSOR);
-                    out.print(", ");
-                    out.print(tagHandlerVar);
-                    out.println(");");
+                    writeDestroyInstance(tagHandlerVar);
                 }
             }
             if (isTagFile || isFragment) {
@@ -2371,11 +2393,7 @@
             } else {
                 out.printin(tagHandlerVar);
                 out.println(".release();");
-                out.printin("org.apache.jasper.runtime.AnnotationHelper.preDestroy(");
-                out.print(VAR_ANNOTATIONPROCESSOR);
-                out.print(", ");
-                out.print(tagHandlerVar);
-                out.println(");");
+               writeDestroyInstance(tagHandlerVar);
             }
 
             if (n.implementsTryCatchFinally()) {
@@ -2407,20 +2425,7 @@
 
             String tagHandlerClassName = JspUtil
                     .getCanonicalName(tagHandlerClass);
-            out.printin(tagHandlerClassName);
-            out.print(" ");
-            out.print(tagHandlerVar);
-            out.print(" = ");
-            out.print("new ");
-            out.print(tagHandlerClassName);
-            out.println("();");
-
-            // Resource injection
-            out.printin("org.apache.jasper.runtime.AnnotationHelper.postConstruct(");
-            out.print(VAR_ANNOTATIONPROCESSOR);
-            out.print(", ");
-            out.print(tagHandlerVar);
-            out.println(");");
+            writeNewInstance(tagHandlerVar, tagHandlerClassName);
             
             generateSetters(n, tagHandlerVar, handlerInfo, true);
 
@@ -2474,11 +2479,7 @@
             syncScriptingVars(n, VariableInfo.AT_END);
 
             // Resource injection
-            out.printin("org.apache.jasper.runtime.AnnotationHelper.preDestroy(");
-            out.print(VAR_ANNOTATIONPROCESSOR);
-            out.print(", ");
-            out.print(tagHandlerVar);
-            out.println(");");
+             writeDestroyInstance(tagHandlerVar);
 
             n.setEndJavaLine(out.getJavaLine());
         }

Added: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/InstanceManagerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/InstanceManagerFactory.java?rev=906867&view=auto
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/InstanceManagerFactory.java
(added)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/InstanceManagerFactory.java
Fri Feb  5 09:23:34 2010
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.jasper.runtime;
+
+import javax.servlet.ServletConfig;
+
+import org.apache.InstanceManager;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class InstanceManagerFactory {
+
+    private InstanceManagerFactory() {
+    }
+
+    public static InstanceManager getInstanceManager(ServletConfig config) {
+        InstanceManager instanceManager = 
+        	(InstanceManager) config.getServletContext().getAttribute(InstanceManager.class.getName());
+        if (instanceManager == null) {
+            throw new IllegalStateException("No org.apache.InstanceManager set in ServletContext");
+        }
+        return instanceManager;
+    }
+
+}

Propchange: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/InstanceManagerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/InstanceManagerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/InstanceManagerFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/TagHandlerPool.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/TagHandlerPool.java?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/TagHandlerPool.java
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/runtime/TagHandlerPool.java
Fri Feb  5 09:23:34 2010
@@ -21,7 +21,7 @@
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.Tag;
 
-import org.apache.AnnotationProcessor;
+import org.apache.InstanceManager;
 import org.apache.jasper.Constants;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -42,7 +42,7 @@
     
     // index of next available tag handler
     private int current;
-    protected AnnotationProcessor annotationProcessor = null;
+    protected InstanceManager instanceManager = null;
 
     public static TagHandlerPool getTagHandlerPool( ServletConfig config) {
         TagHandlerPool result=null;
@@ -78,8 +78,7 @@
         }
         this.handlers = new Tag[maxSize];
         this.current = -1;
-        this.annotationProcessor = 
-            (AnnotationProcessor) config.getServletContext().getAttribute(AnnotationProcessor.class.getName());
+        instanceManager = InstanceManagerFactory.getInstanceManager(config);
     }
 
     /**
@@ -112,7 +111,7 @@
      * @throws JspException if a tag handler cannot be instantiated
      */
     public Tag get(Class handlerClass) throws JspException {
-	Tag handler = null;
+	Tag handler;
         synchronized( this ) {
             if (current >= 0) {
                 handler = handlers[current--];
@@ -123,9 +122,13 @@
         // Out of sync block - there is no need for other threads to
         // wait for us to construct a tag for this thread.
         try {
-            Tag instance = (Tag) handlerClass.newInstance();
-            AnnotationHelper.postConstruct(annotationProcessor, instance);
-            return instance;
+           	if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
+        		return (Tag) instanceManager.newInstance(handlerClass.getName(), handlerClass.getClassLoader());
+        	} else {
+                Tag instance = (Tag) handlerClass.newInstance();
+                instanceManager.newInstance(instance);
+                return instance;
+        	}
         } catch (Exception e) {
             throw new JspException(e.getMessage(), e);
         }
@@ -147,13 +150,11 @@
         }
         // There is no need for other threads to wait for us to release
         handler.release();
-        if (annotationProcessor != null) {
-            try {
-                AnnotationHelper.preDestroy(annotationProcessor, handler);
-            } catch (Exception e) {
-                log.warn("Error processing preDestroy on tag instance of " 
-                        + handler.getClass().getName(), e);
-            }
+         try {
+            instanceManager.destroyInstance(handler);
+        } catch (Exception e) {
+            log.warn("Error processing preDestroy on tag instance of "
+                    + handler.getClass().getName(), e);
         }
     }
 
@@ -164,13 +165,11 @@
     public synchronized void release() {
         for (int i = current; i >= 0; i--) {
             handlers[i].release();
-            if (annotationProcessor != null) {
-                try {
-                    AnnotationHelper.preDestroy(annotationProcessor, handlers[i]);
-                } catch (Exception e) {
-                    log.warn("Error processing preDestroy on tag instance of " 
-                            + handlers[i].getClass().getName(), e);
-                }
+            try {
+                instanceManager.destroyInstance(handlers[i]);
+            } catch (Exception e) {
+                log.warn("Error processing preDestroy on tag instance of "
+                        + handlers[i].getClass().getName(), e);
             }
         }
     }

Modified: geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=906867&r1=906866&r2=906867&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/jasper/src/main/java/org/apache/jasper/servlet/JspServletWrapper.java
Fri Feb  5 09:23:34 2010
@@ -31,7 +31,8 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.tagext.TagInfo;
 
-import org.apache.AnnotationProcessor;
+import org.apache.InstanceManager;
+import org.apache.jasper.runtime.InstanceManagerFactory;
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
 import org.apache.jasper.Options;
@@ -68,7 +69,6 @@
 
     private Servlet theServlet;
     private String jspUri;
-    private Class servletClass;
     private Class tagHandlerClass;
     private JspCompilationContext ctxt;
     private long available = 0L;
@@ -141,13 +141,8 @@
                     Servlet servlet = null;
                     
                     try {
-                        servletClass = ctxt.load();
-                        servlet = (Servlet) servletClass.newInstance();
-                        AnnotationProcessor annotationProcessor = (AnnotationProcessor) config.getServletContext().getAttribute(AnnotationProcessor.class.getName());
-                        if (annotationProcessor != null) {
-                           annotationProcessor.processAnnotations(servlet);
-                           annotationProcessor.postConstruct(servlet);
-                        }
+                          InstanceManager instanceManager = InstanceManagerFactory.getInstanceManager(config);
+                          servlet = (Servlet) instanceManager.newInstance(ctxt.getFQCN(),
ctxt.getJspLoader());
                     } catch (IllegalAccessException e) {
                         throw new JasperException(e);
                     } catch (InstantiationException e) {
@@ -426,15 +421,13 @@
     public void destroy() {
         if (theServlet != null) {
             theServlet.destroy();
-            AnnotationProcessor annotationProcessor = (AnnotationProcessor) config.getServletContext().getAttribute(AnnotationProcessor.class.getName());
-            if (annotationProcessor != null) {
-                try {
-                    annotationProcessor.preDestroy(theServlet);
-                } catch (Exception e) {
-                    // Log any exception, since it can't be passed along
-                    log.error(Localizer.getMessage("jsp.error.file.not.found",
-                           e.getMessage()), e);
-                }
+              InstanceManager instanceManager = InstanceManagerFactory.getInstanceManager(config);
+            try {
+                instanceManager.destroyInstance(theServlet);
+            } catch (Exception e) {
+                // Log any exception, since it can't be passed along
+                log.error(Localizer.getMessage("jsp.error.file.not.found",
+                        e.getMessage()), e);
             }
         }
     }

Added: geronimo/external/trunk/tomcat-parent-6.0.24/shared/src/main/java/org/apache/InstanceManager.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.24/shared/src/main/java/org/apache/InstanceManager.java?rev=906867&view=auto
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.24/shared/src/main/java/org/apache/InstanceManager.java
(added)
+++ geronimo/external/trunk/tomcat-parent-6.0.24/shared/src/main/java/org/apache/InstanceManager.java
Fri Feb  5 09:23:34 2010
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.naming.NamingException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface InstanceManager {
+
+    public Object newInstance(String className)
+    	throws IllegalAccessException, InvocationTargetException, NamingException, 
+    		InstantiationException, ClassNotFoundException;
+
+    public Object newInstance(String fqcn, ClassLoader classLoader) 
+    	throws IllegalAccessException, InvocationTargetException, NamingException, 
+    		InstantiationException, ClassNotFoundException;
+
+    public void newInstance(Object o) 
+		throws IllegalAccessException, InvocationTargetException, NamingException;
+
+    public void destroyInstance(Object o)
+    	throws IllegalAccessException, InvocationTargetException;
+}

Propchange: geronimo/external/trunk/tomcat-parent-6.0.24/shared/src/main/java/org/apache/InstanceManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/external/trunk/tomcat-parent-6.0.24/shared/src/main/java/org/apache/InstanceManager.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/external/trunk/tomcat-parent-6.0.24/shared/src/main/java/org/apache/InstanceManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message