geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1058803 - in /geronimo/sandbox/djencks/txmanager: ./ geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/ geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/ geronimo-txmanager-server/ geronimo-txma...
Date Thu, 13 Jan 2011 23:54:07 GMT
Author: djencks
Date: Thu Jan 13 23:54:06 2011
New Revision: 1058803

URL: http://svn.apache.org/viewvc?rev=1058803&view=rev
Log:
GERONIMO-5742 be sure to send mci's back to the right pool.  Thanks to Florent Guillaume

Added:
    geronimo/sandbox/djencks/txmanager/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/MultiPoolMinSizeTest.java
  (with props)
    geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/
    geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.sample.xml   (with props)
    geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.xml   (with props)
    geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/src/
    geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/src/main/
    geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/src/main/resources/
Modified:
    geronimo/sandbox/djencks/txmanager/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
    geronimo/sandbox/djencks/txmanager/pom.xml

Modified: geronimo/sandbox/djencks/txmanager/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/txmanager/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java?rev=1058803&r1=1058802&r2=1058803&view=diff
==============================================================================
--- geronimo/sandbox/djencks/txmanager/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
(original)
+++ geronimo/sandbox/djencks/txmanager/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/MultiPoolConnectionInterceptor.java
Thu Jan 13 23:54:06 2011
@@ -77,8 +77,8 @@ public class MultiPoolConnectionIntercep
                 pools.put(key, (PoolingAttributes) poolInterceptor);
             }
         }
-        mci.setPoolInterceptor(poolInterceptor);
         poolInterceptor.getConnection(connectionInfo);
+        connectionInfo.getManagedConnectionInfo().setPoolInterceptor(poolInterceptor);
     }
 
     // let underlying pools handle destroyed processing...

