[jboss-svn-commits] JBL Code SVN: r26609 - in labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta: src/org/jboss/soa/esb/addressing/eprs and 3 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue May 19 05:46:15 EDT 2009


Author: tfennelly
Date: 2009-05-19 05:46:15 -0400 (Tue, 19 May 2009)
New Revision: 26609

Added:
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/MockTransactionStrategy.java
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/jms/MockJMSXAConnectionFactory.java
Modified:
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java
   labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/MaxSessionsPerConnectionUnitTest.java
Log:
JBESB-2569
JmsConnectionPool: Add support for "max-xa-sessions-per-connection" config

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java	2009-05-19 09:24:43 UTC (rev 26608)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java	2009-05-19 09:46:15 UTC (rev 26609)
@@ -81,30 +81,27 @@
     private int maxSessions = DEFAULT_POOL_SIZE;    //TODO Make this manageable
 
     /**
-     * The max number of sessions per connection.  Defaults to the Max total number of sessions ("maxSessions").
+     * The max number of sessions per connection.  Defaults to "maxSessions".
      */
     private int maxSessionsPerConnection;
 
     /**
-     * Maximum number of connection to be opened by this pool.
-     * <p/>
-     * Will be the truncated result of maxSessions / maxSessionsPerConnection.
+     * The max number of XA sessions per connection.  Defaults to "maxSessionsPerConnection".
      */
-    private int maxConnections;
+    private int maxXASessionsPerConnection;
 
     /** Time to sleep when trying to get a session. */
     private int sleepTime = DEFAULT_SLEEP;
 
     /** The Indentifier of the pool */
     private Map<String, String> poolKey;
-
     /** Logger */
     private Logger logger = Logger.getLogger(this.getClass());
+
     /**
      * JMS Session Pools.
      */
     private List<JmsSessionPool> sessionPools = new ArrayList<JmsSessionPool>();
-
     /**
      * The flag representing XA aware connections.
      */
@@ -132,21 +129,31 @@
         maxSessions = poolSize;
         this.sleepTime = sleepTime;
 
-        String maxSessionsPerConnectionConfig = poolKey.get(JMSEpr.MAX_SESSIONS_PER_CONNECTION);
-        if(maxSessionsPerConnectionConfig != null) {
+        maxSessionsPerConnection = getIntPoolConfig(poolKey, JMSEpr.MAX_SESSIONS_PER_CONNECTION, maxSessions);
+        if(maxSessionsPerConnection < 1) {
+            throw new ConnectionException("Invalid '" + JMSEpr.MAX_SESSIONS_PER_CONNECTION + "' configuration value '" + maxSessionsPerConnection + "'.  Must be greater than 0.");
+        }
+        maxXASessionsPerConnection = getIntPoolConfig(poolKey, JMSEpr.MAX_XA_SESSIONS_PER_CONNECTION, maxSessionsPerConnection);
+        if(maxXASessionsPerConnection < 1) {
+            throw new ConnectionException("Invalid '" + JMSEpr.MAX_XA_SESSIONS_PER_CONNECTION + "' configuration value '" + maxXASessionsPerConnection + "'.  Must be greater than 0.");
+        } else if(maxXASessionsPerConnection > maxSessionsPerConnection) {
+            throw new ConnectionException("Invalid '" + JMSEpr.MAX_XA_SESSIONS_PER_CONNECTION + "' configuration value '" + maxXASessionsPerConnection + "'.  Cannot be greater than the configured value for '" + JMSEpr.MAX_SESSIONS_PER_CONNECTION + "', which is " + maxSessionsPerConnection + ".");
+        }
+    }
+
+    private int getIntPoolConfig(Map<String, String> poolKey, String configKey, int defaultVal) throws ConnectionException {
+        String configValueString = poolKey.get(configKey);
+        int configValue = defaultVal;
+
+        if(configValueString != null) {
             try {
-                maxSessionsPerConnection = Integer.parseInt(maxSessionsPerConnectionConfig.trim());
-                if(maxSessionsPerConnection < 1) {
-                    throw new ConnectionException("Invalid '" + JMSEpr.MAX_SESSIONS_PER_CONNECTION + "' configuration value '" +  maxSessionsPerConnection + "'.  Must be greater than 0.");
-                }
+                configValue = Integer.parseInt(configValueString.trim());
             } catch(NumberFormatException e) {
-                throw new ConnectionException("Invalid '" + JMSEpr.MAX_SESSIONS_PER_CONNECTION + "' configuration value '" +  maxSessionsPerConnectionConfig.trim() + "'.  Must be a valid Integer.");
+                throw new ConnectionException("Invalid '" + configKey + "' configuration value '" +  configValueString.trim() + "'.  Must be a valid Integer.");
             }
-        } else {
-            maxSessionsPerConnection = maxSessions;
         }
 
-        maxConnections = (maxSessions/maxSessionsPerConnection);
+        return configValue;
     }
 
     protected int getMaxSessions() {
@@ -157,8 +164,8 @@
         return maxSessionsPerConnection;
     }
 
