tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: TOMEE-1448 keep container classes in CDI context
Date Tue, 18 Nov 2014 14:13:10 GMT
Repository: tomee
Updated Branches:
  refs/heads/develop e00425fc5 -> aa59ad798


TOMEE-1448 keep container classes in CDI context


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

Branch: refs/heads/develop
Commit: aa59ad798ccdd1994f50bcb2ea9a2a9b1db44678
Parents: e00425f
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Tue Nov 18 15:12:38 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Tue Nov 18 15:12:38 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/openejb/cdi/CdiScanner.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/aa59ad79/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
index 19383ec..726d67e 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiScanner.java
@@ -28,6 +28,7 @@ import org.apache.openejb.cdi.transactional.NotSupportedInterceptor;
 import org.apache.openejb.cdi.transactional.RequiredInterceptor;
 import org.apache.openejb.cdi.transactional.RequiredNewInterceptor;
 import org.apache.openejb.cdi.transactional.SupportsInterceptor;
+import org.apache.openejb.core.ParentClassLoaderFinder;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
@@ -68,6 +69,7 @@ public class CdiScanner implements ScannerService {
     private final Set<Class<?>> startupClasses = new HashSet<>();
 
     private WebBeansContext webBeansContext;
+    private ClassLoader containerLoader;
 
     public void setContext(final WebBeansContext webBeansContext) {
         this.webBeansContext = webBeansContext;
@@ -78,6 +80,7 @@ public class CdiScanner implements ScannerService {
         if (!StartupObject.class.isInstance (object)) {
             return;
         }
+        containerLoader = ParentClassLoaderFinder.Helper.get();
 
         final StartupObject startupObject = StartupObject.class.cast(object);
         final AppInfo appInfo = startupObject.getAppInfo();
@@ -265,7 +268,11 @@ public class CdiScanner implements ScannerService {
                     }
                 } else {
                     final ClassLoader loader = clazz.getClassLoader();
-                    if (!filterByClassLoader || comparator.isSame(loader) || (loader.equals(scl)
&& isNotEarWebApp)) {
+                    // main case it tries to filter is ear one ie lib classes shouldn't be
in webapp classes
+                    // but embedded case should still work
+                    if (!filterByClassLoader
+                            || comparator.isSame(loader)
+                            || ((loader.equals(scl) || loader == containerLoader) &&
isNotEarWebApp)) {
                         classes.add(clazz);
                         if (beans.startupClasses.contains(name)) {
                             startupClasses.add(clazz);


Mime
View raw message