Added: geronimo/sandbox/djencks/txmanager/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/MultiPoolMinSizeTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/txmanager/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/MultiPoolMinSizeTest.java?rev=1058803&view=auto
==============================================================================
--- geronimo/sandbox/djencks/txmanager/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/MultiPoolMinSizeTest.java
(added)
+++ geronimo/sandbox/djencks/txmanager/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/MultiPoolMinSizeTest.java
Thu Jan 13 23:54:06 2011
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.connector.outbound;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ManagedConnectionFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.geronimo.connector.mock.MockManagedConnectionFactory;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PoolingSupport;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.SinglePool;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class MultiPoolMinSizeTest extends TestCase {
+
+    private ManagedConnectionFactory mcf = new MockManagedConnectionFactory();
+    protected MultiPoolConnectionInterceptor interceptor;
+    protected int maxSize = 10;
+    protected int minSize = 2;
+    protected boolean matchOne = true;
+    protected boolean matchAll = true;
+    protected boolean selectOneAssumeMatch = false;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        PoolingSupport singlePool = new SinglePool(maxSize, minSize, 100, 1, matchOne, matchAll,
selectOneAssumeMatch);
+        MCFConnectionInterceptor baseInterceptor = new MCFConnectionInterceptor();
+        interceptor = new MultiPoolConnectionInterceptor(baseInterceptor, singlePool, false,
false);
+    }
+
+    /**
+     * Check that connection from the pre-filled pool can be returned ok.
+     * @throws Exception if test fails
+     */
+    public void testInitialFill() throws Exception {
+        // get first connection, which then fills pool
+        ConnectionInfo ci1 = getConnection();
+        if (minSize > 0) {
+            Thread.sleep(500); // wait for FillTask Timer set at 10ms to run
+            assertEquals(minSize, interceptor.getConnectionCount());
+        }
+        // get second connection from filled pool
+        ConnectionInfo ci2 = getConnection();
+        // return second connection (which needs to have gotten a proper pool interceptor)
+        interceptor.returnConnection(ci2, ConnectionReturnAction.RETURN_HANDLE);
+        // return first connection
+        interceptor.returnConnection(ci1, ConnectionReturnAction.RETURN_HANDLE);
+    }
+
+    private ConnectionInfo getConnection() throws ResourceException {
+        ManagedConnectionInfo mci = new ManagedConnectionInfo(mcf, null);
+        ConnectionInfo ci = new ConnectionInfo(mci);
+        interceptor.getConnection(ci);
+        return ci;
+    }
+
+}

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/MultiPoolMinSizeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/MultiPoolMinSizeTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-connector/src/test/java/org/apache/geronimo/connector/outbound/MultiPoolMinSizeTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.sample.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.sample.xml?rev=1058803&view=auto
==============================================================================
--- geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.sample.xml (added)
+++ geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.sample.xml Thu Jan 13
23:54:06 2011
@@ -0,0 +1,168 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.geronimo.assemblies</groupId>
+    <artifactId>geronimo-txmanager-server</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>application-assembly</packaging>
+
+    <properties>
+        <!-- This may be helpful in selecting the desired geronimo version -->
+        <geronimoVersion>3.0-SNAPSHOT</geronimoVersion>
+
+    </properties>
+
+
+    <dependencies>
+        <!-- You will need the boilerplate to get a runnable server -->
+        <dependency>
+            <groupId>org.apache.geronimo.assemblies</groupId>
+            <artifactId>geronimo-boilerplate</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+        </dependency>
+
+
+        <!-- List the plugins you want in your server -->
+
+    </dependencies>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+
+                <plugin>
+                    <groupId>org.apache.geronimo.buildsupport</groupId>
+                    <artifactId>car-maven-plugin</artifactId>
+                    <version>${geronimoVersion}</version>
+                    <extensions>true</extensions>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.geronimo.genesis.plugins</groupId>
+                    <artifactId>tools-maven-plugin</artifactId>
+                    <version>1.3</version>
+                    <extensions>true</extensions>
+                </plugin>
+
+            </plugins>
+        </pluginManagement>
+        <!-- uncomment if you have more content to stuff in here (not recommended - use
a plugin with copy-files) -->
+<!--
+        <resources>
+            <resource>
+                <directory>${pom.basedir}/src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+-->
+
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.genesis.plugins</groupId>
+                <artifactId>tools-maven-plugin</artifactId>
+
+                <!-- Tools includes custom packagings, install as extension to pick them
up -->
+                <extensions>true</extensions>
+
+<!--
+                <executions>
+                    <execution>
+                        <id>install-legal-files</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>copy-legal-files</goal>
+                        </goals>
+                        <configuration>
+                            -->
+<!-- Fail the build if no legal files were copied -->
+<!--
+                            <strict>true</strict>
+                        </configuration>
+                    </execution>
+
+                    <execution>
+                        <id>verify-legal-files</id>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>verify-legal-files</goal>
+                        </goals>
+                        <configuration>
+                            -->
+<!-- Fail the build if no legal files were found -->
+<!--
+                            <strict>true</strict>
+                        </configuration>
+                    </execution>
+                </executions>
+-->
+            </plugin>
+            <plugin>
+                <groupId>org.apache.geronimo.buildsupport</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>install</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>install-modules</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>archive</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>archive</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <servers>
+                        <serverInstance>
+                            <name>default</name>
+                            <configFile>var/config/config.xml</configFile>
+                            <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile>
+                            <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix>
+                            <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile>
+                        </serverInstance>
+                        <serverInstance>
+                            <name>client</name>
+                            <attributeManagerFrom>default</attributeManagerFrom>
+                            <artifactAliasesFile>var/config/client_artifact_aliases.properties</artifactAliasesFile>
+                        </serverInstance>
+                        <serverInstance>
+                            <name>offline</name>
+                            <configFile>var/config/offline-deployer-config.xml</configFile>
+                            <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile>
+                            <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix>
+                            <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile>
+                        </serverInstance>
+                        <serverInstance>
+                            <name>jsr88</name>
+                            <configFile>var/config/jsr88-configurer-config.xml</configFile>
+                            <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile>
+                            <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix>
+                            <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile>
+                        </serverInstance>
+                    </servers>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.sample.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.sample.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.sample.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.xml?rev=1058803&view=auto
==============================================================================
--- geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.xml (added)
+++ geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.xml Thu Jan 13 23:54:06
2011
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>geronimo-txmanager-parent</artifactId>
+        <groupId>org.apache.geronimo.components</groupId>
+        <version>3.1.1-SNAPSHOT</version>
+    </parent>
+    <artifactId>geronimo-txmanager-server</artifactId>
+    <packaging>server-assembly</packaging>
+    <properties>
+        <geronimoVersion>3.0-SNAPSHOT</geronimoVersion>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.framework.plugingroups</groupId>
+            <artifactId>framework</artifactId>
+            <version>${geronimoVersion}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr</artifactId>
+            <version>1.6.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.components</groupId>
+            <artifactId>geronimo-transaction</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.components</groupId>
+            <artifactId>geronimo-connector</artifactId>
+        </dependency>
+
+    </dependencies>
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.geronimo.buildsupport</groupId>
+                    <artifactId>car-maven-plugin</artifactId>
+                    <version>${geronimoVersion}</version>
+                    <extensions>true</extensions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.geronimo.buildsupport</groupId>
+                <artifactId>car-maven-plugin</artifactId>
+                <configuration>
+                    <servers>
+                        <serverInstance>
+                            <name>default</name>
+                            <configFile>var/config/config.xml</configFile>
+                            <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile>
+                            <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix>
+                            <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile>
+                        </serverInstance>
+                        <serverInstance>
+                            <name>client</name>
+                            <attributeManagerFrom>default</attributeManagerFrom>
+                            <artifactAliasesFile>var/config/client_artifact_aliases.properties</artifactAliasesFile>
+                        </serverInstance>
+                        <serverInstance>
+                            <name>offline</name>
+                            <configFile>var/config/offline-deployer-config.xml</configFile>
+                            <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile>
+                            <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix>
+                            <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile>
+                        </serverInstance>
+                        <serverInstance>
+                            <name>jsr88</name>
+                            <configFile>var/config/jsr88-configurer-config.xml</configFile>
+                            <configSubstitutionsFile>var/config/config-substitutions.properties</configSubstitutionsFile>
+                            <configSubstitutionsPrefix>org.apache.geronimo.config.substitution.</configSubstitutionsPrefix>
+                            <artifactAliasesFile>var/config/artifact_aliases.properties</artifactAliasesFile>
+                        </serverInstance>
+                    </servers>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/djencks/txmanager/geronimo-txmanager-server/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/sandbox/djencks/txmanager/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/txmanager/pom.xml?rev=1058803&r1=1058802&r2=1058803&view=diff
==============================================================================
--- geronimo/sandbox/djencks/txmanager/pom.xml (original)
+++ geronimo/sandbox/djencks/txmanager/pom.xml Thu Jan 13 23:54:06 2011
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with
@@ -14,11 +14,7 @@
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
--->
-
-<!-- $Rev$ $Date$ -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+--><!-- $Rev$ $Date$ --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
 
@@ -162,7 +158,7 @@
     <modules>
         <module>geronimo-transaction</module>
         <module>geronimo-connector</module>
-    </modules>
-
-</project>
+    <module>geronimo-txmanager-server</module>
+  </modules>
 
+</project>
\ No newline at end of file



Mime
View raw message