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:40:44 GMT
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x 5b0d230c0 -> 4b7538493


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/4b753849
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/4b753849
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/4b753849

Branch: refs/heads/tomee-1.7.x
Commit: 4b75384937ab58d1542088e7062da168edb8c965
Parents: 5b0d230
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Thu Dec 4 18:40:30 2014 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Thu Dec 4 18:40:30 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    | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/4b753849/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 ca2970d..043f985 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
@@ -173,7 +173,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 Iterator<String> it = beans.managedClasses.iterator();
             while (it.hasNext()) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/4b753849/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/4b753849/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 21dd0a0..6b2453a 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));
                     }


Mime
View raw message