tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject [18/28] tomee git commit: Small cleanup of unused code and correct logic for property overrides eecc530d0d10d418e05be23491677aa0fbaff71c
Date Thu, 20 Jul 2017 11:46:52 GMT
 Small cleanup of unused code and correct logic for property overrides  eecc530d0d10d418e05be23491677aa0fbaff71c


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

Branch: refs/heads/master
Commit: 7fcd0ee000a85ba9a0a054480acccb56bea9aa16
Parents: c6da93c
Author: Otavio Santana <otaviopolianasantana@gmail.com>
Authored: Wed Jul 12 11:33:34 2017 -0300
Committer: Otavio Santana <otaviopolianasantana@gmail.com>
Committed: Wed Jul 12 11:33:34 2017 -0300

----------------------------------------------------------------------
 .../ActivationConfigPropertyOverride.java       | 21 ++++++++++----------
 .../apache/openejb/core/mdb/MdbContainer.java   | 20 +------------------
 2 files changed, 11 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/7fcd0ee0/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 b6e5ab3..7411183 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
@@ -37,6 +37,7 @@ import org.apache.openejb.util.PropertyPlaceHolderHelper;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 /**
  * @version $Rev$ $Date$
@@ -89,22 +90,20 @@ 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");
+                final Properties overrides = new Properties();
+
+                final MdbContainer mdbContainer = getMdbContainer(ejbDeployment.getContainerId());
+                if (mdbContainer != null) {
+                    overrides.putAll(ConfigurationFactory.getOverrides(properties, "mdb.container."
+ mdbContainer.getContainerID() + ".activation", "EnterpriseBean"));
+                    overrides.putAll(ConfigurationFactory.getOverrides(mdbContainer.getProperties(),
"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) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/7fcd0ee0/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 b732245..579e7f2 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
@@ -247,21 +247,12 @@ public class MdbContainer implements RpcContainer {
             objectRecipe.disallow(Option.FIELD_INJECTION);
 
 
-
-            final Map<String, String> beanContextActivationProperties = beanContext.getActivationProperties();
-            final Map<String, String> activationProperties = beanContextActivationProperties;
+            final Map<String, String> activationProperties = beanContext.getActivationProperties();;
             for (final Map.Entry<String, String> entry : activationProperties.entrySet())
{
                 objectRecipe.setMethodProperty(entry.getKey(), entry.getValue());
             }
             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));
-//            }
 
             // create the activationSpec
             final ActivationSpec activationSpec = (ActivationSpec) objectRecipe.create(activationSpecClass.getClassLoader());
@@ -311,15 +302,6 @@ public class MdbContainer implements RpcContainer {
         }
     }
 
-    private void addActivationProperties(final Properties target, final String prefix, final
Properties source) {
-        for (final String propertyName : source.stringPropertyNames()) {
-            if (!propertyName.startsWith(prefix)) continue;
-
-            final String activationPropertyName = propertyName.substring(prefix.length());
-            target.setProperty(activationPropertyName, source.getProperty(propertyName));
-        }
-    }
-
     public void start(final BeanContext info) throws OpenEJBException {
         final EjbTimerService timerService = info.getEjbTimerService();
         if (timerService != null) {


Mime
View raw message