-    protected int getMaxConnections() {
-        return maxConnections;
+    public int getMaxXASessionsPerConnection() {
+        return maxXASessionsPerConnection;
     }
 
     protected List<JmsSessionPool> getSessionPools() {
@@ -245,7 +252,7 @@
 
             // OK... all the existing session pools are full and have no free sessions.  If we can add
             // another session pool, add it and then start this loop again...
-            if(sessionPools.size() < maxConnections) {
+            if(getSessionsInPool() < maxSessions) {
                 addSessionPool();
                 continue;
             }
@@ -702,7 +709,16 @@
                 inUseSessions.add(session);
                 return session ;
             } else if (getSessionsInPool() < maxSessionsPerConnection) {
-                final JmsSession session = addAnotherSession(poolKey, transacted, acknowledgeMode);
+                JmsSession session = null;
+                
+                if(transacted) {
+                    if(getXASessionsInPool() < maxXASessionsPerConnection) {
+                        session = addAnotherSession(poolKey, transacted, acknowledgeMode);
+                    }
+                } else {
+                    session = addAnotherSession(poolKey, transacted, acknowledgeMode);
+                }
+
                 if(session != null) {
                     inUseSessions.add(session);
                     return session ;
@@ -807,20 +823,42 @@
          * @return The total number of sessions in the pool.
          */
         private synchronized int getSessionsInPool() {
+            // Get a count of all sessions (of any type) in the pool...
+            return getSessionsInPool(JmsSession.class);
+        }
+
+        /**
+         * Returns the total number of XA sessions in the pool.
+         * @return The total number of XA sessions in the pool.
+         */
+        private synchronized int getXASessionsInPool() {
+            // Get a count of XA sessions in the pool...
+            return getSessionsInPool(JmsXASession.class);
+        }
+
+        /**
+         * Returns the total number of XA sessions in the pool.
+         * @return The total number of XA sessions in the pool.
+         */
+        private synchronized int getSessionsInPool(Class<? extends JmsSession> jmsSessionType) {
             int total = 0;
 
-            total += getSessionsInMap(freeSessionsMap);
-            total += getSessionsInMap(inUseSessionsMap);
+            total += getSessionsInMap(freeSessionsMap, jmsSessionType);
+            total += getSessionsInMap(inUseSessionsMap, jmsSessionType);
 
             return total;
         }
 
-        private synchronized int getSessionsInMap(Map<Integer,ArrayList<JmsSession>> sessionsMap) {
+        private synchronized int getSessionsInMap(Map<Integer, ArrayList<JmsSession>> sessionsMap, Class<? extends JmsSession> jmsSessionType) {
             Collection<ArrayList<JmsSession>> sessionLists = sessionsMap.values();
             int total = 0;
 
             for(ArrayList<JmsSession> sessionList : sessionLists) {
-                total += sessionList.size();
+                for(JmsSession session : sessionList) {
+                    if(jmsSessionType.isAssignableFrom(session.getClass())) {
+                        total++;
+                    }
+                }
             }
 
             return total;

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2009-05-19 09:24:43 UTC (rev 26608)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2009-05-19 09:46:15 UTC (rev 26609)
@@ -77,6 +77,8 @@
 	public static final String CONNECTION_FACTORY_TAG = "connection-factory";
 
     public static final String MAX_SESSIONS_PER_CONNECTION = "max-sessions-per-connection";
+    
+    public static final String MAX_XA_SESSIONS_PER_CONNECTION = "max-xa-sessions-per-connection";
 
     public static final String JNDI_PKG_PREFIX_TAG = "jndi-pkg-prefix";
 

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java	2009-05-19 09:24:43 UTC (rev 26608)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/src/org/jboss/soa/esb/common/TransactionStrategy.java	2009-05-19 09:46:15 UTC (rev 26609)
@@ -140,7 +140,7 @@
      * The null transaction strategy.
      * @author kevin
      */
-    private static class NullTransactionStrategy extends TransactionStrategy
+    public static class NullTransactionStrategy extends TransactionStrategy
     {
         /**
          * Begin a transaction on the current thread.

Modified: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/MaxSessionsPerConnectionUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/MaxSessionsPerConnectionUnitTest.java	2009-05-19 09:24:43 UTC (rev 26608)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/MaxSessionsPerConnectionUnitTest.java	2009-05-19 09:46:15 UTC (rev 26609)
@@ -33,6 +33,9 @@
 import java.util.ArrayList;
 
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
+import org.jboss.internal.soa.esb.rosetta.pooling.jms.MockJMSXAConnectionFactory;
 import org.jboss.internal.soa.esb.rosetta.pooling.jms.MockJMSConnectionFactory;
 
 /**
@@ -45,17 +48,23 @@
     public MaxSessionsPerConnectionUnitTest() {
         jndiEnv.put(Context.INITIAL_CONTEXT_FACTORY, MockInitialContextFactory.class.getName());
         jndiEnv.put(JMSEpr.CONNECTION_FACTORY_TAG, "ConnectionFactory");
-        jndiEnv.put(JMSEpr.MAX_SESSIONS_PER_CONNECTION, "2");
     }
 
-    public void test() throws NamingException, JMSException, ConnectionException {
-        MockJndiContextHandler.objects.put("ConnectionFactory", new MockJMSConnectionFactory(2));
+    protected void tearDown() throws Exception {
+        TransactionStrategy.setTransactionStrategy(new TransactionStrategy.NullTransactionStrategy());
+    }
+
+    public void test_nonXA() throws NamingException, JMSException, ConnectionException {
+        int MAX_SESSIONS_PER_CONN = 2;
+
+        jndiEnv.put(JMSEpr.MAX_SESSIONS_PER_CONNECTION, Integer.toString(MAX_SESSIONS_PER_CONN));
+
+        MockJndiContextHandler.objects.put("ConnectionFactory", new MockJMSConnectionFactory(MAX_SESSIONS_PER_CONN));
         JmsConnectionPool connPool = new JmsConnectionPool(jndiEnv);
         List<JmsConnectionPool.JmsSessionPool> sessPools = connPool.getSessionPools();
 
         assertEquals(20, connPool.getMaxSessions());
-        assertEquals(2, connPool.getMaxSessionsPerConnection());
-        assertEquals(10, connPool.getMaxConnections());
+        assertEquals(MAX_SESSIONS_PER_CONN, connPool.getMaxSessionsPerConnection());
         assertEquals(0, sessPools.size());
 
         try {
@@ -111,6 +120,69 @@
         }
     }
 
+    public void test_XA() throws NamingException, JMSException, ConnectionException, TransactionStrategyException {
+        int MAX_SESSIONS_PER_CONN = 3;
+
+        jndiEnv.put(JMSEpr.MAX_SESSIONS_PER_CONNECTION, Integer.toString(MAX_SESSIONS_PER_CONN));
+        jndiEnv.put(JMSEpr.MAX_XA_SESSIONS_PER_CONNECTION, "1");
+
+        MockJndiContextHandler.objects.put("ConnectionFactory", new MockJMSXAConnectionFactory(MAX_SESSIONS_PER_CONN));
+        JmsConnectionPool connPool = new JmsConnectionPool(jndiEnv);
+        List<JmsConnectionPool.JmsSessionPool> sessPools = connPool.getSessionPools();
+
+        assertEquals(20, connPool.getMaxSessions());
+        assertEquals(MAX_SESSIONS_PER_CONN, connPool.getMaxSessionsPerConnection());
+        assertEquals(1, connPool.getMaxXASessionsPerConnection());
+        assertEquals(0, sessPools.size());
+
+        // There's a limit of 1 XA Session per connection.
+        // So as sessions get added, a new Connection will be added for each XA Session.  Non XA Sessions
+        // will get filled into connections up to the maxSesionsPerConnection, which is 3 for this test.
+
+        MockTransactionStrategy.isActive = true;
+        try {
+            TransactionStrategy.setTransactionStrategy(new MockTransactionStrategy());
+
+            connPool.getSession();
+            assertEquals(1, sessPools.size());
+
+            connPool.getSession();
+            assertEquals(2, sessPools.size());
+
+            connPool.getSession();
+            assertEquals(3, sessPools.size());
+
+            TransactionStrategy.setTransactionStrategy(new TransactionStrategy.NullTransactionStrategy());
+            connPool.getSession();
+            connPool.getSession();
+            connPool.getSession();
+            connPool.getSession();
+            connPool.getSession();
+            connPool.getSession();
+            assertEquals(3, sessPools.size());
+
+            connPool.getSession();
+            assertEquals(4, sessPools.size());
+
+            TransactionStrategy.setTransactionStrategy(new MockTransactionStrategy());
+
+            connPool.getSession();
+            assertEquals(4, sessPools.size());
+
+            connPool.getSession();
+            assertEquals(5, sessPools.size());
+
+            TransactionStrategy.setTransactionStrategy(new TransactionStrategy.NullTransactionStrategy());
+
+            connPool.getSession();
+            connPool.getSession();
+            connPool.getSession();
+            assertEquals(5, sessPools.size());
+        } finally {
+            connPool.removeSessionPool();
+        }
+    }
+
     private void closeAll(List<JmsSession> sessions, JmsConnectionPool connPool) {
         for(JmsSession session : sessions) {
             connPool.handleCloseSession(session);

Added: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/MockTransactionStrategy.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/MockTransactionStrategy.java	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/MockTransactionStrategy.java	2009-05-19 09:46:15 UTC (rev 26609)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.rosetta.pooling;
+
+import org.jboss.soa.esb.common.TransactionStrategy;
+import org.jboss.soa.esb.common.TransactionStrategyException;
+
+import javax.transaction.Synchronization;
+import javax.transaction.xa.XAResource;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockTransactionStrategy extends TransactionStrategy {
+
+    public static Object transactionObject;
+    public static boolean isActive;
+
+    public void begin() throws TransactionStrategyException {
+
+    }
+
+    public void terminate() throws TransactionStrategyException {
+
+    }
+
+    public void rollbackOnly() throws TransactionStrategyException {
+
+    }
+
+    public Object getTransaction() throws TransactionStrategyException {
+        return transactionObject;
+    }
+
+    public Object suspend() throws TransactionStrategyException {
+        return transactionObject;
+    }
+
+    public boolean isActive() throws TransactionStrategyException {
+        return isActive;
+    }
+
+    public void resume(Object tx) throws TransactionStrategyException {
+
+    }
+
+    public void registerSynchronization(Synchronization sync) throws TransactionStrategyException {
+
+    }
+
+    public void enlistResource(XAResource resource) throws TransactionStrategyException {
+
+    }
+}

Copied: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/jms/MockJMSXAConnectionFactory.java (from rev 26585, labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/jms/MockJMSConnectionFactory.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/jms/MockJMSXAConnectionFactory.java	                        (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/jms/MockJMSXAConnectionFactory.java	2009-05-19 09:46:15 UTC (rev 26609)
@@ -0,0 +1,110 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.rosetta.pooling.jms;
+
+import org.jboss.internal.soa.esb.rosetta.pooling.MockJndiContextHandler;
+
+import javax.jms.*;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockJMSXAConnectionFactory implements XAConnectionFactory {
+
+    private int maxSessionsPerConnection;
+
+    public MockJMSXAConnectionFactory(int maxSessionsPerConnection) {
+        this.maxSessionsPerConnection = maxSessionsPerConnection;
+    }
+
+    public XAConnection createXAConnection() throws JMSException {
+        return createConnectionHandler();
+    }
+
+    public XAConnection createXAConnection(String s, String s1) throws JMSException {
+        return createConnectionHandler();
+    }
+
+    private XAConnection createConnectionHandler() {
+        return (XAConnection) Proxy.newProxyInstance(XAConnection.class.getClassLoader(),
+                new Class[]{XAConnection.class},
+                new MockJMSConnectionHandler(maxSessionsPerConnection));
+    }
+
+    private class MockJMSConnectionHandler implements InvocationHandler {
+
+        private int maxSessionsPerConnection;
+        private List<Session> sessions = new ArrayList<Session>();
+
+        public MockJMSConnectionHandler(int maxSessionsPerConnection) {
+            this.maxSessionsPerConnection = maxSessionsPerConnection;
+        }
+
+        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+
+            if(method.getName().equals("createSession")) {
+                return createSession(Session.class);
+            } else if(method.getName().equals("createXASession")) {
+                return createSession(XASession.class);
+            }
+
+            System.out.println("MockJMSConnectionHandler: Call to " + method.getName());
+
+            return null;
+        }
+
+        private Object createSession(Class<? extends Session> sessionType) throws JMSException {
+            System.out.println("Creating JMS Session");
+
+            if(maxSessionsPerConnection > 0 && sessions.size() == maxSessionsPerConnection) {
+                throw new JMSException("Unable to create JMS Session on Connection.  Maximum of " + maxSessionsPerConnection + " Sessions/Connection.");
+            }
+
+            Session session = (Session) Proxy.newProxyInstance(Session.class.getClassLoader(),
+                    new Class[]{sessionType},
+                    new MockJMSSessionHandler());
+
+            sessions.add(session);
+
+            return session;
+        }
+    }
+
+    private class MockJMSSessionHandler implements InvocationHandler {
+
+        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+
+            if(method.getName().equals("getAcknowledgeMode")) {
+                return Session.SESSION_TRANSACTED;
+            }
+
+            System.out.println("MockJMSSessionHandler: Call to " + method.getName());
+
+            return null;
+        }
+    }
+}
\ No newline at end of file


Property changes on: labs/jbossesb/branches/JBESB_4_4_GA_CP/product/rosetta/tests/src/org/jboss/internal/soa/esb/rosetta/pooling/jms/MockJMSXAConnectionFactory.java
___________________________________________________________________
Name: svn:mergeinfo
   + 




More information about the jboss-svn-commits mailing list