tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject tomee git commit: TOMEE-1925 improve WebContext#isWeb
Date Thu, 08 Sep 2016 21:00:11 GMT
Repository: tomee
Updated Branches:
  refs/heads/master 8ec2e6538 -> 50c0d734b


TOMEE-1925 improve WebContext#isWeb


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/50c0d734
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/50c0d734
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/50c0d734

Branch: refs/heads/master
Commit: 50c0d734b1359ba2bb22c62997def1c2ba14cfc4
Parents: 8ec2e65
Author: Mark Struberg <struberg@apache.org>
Authored: Thu Sep 8 22:59:32 2016 +0200
Committer: Mark Struberg <struberg@apache.org>
Committed: Thu Sep 8 22:59:32 2016 +0200

----------------------------------------------------------------------
 .../org/apache/openejb/core/WebContext.java     | 31 ++++++++++++++------
 1 file changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/50c0d734/container/openejb-core/src/main/java/org/apache/openejb/core/WebContext.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/WebContext.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/WebContext.java
index 0e090c0..075559a 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/WebContext.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/WebContext.java
@@ -39,11 +39,16 @@ import javax.servlet.ServletContextAttributeListener;
 import javax.servlet.ServletContextListener;
 import javax.servlet.ServletRequestAttributeListener;
 import javax.servlet.ServletRequestListener;
+import javax.servlet.http.HttpSessionActivationListener;
 import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionBindingListener;
 import javax.servlet.http.HttpSessionIdListener;
+import javax.servlet.http.HttpSessionListener;
+
 import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.EventListener;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -201,15 +206,23 @@ public class WebContext {
     }
 
     private static boolean isWeb(final Class<?> beanClass) {
-        return Servlet.class.isAssignableFrom(beanClass)
-            || Filter.class.isAssignableFrom(beanClass)
-            || HttpSessionAttributeListener.class.isAssignableFrom(beanClass)
-            || ServletContextListener.class.isAssignableFrom(beanClass)
-            || HttpSessionAttributeListener.class.isAssignableFrom(beanClass)
-            || ServletRequestListener.class.isAssignableFrom(beanClass)
-            || ServletContextAttributeListener.class.isAssignableFrom(beanClass)
-            || HttpSessionIdListener.class.isAssignableFrom(beanClass)
-            || ServletRequestAttributeListener.class.isAssignableFrom(beanClass);
+        if (Servlet.class.isAssignableFrom(beanClass)
+            || Filter.class.isAssignableFrom(beanClass)) {
+            return true;
+        }
+        if (EventListener.class.isAssignableFrom(beanClass)) {
+            return HttpSessionAttributeListener.class.isAssignableFrom(beanClass)
+                   || ServletContextListener.class.isAssignableFrom(beanClass)
+                   || ServletRequestListener.class.isAssignableFrom(beanClass)
+                   || ServletContextAttributeListener.class.isAssignableFrom(beanClass)
+                   || HttpSessionListener.class.isAssignableFrom(beanClass)
+                   || HttpSessionBindingListener.class.isAssignableFrom(beanClass)
+                   || HttpSessionActivationListener.class.isAssignableFrom(beanClass)
+                   || HttpSessionIdListener.class.isAssignableFrom(beanClass)
+                   || ServletRequestAttributeListener.class.isAssignableFrom(beanClass);
+        }
+
+        return false;
     }
 
     public WebBeansContext getWebBeansContext() {


Mime
View raw message