Repository: tomee
Updated Branches:
  refs/heads/master c7bebb585 -> 8ef3205b4


Adds configuration


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

Branch: refs/heads/master
Commit: 3efb124a575d77570d26971cac38e458cacedc9d
Parents: f7e0578
Author: Otavio Santana <[email protected]>
Authored: Tue Jul 11 08:42:31 2017 -0300
Committer: Otavio Santana <[email protected]>
Committed: Tue Jul 11 08:42:48 2017 -0300

----------------------------------------------------------------------
 .../apache/openejb/core/mdb/MdbContainer.java   | 23 ++++++++++----------
 1 file changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/3efb124a/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 a6f933d..ecef1b7 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
@@ -107,7 +107,7 @@ public class MdbContainer implements RpcContainer {
     private final XAResourceWrapper xaResourceWrapper;
     private final InboundRecovery inboundRecovery;
 
-    private Properties configuration;
+    private final Properties configuration = new Properties();
 
     public MdbContainer(final Object containerID, final SecurityService 
securityService, final ResourceAdapter resourceAdapter,
                         final Class messageListenerInterface, final Class 
activationSpecClass, final int instanceLimit,
@@ -127,10 +127,6 @@ public class MdbContainer implements RpcContainer {
         return configuration;
     }
 
-    public void setConfiguration(Properties configuration) {
-        this.configuration = configuration;
-    }
-
     public BeanContext[] getBeanContexts() {
         return deployments.values().toArray(new 
BeanContext[deployments.size()]);
     }
@@ -163,8 +159,8 @@ public class MdbContainer implements RpcContainer {
         final Object deploymentId = beanContext.getDeploymentID();
         if (!beanContext.getMdbInterface().equals(messageListenerInterface)) {
             throw new OpenEJBException("Deployment '" + deploymentId + "' has 
message listener interface " +
-                beanContext.getMdbInterface().getName() + " but this MDB 
container only supports " +
-                messageListenerInterface);
+                    beanContext.getMdbInterface().getName() + " but this MDB 
container only supports " +
+                    messageListenerInterface);
         }
 
         // create the activation spec
@@ -258,6 +254,9 @@ public class MdbContainer implements RpcContainer {
             final Map<String, String> activationProperties = 
beanContextActivationProperties;
             for (final Map.Entry<String, String> entry : 
activationProperties.entrySet()) {
                 objectRecipe.setMethodProperty(entry.getKey(), 
entry.getValue());
+                if (entry.getKey().startsWith("activation")) {
+                    configuration.put("mdb." + entry.getKey(), 
entry.getValue());
+                }
             }
             objectRecipe.setMethodProperty("beanClass", 
beanContext.getBeanClass());
 
@@ -429,7 +428,7 @@ public class MdbContainer implements RpcContainer {
 
         // verify the delivery method passed to beforeDeliver is the same 
method that was invoked
         if (!mdbCallContext.deliveryMethod.getName().equals(method.getName()) 
||
-            
!Arrays.deepEquals(mdbCallContext.deliveryMethod.getParameterTypes(), 
method.getParameterTypes())) {
+                
!Arrays.deepEquals(mdbCallContext.deliveryMethod.getParameterTypes(), 
method.getParameterTypes())) {
             throw new IllegalStateException("Delivery method specified in 
beforeDelivery is not the delivery method called");
         }
 
@@ -468,12 +467,12 @@ public class MdbContainer implements RpcContainer {
     }
 
     private Object _invoke(final Object instance, final Method runMethod, 
final Object[] args, final BeanContext beanContext, final InterfaceType 
interfaceType, final MdbCallContext mdbCallContext) throws SystemException,
-        ApplicationException {
+            ApplicationException {
         final Object returnValue;
         try {
             final List<InterceptorData> interceptors = 
beanContext.getMethodInterceptors(runMethod);
             final InterceptorStack interceptorStack = new 
InterceptorStack(((Instance) instance).bean, runMethod, interfaceType == 
InterfaceType.TIMEOUT ? Operation.TIMEOUT : Operation.BUSINESS,
-                interceptors, ((Instance) instance).interceptors);
+                    interceptors, ((Instance) instance).interceptors);
             returnValue = interceptorStack.invoke(args);
             return returnValue;
         } catch (Throwable e) {
@@ -620,7 +619,7 @@ public class MdbContainer implements RpcContainer {
         }
 
         public void start() throws ResourceException {
-            if (! started.compareAndSet(false, true)) {
+            if (!started.compareAndSet(false, true)) {
                 return;
             }
 
@@ -636,7 +635,7 @@ public class MdbContainer implements RpcContainer {
         }
 
         public void stop() {
-            if (! started.compareAndSet(true, false)) {
+            if (!started.compareAndSet(true, false)) {
                 return;
             }
 

Reply via email to