tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r585692 - in /openejb/trunk/openejb3: assembly/openejb-tomcat/src/main/resources/META-INF/org.apache.openejb.tomcat/ container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/ container/openejb-core/src/main/resources/META-I...
Date Wed, 17 Oct 2007 20:52:59 GMT
Author: dain
Date: Wed Oct 17 13:52:57 2007
New Revision: 585692

URL: http://svn.apache.org/viewvc?rev=585692&view=rev
Log:
Expose JCA connection manager properties such as PoolMaxSize, ConnectionMaxWaitMilliseconds,
and TransactionSupport

Modified:
    openejb/trunk/openejb3/assembly/openejb-tomcat/src/main/resources/META-INF/org.apache.openejb.tomcat/service-jar.xml
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
    openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml

Modified: openejb/trunk/openejb3/assembly/openejb-tomcat/src/main/resources/META-INF/org.apache.openejb.tomcat/service-jar.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/assembly/openejb-tomcat/src/main/resources/META-INF/org.apache.openejb.tomcat/service-jar.xml?rev=585692&r1=585691&r2=585692&view=diff
==============================================================================
--- openejb/trunk/openejb3/assembly/openejb-tomcat/src/main/resources/META-INF/org.apache.openejb.tomcat/service-jar.xml
(original)
+++ openejb/trunk/openejb3/assembly/openejb-tomcat/src/main/resources/META-INF/org.apache.openejb.tomcat/service-jar.xml
Wed Oct 17 13:52:57 2007
@@ -643,6 +643,22 @@
           class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
 
     ResourceAdapter Default JMS Resource Adapter
+
+    # Specifies if the connection is enrolled in global transaction
+    # allowed values: xa, local or none
+    TransactionSupport xa
+
+    # Maximum number of physical connection to the ActiveMQ broker
+    PoolMaxSize 10
+
+    # Minimum number of physical connection to the ActiveMQ broker
+    PoolMinSize 0
+
+    # Maximum amount of time to wait for a connection
+    ConnectionMaxWaitMilliseconds 5000
+
+    # Maximum amount of time a connection can be idle before being reclaimed
+    ConnectionMaxIdleMinutes 15
   </ServiceProvider>
 
   <ServiceProvider

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?rev=585692&r1=585691&r2=585692&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
Wed Oct 17 13:52:57 2007
@@ -857,18 +857,21 @@
         } else if (service instanceof ManagedConnectionFactory) {
             ManagedConnectionFactory managedConnectionFactory = (ManagedConnectionFactory)
service;
 
-            // get the connection manager
-            GeronimoConnectionManagerFactory connectionManagerFactory = new GeronimoConnectionManagerFactory();
-            // default transaction support is "local" and that doesn't seem to work
-            String transactionSupport = serviceInfo.properties.getProperty("TransactionSupport",
"xa");
-            connectionManagerFactory.setTransactionSupport(transactionSupport);
-            connectionManagerFactory.setTransactionManager(transactionManager);
+            // connection manager is constructed via a recipe so we automatically expose
all cmf properties
+            ObjectRecipe connectionManagerRecipe = new ObjectRecipe(GeronimoConnectionManagerFactory.class,
"create");
+            connectionManagerRecipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+            connectionManagerRecipe.setAllProperties(serviceInfo.properties);
+            connectionManagerRecipe.setProperty("name", serviceInfo.id);
+
+            // standard properties
+            connectionManagerRecipe.setProperty("transactionManager", transactionManager);
             ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
             if (classLoader == null) classLoader = getClass().getClassLoader();
             if (classLoader == null) classLoader = ClassLoader.getSystemClassLoader();
-            connectionManagerFactory.setClassLoader(classLoader);
-            ConnectionManager connectionManager = connectionManagerFactory.create();
+            connectionManagerRecipe.setProperty("classLoader", classLoader);
 
+            // create the connection manager
+            ConnectionManager connectionManager = (ConnectionManager) connectionManagerRecipe.create();
             if (connectionManager == null) {
                 throw new RuntimeException("Invalid connection manager specified for connector
identity = " + serviceInfo.id);
             }

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml?rev=585692&r1=585691&r2=585692&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
Wed Oct 17 13:52:57 2007
@@ -636,6 +636,22 @@
           class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
     
     ResourceAdapter Default JMS Resource Adapter
+
+    # Specifies if the connection is enrolled in global transaction
+    # allowed values: xa, local or none
+    TransactionSupport xa
+
+    # Maximum number of physical connection to the ActiveMQ broker
+    PoolMaxSize 10
+
+    # Minimum number of physical connection to the ActiveMQ broker
+    PoolMinSize 0
+
+    # Maximum amount of time to wait for a connection
+    ConnectionMaxWaitMilliseconds 5000
+
+    # Maximum amount of time a connection can be idle before being reclaimed
+    ConnectionMaxIdleMinutes 15
   </ServiceProvider>
 
   <ServiceProvider



Mime
View raw message