tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject [17/28] tomee git commit: move the code to ActivationConfigProperty
Date Thu, 20 Jul 2017 11:46:51 GMT
move the code to ActivationConfigProperty


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

Branch: refs/heads/master
Commit: c6da93c10b86ce3d7950160168138b6a48525e07
Parents: 8dbaee9
Author: Otavio Santana <otaviopolianasantana@gmail.com>
Authored: Wed Jul 12 11:02:43 2017 -0300
Committer: Otavio Santana <otaviopolianasantana@gmail.com>
Committed: Wed Jul 12 11:02:43 2017 -0300

----------------------------------------------------------------------
 .../config/ActivationConfigPropertyOverride.java  | 11 ++++++++++-
 .../org/apache/openejb/core/mdb/MdbContainer.java | 18 +++++++++++-------
 2 files changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/c6da93c1/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 f7bbbdb..b6e5ab3 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
@@ -90,13 +90,22 @@ public class ActivationConfigPropertyOverride implements DynamicDeployer
{
                     }
                 }
                 final MdbContainer mdbContainer = getMdbContainer(ejbDeployment.getContainerId());
-                
+                Properties propertiesContainer = mdbContainer.getProperties();
                 // now try to use special keys
                 final Properties overrides = ConfigurationFactory.getOverrides(properties,
"mdb.activation", "EnterpriseBean");
                 overrides.putAll(ConfigurationFactory.getOverrides(properties, mdb.getMessagingType()
+ ".activation", "EnterpriseBean"));
                 overrides.putAll(ConfigurationFactory.getOverrides(properties, ejbName +
".activation", "EnterpriseBean"));
                 overrides.putAll(ConfigurationFactory.getOverrides(properties, ejbDeployment.getDeploymentId()
+ ".activation", "EnterpriseBean"));
 
+                if (propertiesContainer != null) {
+                    for (Map.Entry<Object, Object> entry : propertiesContainer.entrySet())
{
+                        if (entry.getKey().toString().startsWith("activation.")) {
+                            overrides.put(entry.getKey(), entry.getValue());
+                        }
+                    }
+
+                }
+
                 // If we don't have any overrides, skip to the next
                 if (overrides.size() == 0) {
                     continue;

http://git-wip-us.apache.org/repos/asf/tomee/blob/c6da93c1/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java
index 52838f4..b732245 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java
@@ -151,6 +151,10 @@ public class MdbContainer implements RpcContainer {
         return activationSpecClass;
     }
 
+    public Properties getProperties() {
+        return properties;
+    }
+
     public void deploy(final BeanContext beanContext) throws OpenEJBException {
         final Object deploymentId = beanContext.getDeploymentID();
         if (!beanContext.getMdbInterface().equals(messageListenerInterface)) {
@@ -251,13 +255,13 @@ public class MdbContainer implements RpcContainer {
             }
             objectRecipe.setMethodProperty("beanClass", beanContext.getBeanClass());
 
-            final Properties containerActivationProperties = new Properties();
-            addActivationProperties(containerActivationProperties, "activation.", properties);
-            addActivationProperties(containerActivationProperties, "mdb.container." + containerID
+ ".activation.", SystemInstance.get().getProperties());
-
-            for (final String propertyName : containerActivationProperties.stringPropertyNames())
{
-                objectRecipe.setMethodProperty(propertyName, containerActivationProperties.getProperty(propertyName));
-            }
+//            final Properties containerActivationProperties = new Properties();
+//            addActivationProperties(containerActivationProperties, "activation.", properties);
+//            addActivationProperties(containerActivationProperties, "mdb.container." + containerID
+ ".activation.", SystemInstance.get().getProperties());
+//
+//            for (final String propertyName : containerActivationProperties.stringPropertyNames())
{
+//                objectRecipe.setMethodProperty(propertyName, containerActivationProperties.getProperty(propertyName));
+//            }
 
             // create the activationSpec
             final ActivationSpec activationSpec = (ActivationSpec) objectRecipe.create(activationSpecClass.getClassLoader());


Mime
View raw message