tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tveron...@apache.org
Subject [09/50] tomee git commit: Refactoring / clean up
Date Thu, 18 Jan 2018 15:43:57 GMT
Refactoring / clean up


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

Branch: refs/heads/master
Commit: 21687ad97079568d03a5dffa0f816f5122c62e9c
Parents: 66e00cd
Author: Ivan Junckes Filho <ivanjunckes@gmail.com>
Authored: Fri Dec 15 10:29:14 2017 -0200
Committer: Ivan Junckes Filho <ivanjunckes@gmail.com>
Committed: Fri Dec 15 10:29:14 2017 -0200

----------------------------------------------------------------------
 .../openejb/core/instance/InstanceManager.java  |  20 +--
 .../openejb/core/mdb/BaseMdbContainer.java      |   2 -
 .../apache/openejb/core/mdb/MdbContainer.java   |   2 +-
 .../openejb/core/mdb/MdbContainerFactory.java   |   2 +-
 .../openejb/core/mdb/MdbInstanceManager.java    |  21 +--
 .../openejb/core/mdb/MdbPoolContainer.java      | 165 ++++++++-----------
 .../stateless/StatelessInstanceManager.java     |   5 +-
 .../META-INF/org.apache.openejb/service-jar.xml |   1 -
 8 files changed, 93 insertions(+), 125 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/21687ad9/container/openejb-core/src/main/java/org/apache/openejb/core/instance/InstanceManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/instance/InstanceManager.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/instance/InstanceManager.java
index 7a8f450..84086b2 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/instance/InstanceManager.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/instance/InstanceManager.java
@@ -30,7 +30,6 @@ import org.apache.openejb.core.interceptor.InterceptorStack;
 import org.apache.openejb.core.mdb.Instance;
 import org.apache.openejb.loader.Options;
 import org.apache.openejb.monitoring.LocalMBeanServer;
-import org.apache.openejb.spi.SecurityService;
 import org.apache.openejb.util.DaemonThreadFactory;
 import org.apache.openejb.util.Duration;
 import org.apache.openejb.util.LogCategory;
@@ -39,14 +38,12 @@ import org.apache.openejb.util.Pool;
 
 import javax.ejb.ConcurrentAccessTimeoutException;
 import javax.ejb.SessionBean;
-import javax.enterprise.context.spi.CreationalContext;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.rmi.RemoteException;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.RejectedExecutionHandler;
 import java.util.concurrent.ScheduledExecutorService;
