tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject [16/28] tomee git commit: Gets the container
Date Thu, 20 Jul 2017 11:46:50 GMT
Gets the container


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

Branch: refs/heads/master
Commit: 8dbaee9ef489228bbc64b9c6d625404f32db876b
Parents: 2cac5ad
Author: Otavio Santana <otaviopolianasantana@gmail.com>
Authored: Wed Jul 12 10:47:15 2017 -0300
Committer: Otavio Santana <otaviopolianasantana@gmail.com>
Committed: Wed Jul 12 10:47:15 2017 -0300

----------------------------------------------------------------------
 .../ActivationConfigPropertyOverride.java       | 30 +++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/8dbaee9e/container/openejb-core/src/main/java/org/apache/openejb/config/ActivationConfigPropertyOverride.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ActivationConfigPropertyOverride.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/ActivationConfigPropertyOverride.java
index 597c13b..f7bbbdb 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ActivationConfigPropertyOverride.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ActivationConfigPropertyOverride.java
@@ -17,7 +17,9 @@
 
 package org.apache.openejb.config;
 
+import org.apache.openejb.Container;
 import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.core.mdb.MdbContainer;
 import org.apache.openejb.jee.ActivationConfig;
 import org.apache.openejb.jee.ActivationConfigProperty;
 import org.apache.openejb.jee.EjbJar;
@@ -26,6 +28,7 @@ import org.apache.openejb.jee.MessageDrivenBean;
 import org.apache.openejb.jee.oejb3.EjbDeployment;
 import org.apache.openejb.jee.oejb3.OpenejbJar;
 import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.spi.ContainerSystem;
 import org.apache.openejb.util.JavaSecurityManagers;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
@@ -86,7 +89,8 @@ public class ActivationConfigPropertyOverride implements DynamicDeployer
{
                         }
                     }
                 }
-
+                final MdbContainer mdbContainer = getMdbContainer(ejbDeployment.getContainerId());
+                
                 // now try to use special keys
                 final Properties overrides = ConfigurationFactory.getOverrides(properties,
"mdb.activation", "EnterpriseBean");
                 overrides.putAll(ConfigurationFactory.getOverrides(properties, mdb.getMessagingType()
+ ".activation", "EnterpriseBean"));
@@ -130,6 +134,30 @@ public class ActivationConfigPropertyOverride implements DynamicDeployer
{
         return appModule;
     }
 
+    private MdbContainer getMdbContainer(final String containerId) {
+
+        final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
+
+        if (containerId == null || containerId.length() == 0) {
+            final Container[] containers = containerSystem.containers();
+            for (Container container : containers) {
+                if (MdbContainer.class.isInstance(container)) {
+                    return MdbContainer.class.cast(container);
+                }
+            }
+
+            return null;
+        }
+
+        final Container container = containerSystem.getContainer(containerId);
+        if (MdbContainer.class.isInstance(container)) {
+            return MdbContainer.class.cast(container);
+        }
+        return null;
+
+    }
+
+
     private ActivationConfigProperty findActivationProperty(final List<ActivationConfigProperty>
activationConfigList, final String nameOfProperty) {
         for (final ActivationConfigProperty activationProp : activationConfigList) {
             if (activationProp.getActivationConfigPropertyName().equals(nameOfProperty))
{


Mime
View raw message