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-1468 cdi is ok with a WebApp even with app composer
Date Thu, 04 Dec 2014 17:41:01 GMT
Repository: tomee
Updated Branches:
  refs/heads/develop d2a5334fe -> d464e3bff


TOMEE-1468 cdi is ok with a WebApp even with app composer


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

Branch: refs/heads/develop
Commit: d464e3bfff00ce83a06ec12cc6bf4078c9ab8d6f
Parents: d2a5334
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Thu Dec 4 18:40:52 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Thu Dec 4 18:40:52 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/openejb/cdi/CdiScanner.java         | 4 +++-
 .../java/org/apache/openejb/config/rules/CheckCdiEnabled.java    | 2 +-
 .../java/org/apache/openejb/testing/ApplicationComposers.java    | 3 +++
 3 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/d464e3bf/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 726d67e..6ca3e44 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
@@ -183,7 +183,9 @@ public class CdiScanner implements ScannerService {
 
             // here for ears we need to skip classes in the parent classloader
             final ClassLoader scl = ClassLoader.getSystemClassLoader();
-            final boolean filterByClassLoader = "true".equals(SystemInstance.get().getProperty(OPENEJB_CDI_FILTER_CLASSLOADER,
"true"));
+            final boolean filterByClassLoader = "true".equals(
+                    ejbJar.properties.getProperty(OPENEJB_CDI_FILTER_CLASSLOADER,
+                            SystemInstance.get().getProperty(OPENEJB_CDI_FILTER_CLASSLOADER,
"true")));
 
             final BeanArchiveService beanArchiveService = webBeansContext.getBeanArchiveService();
             final boolean openejb = OpenEJBBeanInfoService.class.isInstance(beanArchiveService);

http://git-wip-us.apache.org/repos/asf/tomee/blob/d464e3bf/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCdiEnabled.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCdiEnabled.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCdiEnabled.java
index 7ea0e9e..86fd2cd 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCdiEnabled.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/rules/CheckCdiEnabled.java
@@ -24,7 +24,7 @@ import javax.inject.Inject;
 
 public class CheckCdiEnabled extends ValidationBase {
     public void validate(final EjbModule ejbModule) {
-        if (ejbModule.getFinder() == null) {
+        if (ejbModule.getFinder() == null || ejbModule.getProperties().containsKey("openejb.cdi.activated"))
{
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/d464e3bf/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
b/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
index ce941ee..70a6cd7 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/testing/ApplicationComposers.java
@@ -27,6 +27,7 @@ import org.apache.openejb.assembler.classic.AppInfo;
 import org.apache.openejb.assembler.classic.Assembler;
 import org.apache.openejb.assembler.classic.OpenEjbConfiguration;
 import org.apache.openejb.assembler.classic.WebAppBuilder;
+import org.apache.openejb.cdi.CdiScanner;
 import org.apache.openejb.cdi.OptimizedLoaderService;
 import org.apache.openejb.cdi.ScopeHelper;
 import org.apache.openejb.config.AppModule;
@@ -499,6 +500,7 @@ public final class ApplicationComposers {
                     webModule.getAltDDs().putAll(descriptorsToMap(method.getAnnotation(Descriptors.class)));
 
                     final EjbModule ejbModule = DeploymentLoader.addWebModule(webModule,
appModule);
+                    ejbModule.getProperties().put(CdiScanner.OPENEJB_CDI_FILTER_CLASSLOADER,
"false");
                     if (cdi) {
                         ejbModule.setBeans(beans(new Beans(), cdiDecorators, cdiInterceptors,
cdiAlternatives));
                     }
@@ -559,6 +561,7 @@ public final class ApplicationComposers {
                     webModule.getAltDDs().putAll(descriptorsToMap(method.getAnnotation(Descriptors.class)));
 
                     final EjbModule ejbModule = DeploymentLoader.addWebModule(webModule,
appModule);
+                    ejbModule.getProperties().put(CdiScanner.OPENEJB_CDI_FILTER_CLASSLOADER,
"false");
                     if (cdi) {
                         ejbModule.setBeans(beans(new Beans(), cdiDecorators, cdiInterceptors,
cdiAlternatives));
                     }


Mime
View raw message