@@ -75,20 +72,18 @@ public abstract class InstanceManager {
 
     protected final Duration accessTimeout;
     protected final Duration closeTimeout;
-    protected final SecurityService securityService;
     protected final Pool.Builder poolBuilder;
     protected final ThreadPoolExecutor executor;
     protected final ScheduledExecutorService scheduledExecutor;
 
-    public InstanceManager(final SecurityService securityService,
-                                    final Duration accessTimeout, final Duration closeTimeout,
+    public InstanceManager(final Duration accessTimeout, final Duration closeTimeout,
                                     final Pool.Builder poolBuilder, final int callbackThreads,
                                     final ScheduledExecutorService ses) {
-        this.securityService = securityService;
         this.accessTimeout = accessTimeout;
         this.closeTimeout = closeTimeout;
         this.poolBuilder = poolBuilder;
         this.scheduledExecutor = ses;
+
         if (ScheduledThreadPoolExecutor.class.isInstance(ses) && !ScheduledThreadPoolExecutor.class.cast(ses).getRemoveOnCancelPolicy())
{
             ScheduledThreadPoolExecutor.class.cast(ses).setRemoveOnCancelPolicy(true);
         }
@@ -98,7 +93,7 @@ public abstract class InstanceManager {
         }
 
         final int qsize = callbackThreads > 1 ? callbackThreads - 1 : 1;
-        final ThreadFactory threadFactory = new DaemonThreadFactory("StatelessPool.worker.");
+        final ThreadFactory threadFactory = new DaemonThreadFactory("InstanceManagerPool.worker.");
         this.executor = new ThreadPoolExecutor(
                 callbackThreads, callbackThreads * 2,
                 1L, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>(qsize), threadFactory);
@@ -178,7 +173,6 @@ public abstract class InstanceManager {
             }
         }
     }
-    //TODO: REMOVE ALL REFERENCES TO STATELESS IN COMMENTS OR CODE
     /**
      * Removes an instance from the pool and returns it for use
      * by the container in business methods.
@@ -187,7 +181,7 @@ public abstract class InstanceManager {
      * cause this thread to wait.
      * <p/>
      * If StrictPooling is not enabled this method will create a
-     * new stateless bean instance performing all required injection
+     * new bean instance performing all required injection
      * and callbacks before returning it in a method ready state.
      *
      * @param callContext ThreadContext
@@ -207,7 +201,7 @@ public abstract class InstanceManager {
                 instance.setPoolEntry(entry);
             }
         } catch (final TimeoutException e) {
-            final String msg = "No instances available in Stateless Session Bean pool.  Waited
" + data.getAccessTimeout().toString();
+            final String msg = "No instances available in Session Bean pool.  Waited " +
data.getAccessTimeout().toString();
             final ConcurrentAccessTimeoutException timeoutException = new ConcurrentAccessTimeoutException(msg);
             timeoutException.fillInStackTrace();
             throw new ApplicationException(timeoutException);
@@ -240,7 +234,7 @@ public abstract class InstanceManager {
 
     /**
      * All instances are removed from the pool in getInstance(...).  They are only
-     * returned by the StatelessContainer via this method under two circumstances.
+     * returned by the Container via this method under two circumstances.
      * <p/>
      * 1.  The business method returns normally
      * 2.  The business method throws an application exception
@@ -351,7 +345,7 @@ public abstract class InstanceManager {
 
         try {
             if (!data.closePool()) {
-                logger.error("Timed-out waiting for stateless pool to close: for deployment
'" + beanContext.getDeploymentID() + "'");
+                logger.error("Timed-out waiting for instance manager pool to close: for deployment
'" + beanContext.getDeploymentID() + "'");
             }
 
         } catch (final InterruptedException e) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/21687ad9/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/BaseMdbContainer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/BaseMdbContainer.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/BaseMdbContainer.java
index dae4075..ed08efb 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/BaseMdbContainer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/BaseMdbContainer.java
@@ -42,8 +42,6 @@ public interface BaseMdbContainer {
 
     Class getMessageListenerInterface();
 
-    Class getActivationSpecClass();
-
     Properties getProperties();
 
     void deploy(BeanContext beanContext) throws OpenEJBException;

http://git-wip-us.apache.org/repos/asf/tomee/blob/21687ad9/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 a79dc0d..bfbc65a 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
@@ -261,7 +261,7 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer {
             objectRecipe.disallow(Option.FIELD_INJECTION);
 
 
-            final Map<String, String> activationProperties = beanContext.getActivationProperties();;
+            final Map<String, String> activationProperties = beanContext.getActivationProperties();
             for (final Map.Entry<String, String> entry : activationProperties.entrySet())
{
                 objectRecipe.setMethodProperty(entry.getKey(), entry.getValue());
             }

http://git-wip-us.apache.org/repos/asf/tomee/blob/21687ad9/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainerFactory.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainerFactory.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainerFactory.java
index c3d8ef6..c511e02 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainerFactory.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainerFactory.java
@@ -158,7 +158,7 @@ public class MdbContainerFactory {
         if (pool) {
             return new MdbPoolContainer(id, securityService, resourceAdapter,
                     messageListenerInterface, activationSpecClass,
-                    instanceLimit, failOnUnknownActivationSpec, accessTimeout, closeTimeout,
poolBuilder,
+                    failOnUnknownActivationSpec, accessTimeout, closeTimeout, poolBuilder,
                     callbackThreads, useOneSchedulerThreadByBean, evictionThreads);
         } else {
             return new MdbContainer(id, securityService, resourceAdapter,

http://git-wip-us.apache.org/repos/asf/tomee/blob/21687ad9/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceManager.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceManager.java
index ba255be..ac8fe10 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceManager.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbInstanceManager.java
@@ -74,21 +74,20 @@ public class MdbInstanceManager extends InstanceManager {
     private final ResourceAdapter resourceAdapter;
     private final InboundRecovery inboundRecovery;
     private final Object containerID;
-    private int instanceLimit;
+    private final SecurityService securityService;
 
-    public MdbInstanceManager(final ResourceAdapter resourceAdapter,
+    public MdbInstanceManager(final SecurityService securityService,
+                              final ResourceAdapter resourceAdapter,
                               final InboundRecovery inboundRecovery,
                               final Object containerID,
-                              final int instanceLimit,
-                              final SecurityService securityService,
-                                    final Duration accessTimeout, final Duration closeTimeout,
-                                    final Pool.Builder poolBuilder, final int callbackThreads,
-                                    final ScheduledExecutorService ses) {
-        super(securityService, accessTimeout, closeTimeout, poolBuilder, callbackThreads,
ses);
+                              final Duration accessTimeout, final Duration closeTimeout,
+                              final Pool.Builder poolBuilder, final int callbackThreads,
+                              final ScheduledExecutorService ses) {
+        super(accessTimeout, closeTimeout, poolBuilder, callbackThreads, ses);
+        this.securityService = securityService;
         this.resourceAdapter = resourceAdapter;
         this.inboundRecovery = inboundRecovery;
         this.containerID = containerID;
-        this.instanceLimit = instanceLimit;
     }
 
 
@@ -98,9 +97,6 @@ public class MdbInstanceManager extends InstanceManager {
             inboundRecovery.recover(resourceAdapter, activationSpec, containerID.toString());
         }
 
-        final Options options = new Options(beanContext.getProperties());
-        final int instanceLimit = options.get("InstanceLimit", this.instanceLimit); //TODO:
REMOVE INSTANCE LIMIT
-
         final ObjectRecipe recipe = PassthroughFactory.recipe(new Pool.Builder(poolBuilder));
         recipe.allow(Option.CASE_INSENSITIVE_FACTORY);
         recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
@@ -194,6 +190,7 @@ public class MdbInstanceManager extends InstanceManager {
             throw new OpenEJBException(e);
         }
 
+        final Options options = new Options(beanContext.getProperties());
         // Finally, fill the pool and start it
         if (!options.get("BackgroundStartup", false) && min > 0) {
             final ExecutorService es = Executors.newFixedThreadPool(min);

http://git-wip-us.apache.org/repos/asf/tomee/blob/21687ad9/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbPoolContainer.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbPoolContainer.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbPoolContainer.java
index 6fac7da..72ca5b6 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbPoolContainer.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbPoolContainer.java
@@ -73,11 +73,9 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
     private static final Object[] NO_ARGS = new Object[0];
 
     private final Object containerID;
-    private final SecurityService securityService;
     private final ResourceAdapter resourceAdapter;
     private final Class messageListenerInterface;
     private final Class activationSpecClass;
-    private final int instanceLimit;
     private final boolean failOnUnknownActivationSpec;
     private final MdbInstanceManager instanceManager;
     private final ConcurrentMap<Object, BeanContext> deployments = new ConcurrentHashMap<Object,
BeanContext>();
@@ -91,7 +89,6 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
                             final ResourceAdapter resourceAdapter,
                             final Class messageListenerInterface,
                             final Class activationSpecClass,
-                            final int instanceLimit,
                             final boolean failOnUnknownActivationSpec,
                             final Duration accessTimeout,
                             final Duration closeTimeout,
@@ -101,74 +98,63 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
                             final int evictionThreads
     ) {
         this.containerID = containerID;
-        this.securityService = securityService;
         this.resourceAdapter = resourceAdapter;
         this.messageListenerInterface = messageListenerInterface;
         this.activationSpecClass = activationSpecClass;
-        this.instanceLimit = instanceLimit;
         this.failOnUnknownActivationSpec = failOnUnknownActivationSpec;
         xaResourceWrapper = SystemInstance.get().getComponent(XAResourceWrapper.class);
         inboundRecovery = SystemInstance.get().getComponent(InboundRecovery.class);
         this.instanceManager = new MdbInstanceManager(
+                securityService,
                 resourceAdapter,
                 inboundRecovery,
                 containerID,
-                instanceLimit,
-                securityService, accessTimeout, closeTimeout, poolBuilder, callbackThreads,
+                accessTimeout, closeTimeout, poolBuilder, callbackThreads,
                 useOneSchedulerThreadByBean ?
                         null :
                         Executors.newScheduledThreadPool(Math.max(evictionThreads, 1), new
DaemonThreadFactory(containerID)));
     }
 
-    @Override
     public BeanContext[] getBeanContexts() {
         return deployments.values().toArray(new BeanContext[deployments.size()]);
     }
 
-    @Override
     public BeanContext getBeanContext(final Object deploymentID) {
         return deployments.get(deploymentID);
     }
 
-    @Override
     public ContainerType getContainerType() {
         return ContainerType.MESSAGE_DRIVEN;
     }
 
-    @Override
     public Object getContainerID() {
         return containerID;
     }
 
-    @Override
     public ResourceAdapter getResourceAdapter() {
         return resourceAdapter;
     }
 
-    @Override
     public Class getMessageListenerInterface() {
         return messageListenerInterface;
     }
 
-    @Override
     public Class getActivationSpecClass() {
         return activationSpecClass;
     }
 
-    @Override
     public Properties getProperties() {
         return properties;
     }
 
-    @Override
     public void deploy(final BeanContext beanContext) throws OpenEJBException {
         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);
         }
+
         // create the activation spec
         final ActivationSpec activationSpec = createActivationSpec(beanContext);
 
@@ -188,7 +174,72 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
         }
     }
 
-    @Override
+    private ActivationSpec createActivationSpec(final BeanContext beanContext) throws OpenEJBException
{
+        try {
+            // initialize the object recipe
+            final ObjectRecipe objectRecipe = new ObjectRecipe(activationSpecClass);
+            objectRecipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+            objectRecipe.disallow(Option.FIELD_INJECTION);
+
+
+            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());
+
+
+            // create the activationSpec
+            final ActivationSpec activationSpec = (ActivationSpec) objectRecipe.create(activationSpecClass.getClassLoader());
+
+            // verify all properties except "destination" and "destinationType" were consumed
+            final Set<String> unusedProperties = new TreeSet<String>(objectRecipe.getUnsetProperties().keySet());
+            unusedProperties.remove("destination");
+            unusedProperties.remove("destinationType");
+            unusedProperties.remove("destinationLookup");
+            unusedProperties.remove("connectionFactoryLookup");
+            unusedProperties.remove("beanClass");
+            unusedProperties.remove("MdbActiveOnStartup");
+            unusedProperties.remove("MdbJMXControl");
+            unusedProperties.remove("DeliveryActive");
+
+            if (!unusedProperties.isEmpty()) {
+                final String text = "No setter found for the activation spec properties:
" + unusedProperties;
+                if (failOnUnknownActivationSpec) {
+                    throw new IllegalArgumentException(text);
+                } else {
+                    logger.warning(text);
+                }
+            }
+
+
+            // validate the activation spec
+            try {
+                activationSpec.validate();
+            } catch (final UnsupportedOperationException uoe) {
+                logger.info("ActivationSpec does not support validate. Implementation of
validate is optional");
+            }
+            // also try validating using Bean Validation if there is a Validator available
in the context.
+            try {
+                final Validator validator = (Validator) beanContext.getJndiContext().lookup("comp/Validator");
+
+                final Set generalSet = validator.validate(activationSpec);
+                if (!generalSet.isEmpty()) {
+                    throw new ConstraintViolationException("Constraint violation for ActivationSpec
" + activationSpecClass.getName(), generalSet);
+                }
+            } catch (final NamingException e) {
+                logger.debug("No Validator bound to JNDI context");
+            }
+
+            // set the resource adapter into the activation spec
+            activationSpec.setResourceAdapter(resourceAdapter);
+
+            return activationSpec;
+        } catch (final Exception e) {
+            throw new OpenEJBException("Unable to create activation spec", e);
+        }
+    }
+
     public void start(final BeanContext info) throws OpenEJBException {
         final EjbTimerService timerService = info.getEjbTimerService();
         if (timerService != null) {
@@ -196,12 +247,10 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
         }
     }
 
-    @Override
     public void stop(final BeanContext info) throws OpenEJBException {
         info.stop();
     }
 
-    @Override
     public void undeploy(final BeanContext beanContext) throws OpenEJBException {
         if (!(beanContext instanceof BeanContext)) {
             return;
@@ -216,7 +265,6 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
 
     }
 
-    @Override
     public Object invoke(final Object deploymentId, final InterfaceType type, final Class
callInterface, final Method method, final Object[] args, final Object primKey) throws OpenEJBException
{
         final BeanContext beanContext = getBeanContext(deploymentId);
 
@@ -239,7 +287,6 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
         }
     }
 
-    @Override
     public void beforeDelivery(final BeanContext deployInfo, final Object instance, final
Method method, final XAResource xaResource) throws SystemException {
         // intialize call context
         final ThreadContext callContext = new ThreadContext(deployInfo, null);
@@ -271,7 +318,6 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
         }
     }
 
-    @Override
     public Object invoke(final Object instance, final Method method, final InterfaceType
type, Object... args) throws SystemException, ApplicationException {
         if (args == null) {
             args = NO_ARGS;
@@ -365,7 +411,6 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
         throw new AssertionError("Should not get here");
     }
 
-    @Override
     public void afterDelivery(final Object instance) throws SystemException {
         // get the mdb call context
         final ThreadContext callContext = ThreadContext.getThreadContext();
@@ -381,7 +426,7 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
                     try {
                         this.instanceManager.poolInstance(callContext, instance);
                     } catch (OpenEJBException e){
-                        e.printStackTrace(); // TODO: Check this, find a way to remove
+                        throw new SystemException("Should never get an OpenEJBException exception",
e);
                     }
 
                 }
@@ -393,7 +438,6 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
         }
     }
 
-    @Override
     public void release(final BeanContext deployInfo, final Object instance) {
         // get the mdb call context
         ThreadContext callContext = ThreadContext.getThreadContext();
@@ -416,7 +460,7 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
                     try {
                         instanceManager.poolInstance(callContext, instance);
                     } catch (OpenEJBException e){
-                        e.printStackTrace();
+                        logger.error("error while releasing message endpoint", e);
                     }
                 }
             }
@@ -493,72 +537,5 @@ public class MdbPoolContainer implements RpcContainer, BaseMdbContainer
{
             }
         }
     }
-
-    private ActivationSpec createActivationSpec(final BeanContext beanContext) throws OpenEJBException
{
-        try {
-            // initialize the object recipe
-            final ObjectRecipe objectRecipe = new ObjectRecipe(activationSpecClass);
-            objectRecipe.allow(Option.IGNORE_MISSING_PROPERTIES);
-            objectRecipe.disallow(Option.FIELD_INJECTION);
-
-
-            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());
-
-
-            // create the activationSpec
-            final ActivationSpec activationSpec = (ActivationSpec) objectRecipe.create(activationSpecClass.getClassLoader());
-
-            // verify all properties except "destination" and "destinationType" were consumed
-            final Set<String> unusedProperties = new TreeSet<String>(objectRecipe.getUnsetProperties().keySet());
-            unusedProperties.remove("destination");
-            unusedProperties.remove("destinationType");
-            unusedProperties.remove("destinationLookup");
-            unusedProperties.remove("connectionFactoryLookup");
-            unusedProperties.remove("beanClass");
-            unusedProperties.remove("MdbActiveOnStartup");
-            unusedProperties.remove("MdbJMXControl");
-            unusedProperties.remove("DeliveryActive");
-
-            if (!unusedProperties.isEmpty()) {
-                final String text = "No setter found for the activation spec properties:
" + unusedProperties;
-                if (failOnUnknownActivationSpec) {
-                    throw new IllegalArgumentException(text);
-                } else {
-                    logger.warning(text);
-                }
-            }
-
-
-            // validate the activation spec
-            try {
-                activationSpec.validate();
-            } catch (final UnsupportedOperationException uoe) {
-                logger.info("ActivationSpec does not support validate. Implementation of
validate is optional");
-            }
-            // also try validating using Bean Validation if there is a Validator available
in the context.
-            try {
-                final Validator validator = (Validator) beanContext.getJndiContext().lookup("comp/Validator");
-
-                final Set generalSet = validator.validate(activationSpec);
-                if (!generalSet.isEmpty()) {
-                    throw new ConstraintViolationException("Constraint violation for ActivationSpec
" + activationSpecClass.getName(), generalSet);
-                }
-            } catch (final NamingException e) {
-                logger.debug("No Validator bound to JNDI context");
-            }
-
-            // set the resource adapter into the activation spec
-            activationSpec.setResourceAdapter(resourceAdapter);
-
-            return activationSpec;
-        } catch (final Exception e) {
-            throw new OpenEJBException("Unable to create activation spec", e);
-        }
-    }
 }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/21687ad9/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java
b/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java
index d3c72bc..e73d8ca 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/core/stateless/StatelessInstanceManager.java
@@ -50,11 +50,14 @@ import java.util.concurrent.TimeUnit;
 
 public class StatelessInstanceManager extends InstanceManager {
 
+    private final SecurityService securityService;
+
     public StatelessInstanceManager(final SecurityService securityService,
                                     final Duration accessTimeout, final Duration closeTimeout,
                                     final Pool.Builder poolBuilder, final int callbackThreads,
                                     final ScheduledExecutorService ses) {
-        super(securityService, accessTimeout, closeTimeout, poolBuilder, callbackThreads,
ses);
+        super(accessTimeout, closeTimeout, poolBuilder, callbackThreads, ses);
+        this.securityService = securityService;
     }
 
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/21687ad9/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
b/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
index 8780c1a..4b312c1 100644
--- a/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
+++ b/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
@@ -476,7 +476,6 @@
     ResourceAdapter Default JMS Resource Adapter
     MessageListenerInterface javax.jms.MessageListener
     ActivationSpecClass org.apache.openejb.resource.activemq.TomEEMessageActivationSpec
-    InstanceLimit 10
     FailOnUnknownActivationSpec false
     AccessTimeout 5 minutes
     CloseTimeout 5 minutes


Mime
View raw message