geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r999686 - in /geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina: Context.java core/ApplicationContext.java core/AsyncContextImpl.java
Date Tue, 21 Sep 2010 23:20:54 GMT
Author: djencks
Date: Tue Sep 21 23:20:53 2010
New Revision: 999686

URL: http://svn.apache.org/viewvc?rev=999686&view=rev
Log:
GERONIMO-5622 (bug 49937) A more expansive view of AysncListeners

Modified:
    geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/Context.java
    geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ApplicationContext.java
    geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/AsyncContextImpl.java

Modified: geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/Context.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/Context.java?rev=999686&r1=999685&r2=999686&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/Context.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/Context.java
Tue Sep 21 23:20:53 2010
@@ -26,6 +26,7 @@ import javax.servlet.ServletContainerIni
 import javax.servlet.ServletContext;
 import javax.servlet.descriptor.JspConfigDescriptor;
 
+import org.apache.tomcat.InstanceManager;
 import org.apache.tomcat.JarScanner;
 import org.apache.tomcat.util.http.mapper.Mapper;
 
@@ -1222,5 +1223,6 @@ public interface Context extends Contain
 
     boolean isServlet22();
 
+    InstanceManager getInstanceManager();
 }
 

Modified: geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ApplicationContext.java?rev=999686&r1=999685&r2=999686&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ApplicationContext.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/ApplicationContext.java
Tue Sep 21 23:20:53 2010
@@ -38,6 +38,7 @@ import java.util.concurrent.ConcurrentHa
 import javax.naming.Binding;
 import javax.naming.NamingException;
 import javax.naming.directory.DirContext;
+import javax.servlet.AsyncListener;
 import javax.servlet.Filter;
 import javax.servlet.FilterRegistration;
 import javax.servlet.RequestDispatcher;
@@ -1287,6 +1288,10 @@ public class ApplicationContext
             context.addApplicationLifecycleListener(t);
             match = true;
         }
+
+        if (t instanceof AsyncListener) {
+            match = true;
+        }
         
         if (match) return;
         

Modified: geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/AsyncContextImpl.java?rev=999686&r1=999685&r2=999686&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/AsyncContextImpl.java
(original)
+++ geronimo/external/trunk/tomcat-parent-7.0.0/catalina/src/main/java/org/apache/catalina/core/AsyncContextImpl.java
Tue Sep 21 23:20:53 2010
@@ -17,11 +17,13 @@
 package org.apache.catalina.core;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 
+import javax.naming.NamingException;
 import javax.servlet.AsyncContext;
 import javax.servlet.AsyncEvent;
 import javax.servlet.AsyncListener;
@@ -230,13 +232,22 @@ public class AsyncContextImpl implements
             throws ServletException {
         T listener = null;
         try {
-             listener = clazz.newInstance();
+             listener = (T) context.getInstanceManager().newInstance(clazz.getName(), clazz.getClassLoader());
         } catch (InstantiationException e) {
             ServletException se = new ServletException(e);
             throw se;
         } catch (IllegalAccessException e) {
             ServletException se = new ServletException(e);
             throw se;
+        } catch (ClassNotFoundException e) {
+            ServletException se = new ServletException(e);
+            throw se;
+        } catch (NamingException e) {
+            ServletException se = new ServletException(e);
+            throw se;
+        } catch (InvocationTargetException e) {
+            ServletException se = new ServletException(e);
+            throw se;
         }
         return listener;
     }



Mime
View raw message