geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r931583 - in /geronimo/server/trunk/plugins: client/client/src/main/history/ connector-1_6/ connector-1_6/connector-deployer-1_6/src/main/history/ connector-1_6/connector-deployer-1_6/src/main/plan/ connector-1_6/geronimo-connector-1_6/ con...
Date Wed, 07 Apr 2010 15:19:28 GMT
Author: gawor
Date: Wed Apr  7 15:19:18 2010
New Revision: 931583

URL: http://svn.apache.org/viewvc?rev=931583&view=rev
Log:
GERONIMO-5113: Mostly complete support for @DataSourceDefinition(s) annotations

Added:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ConnectionFactoryRegistration.java   (with props)
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/DataSourceGBean.java   (with props)
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java   (with props)
Modified:
    geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/pom.xml
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml
    geronimo/server/trunk/plugins/connector-1_6/pom.xml
    geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml

Modified: geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml?rev=931583&r1=931582&r2=931583&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/client/client/src/main/history/dependencies.xml Wed Apr  7 15:19:18 2010
@@ -257,6 +257,11 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.tranql</groupId>
+        <artifactId>tranql-connector</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>quartz</groupId>
         <artifactId>quartz</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/history/dependencies.xml?rev=931583&r1=931582&r2=931583&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/history/dependencies.xml Wed Apr  7 15:19:18 2010
@@ -101,4 +101,9 @@
         <artifactId>xbean-reflect</artifactId>
         <type>jar</type>
     </dependency>
+    <dependency>
+        <groupId>org.tranql</groupId>
+        <artifactId>tranql-connector</artifactId>
+        <type>jar</type>
+    </dependency>
 </plugin-artifact>

Modified: geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/plan/plan.xml?rev=931583&r1=931582&r2=931583&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/connector-deployer-1_6/src/main/plan/plan.xml Wed Apr  7 15:19:18 2010
@@ -101,4 +101,15 @@
     </gbean>
     
     <gbean name="RARConfigurer" class="org.apache.geronimo.connector.deployment.RARConfigurer"/>
+
+    <gbean name="DataSourceBuilder" class="org.apache.geronimo.datasource.deployment.DataSourceBuilder">
+        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
+        <attribute name="defaultMaxSize">10</attribute>
+        <attribute name="defaultMinSize">0</attribute>
+        <attribute name="defaultBlockingTimeoutMilliseconds">5000</attribute>
+        <attribute name="defaultIdleTimeoutMinutes">15</attribute>
+        <attribute name="defaultXATransactionCaching">true</attribute>
+        <attribute name="defaultXAThreadCaching">false</attribute>
+    </gbean>
+
 </module>

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/pom.xml?rev=931583&r1=931582&r2=931583&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/pom.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/pom.xml Wed Apr  7 15:19:18 2010
@@ -84,6 +84,11 @@
         <!--</dependency>-->
 
         <dependency>
+            <groupId>org.tranql</groupId>
+            <artifactId>tranql-connector</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-kernel</artifactId>
             <version>${version}</version>

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ConnectionFactoryRegistration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ConnectionFactoryRegistration.java?rev=931583&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ConnectionFactoryRegistration.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ConnectionFactoryRegistration.java Wed Apr  7 15:19:18 2010
@@ -0,0 +1,93 @@
+/**
+ *  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.wrapper.outbound;
+
+import java.util.Hashtable;
+
+import javax.resource.ResourceException;
+
+import org.apache.geronimo.connector.outbound.GenericConnectionManager;
+import org.apache.geronimo.gbean.AbstractName;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceException;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * @version $Revision$
+ */
+public class ConnectionFactoryRegistration {
+    
+    public static final String OSGI_JNDI_SERVICE_NAME = "osgi.jndi.service.name";
+    
+    private final GenericConnectionManager connectionManager;
+    private final BundleContext bundleContext;
+    private final String jndiName;
+    private final String[] connectionInterfaces;
+    private ServiceRegistration serviceRegistration;
+
+    public ConnectionFactoryRegistration(GenericConnectionManager connectionManager,
+                                         BundleContext bundleContext,
+                                         AbstractName abstractName,                                         
+                                         String jndiName,
+                                         String [] connectionInterfaces) {    
+        this.connectionManager = connectionManager;
+        this.bundleContext = bundleContext;      
+        this.connectionInterfaces = connectionInterfaces;
+        
+        if (jndiName == null && abstractName != null) {
+            this.jndiName = abstractName.getArtifact().getGroupId() + "/" + 
+                            abstractName.getArtifact().getArtifactId() + "/" + 
+                            abstractName.getNameProperty("j2eeType") + "/" + 
+                            abstractName.getNameProperty("name");
+        } else {
+            this.jndiName = jndiName;
+        }
+    }    
+
+    public void register() {                
+        Hashtable properties = new Hashtable();
+        if (jndiName != null) {
+            properties.put(OSGI_JNDI_SERVICE_NAME, jndiName);
+        }
+        // register ServiceFactory so that each bundle gets its own instance of the connection factory
+        serviceRegistration = bundleContext.registerService(connectionInterfaces, new ConnectionFactoryService(), properties);
+    }
+
+    private class ConnectionFactoryService implements ServiceFactory {
+
+        public Object getService(Bundle bundle, ServiceRegistration registration) {
+            try {
+                return connectionManager.createConnectionFactory();
+            } catch (ResourceException e) {
+                throw new ServiceException("Error creating connection factory", e);
+            }
+        }
+
+        public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
+        }
+        
+    }
+    
+    public void unregister() throws Exception {
+        if (serviceRegistration != null) {
+            serviceRegistration.unregister();
+        }
+    }
+
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ConnectionFactoryRegistration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ConnectionFactoryRegistration.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ConnectionFactoryRegistration.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java?rev=931583&r1=931582&r2=931583&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java Wed Apr  7 15:19:18 2010
@@ -23,11 +23,10 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.io.ObjectStreamException;
 import java.io.Serializable;
-import java.util.Hashtable;
 
-import javax.resource.ResourceException;
 import javax.resource.spi.ConnectionManager;
 import javax.security.auth.Subject;
+
 import org.apache.geronimo.connector.outbound.GenericConnectionManager;
 import org.apache.geronimo.connector.outbound.SubjectSource;
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PoolingSupport;
@@ -47,10 +46,7 @@ import org.apache.geronimo.kernel.Kernel
 import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.security.ContextManager;
 import org.apache.geronimo.transaction.manager.RecoverableTransactionManager;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceException;
-import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceRegistration;
 
 /**
@@ -60,9 +56,7 @@ import org.osgi.framework.ServiceRegistr
 public class GenericConnectionManagerGBean extends GenericConnectionManager implements GBeanLifecycle, Serializable, Externalizable {
     private Kernel kernel;
     private AbstractName abstractName;
-    private BundleContext bundleContext;
-    private ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper;
-    private ServiceRegistration serviceRegistration;
+    private transient ConnectionFactoryRegistration connectionRegistration;
     //externalizable format version
     private static final int VERSION = 1;
 
@@ -80,9 +74,14 @@ public class GenericConnectionManagerGBe
         super(transactionSupport, pooling, getSubjectSource(containerManagedSecurity), connectionTracker, transactionManager, managedConnectionFactoryWrapper.getManagedConnectionFactory(), objectName, classLoader);
         this.kernel = kernel;
         this.abstractName = abstractName;
-        this.bundleContext = bundleContext;
-        this.managedConnectionFactoryWrapper = managedConnectionFactoryWrapper;
+        
         doRecovery();
+        
+        connectionRegistration = new ConnectionFactoryRegistration(this, 
+                                                                   bundleContext, 
+                                                                   abstractName, 
+                                                                   managedConnectionFactoryWrapper.getJndiName(), 
+                                                                   new String [] { managedConnectionFactoryWrapper.getConnectionFactoryInterface() });
     }
 
     public GenericConnectionManagerGBean() {
@@ -103,40 +102,11 @@ public class GenericConnectionManagerGBe
     }
 
     public void doStart() throws Exception {
-        String connectionInterface = managedConnectionFactoryWrapper.getConnectionFactoryInterface();
-        String jndiName = managedConnectionFactoryWrapper.getJndiName();
-        if (jndiName == null) {
-            jndiName = abstractName.getArtifact().getGroupId() + "/" + 
-                       abstractName.getArtifact().getArtifactId() + "/" + 
-                       abstractName.getNameProperty("j2eeType") + "/" + 
-                       abstractName.getNameProperty("name");
-        }
-                
-        Hashtable properties = new Hashtable();
-        properties.put("osgi.jndi.service.name", jndiName);
-        // register ServiceFactory so that each bundle gets its own instance of the connection factory
-        serviceRegistration = bundleContext.registerService(connectionInterface, new ConnectionFactoryService(), properties);
-    }
-
-    private class ConnectionFactoryService implements ServiceFactory {
-
-        public Object getService(Bundle bundle, ServiceRegistration registration) {
-            try {
-                return createConnectionFactory();
-            } catch (ResourceException e) {
-                throw new ServiceException("Error creating connection factory", e);
-            }
-        }
-
-        public void ungetService(Bundle bundle, ServiceRegistration registration, Object service) {
-        }
-        
+        connectionRegistration.register();
     }
-    
+   
     public void doStop() throws Exception {
-        if (serviceRegistration != null) {
-            serviceRegistration.unregister();
-        }
+        connectionRegistration.unregister();
     }
     
     private static SubjectSource getSubjectSource(boolean containerManagedSecurity) {

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/DataSourceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/DataSourceGBean.java?rev=931583&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/DataSourceGBean.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/DataSourceGBean.java Wed Apr  7 15:19:18 2010
@@ -0,0 +1,275 @@
+/**
+ *  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.datasource;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.sql.ConnectionPoolDataSource;
+import javax.sql.DataSource;
+import javax.sql.XADataSource;
+
+import org.apache.geronimo.connector.outbound.GenericConnectionManager;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.NoPool;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.NoTransactions;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PoolingSupport;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.SinglePool;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.XATransactions;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
+import org.apache.geronimo.connector.wrapper.outbound.ConnectionFactoryRegistration;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.naming.ResourceSource;
+import org.apache.geronimo.transaction.manager.RecoverableTransactionManager;
+import org.apache.xbean.recipe.ObjectRecipe;
+import org.apache.xbean.recipe.Option;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.tranql.connector.NoExceptionsAreFatalSorter;
+import org.tranql.connector.jdbc.AbstractLocalDataSourceMCF;
+import org.tranql.connector.jdbc.AbstractPooledConnectionDataSourceMCF;
+import org.tranql.connector.jdbc.AbstractXADataSourceMCF;
+
+/**
+ * @version $Revision$
+ */
+@GBean
+public class DataSourceGBean implements GBeanLifecycle, ResourceSource<ResourceException> {
+    
+    private static final Logger log = LoggerFactory.getLogger(DataSourceGBean.class);
+        
+    private final DataSourceDescription dataSourceDescription;
+    private final transient ClassLoader classLoader;
+    private final transient GenericConnectionManager connectionManager;
+    private final transient ConnectionFactoryRegistration connectionRegistration;
+    
+    public DataSourceGBean(@ParamAttribute(name="dataSourceDescription") DataSourceDescription dataSourceDescription,
+                           @ParamAttribute(name="defaultMaxSize") int defaultMaxSize,
+                           @ParamAttribute(name="defaultMinSize") int defaultMinSize,
+                           @ParamAttribute(name="defaultBlockingTimeoutMilliseconds") int defaultBlockingTimeoutMilliseconds,
+                           @ParamAttribute(name="defaultIdleTimeoutMinutes") int defaultIdleTimeoutMinutes,
+                           @ParamAttribute(name="defaultXATransactionCaching") boolean defaultXATransactionCaching,
+                           @ParamAttribute(name="defaultXAThreadCaching") boolean defaultXAThreadCaching,
+                           @ParamReference(name="ConnectionTracker", namingType = NameFactory.JCA_CONNECTION_TRACKER) ConnectionTracker connectionTracker,
+                           @ParamReference(name="TransactionManager", namingType = NameFactory.JTA_RESOURCE) RecoverableTransactionManager transactionManager,
+                           @ParamSpecial(type=SpecialAttributeType.objectName) String objectName,
+                           @ParamSpecial(type=SpecialAttributeType.abstractName) AbstractName abstractName,
+                           @ParamSpecial(type=SpecialAttributeType.classLoader) ClassLoader classLoader,
+                           @ParamSpecial(type=SpecialAttributeType.bundleContext) BundleContext bundleContext)
+        throws Exception {
+        this.dataSourceDescription = dataSourceDescription;        
+        this.classLoader = classLoader;
+        
+        String dsName = dataSourceDescription.getName();
+        String dsClass = dataSourceDescription.getClassName();
+        
+        TransactionSupport transactionSupport;
+        PoolingSupport pooling;
+        ManagedConnectionFactory mcf;
+       
+        Object instance = createDataSource();
+        
+        if (instance instanceof XADataSource) {
+            mcf = new XADataSourceMCF((XADataSource) instance);
+            if (dataSourceDescription.isTransactional()) {
+                transactionSupport = new XATransactions(defaultXATransactionCaching, defaultXAThreadCaching);
+            } else {
+                transactionSupport = NoTransactions.INSTANCE;
+            }
+            pooling = createPool(defaultMinSize, 
+                                 defaultMaxSize, 
+                                 defaultBlockingTimeoutMilliseconds, 
+                                 defaultIdleTimeoutMinutes);
+        } else if (instance instanceof ConnectionPoolDataSource) {
+            mcf = new PooledConnectionDataSourceMCF((ConnectionPoolDataSource) instance);
+            if (dataSourceDescription.isTransactional()) {
+                log.warn("[{}] Transactional property is true but DataSource does not support transactions", dsName); 
+            }
+            transactionSupport = NoTransactions.INSTANCE;
+            pooling = createPool(defaultMinSize, 
+                                 defaultMaxSize, 
+                                 defaultBlockingTimeoutMilliseconds, 
+                                 defaultIdleTimeoutMinutes);
+        } else if (instance instanceof DataSource) {
+            mcf = new LocalDataSourceMCF((DataSource) instance, true);
+            if (dataSourceDescription.isTransactional()) {
+                log.warn("[{}] Transactional property is true but DataSource does not support transactions", dsName); 
+            }
+            transactionSupport = NoTransactions.INSTANCE;
+            if (dataSourceDescription.hasPoolingProperties()) {
+                log.warn("[{}] Some pooling properties are set but DataSource does not support pooling", dsName);
+            }
+            pooling = new NoPool();
+        } else {            
+            throw new Exception("[" + dsName + "] Invalid DataSource type: " + dsClass);
+        }
+        
+        this.connectionManager = 
+            new GenericConnectionManager(transactionSupport, pooling, null, connectionTracker, transactionManager, mcf, objectName, classLoader);
+                
+        connectionManager.doRecovery();
+        
+        connectionRegistration = new ConnectionFactoryRegistration(connectionManager, 
+                                                                   bundleContext, 
+                                                                   abstractName, 
+                                                                   getOsgiJndiName(), 
+                                                                   new String [] { DataSource.class.getName() });
+    }
+    
+    private Object createDataSource() throws Exception {
+        String className = dataSourceDescription.getClassName();
+        Class clazz = classLoader.loadClass(className);
+            
+        Map<String, Object> properties = new HashMap<String, Object>();
+            
+        // TODO: handle "url" property somehow
+        // TODO: handle "isolationType" property somehow
+        
+        // standard settings
+        setProperty(properties, "description", dataSourceDescription.getDescription());
+        setProperty(properties, "user", dataSourceDescription.getUser());
+        setProperty(properties, "password", dataSourceDescription.getPassword());
+        setProperty(properties, "databaseName", dataSourceDescription.getDatabaseName());
+        if (dataSourceDescription.getPortNumber() != -1) {
+            setProperty(properties, "portNumber", dataSourceDescription.getPortNumber());
+        }
+        setProperty(properties, "serverName", dataSourceDescription.getServerName());
+        setProperty(properties, "loginTimeout", dataSourceDescription.getLoginTimeout());
+        // other properties
+        if (dataSourceDescription.getProperties() != null) {
+            properties.putAll(dataSourceDescription.getProperties());
+        }
+                                                    
+        ObjectRecipe recipe = new ObjectRecipe(clazz, properties);
+        recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
+            
+        Object instance = recipe.create();
+            
+        Map<String, Object> unset = recipe.getUnsetProperties();
+        if (unset != null && !unset.isEmpty()) {
+            log.warn("Some DataSource properties were not set {}", unset);
+        }
+            
+        return instance;
+    }
+    
+    private void setProperty(Map<String, Object> properties, String name, Object value) {
+        if (value != null) {
+            properties.put(name, value);
+        }
+    }
+          
+    private String getOsgiJndiName() {
+        if (dataSourceDescription.getProperties() != null) {
+            return dataSourceDescription.getProperties().get(ConnectionFactoryRegistration.OSGI_JNDI_SERVICE_NAME);
+        } else {
+            return null;
+        }        
+    }
+    
+    private PoolingSupport createPool(int defaultMinSize, 
+                                      int defaultMaxSize, 
+                                      int defaultBlockingTimeoutMilliseconds, 
+                                      int defaultIdleTimeoutMinutes) {
+        return new SinglePool(
+                dataSourceDescription.getMaxPoolSize() != -1 ? dataSourceDescription.getMaxPoolSize() : defaultMaxSize,
+                dataSourceDescription.getMinPoolSize() != -1 ? dataSourceDescription.getMinPoolSize() : defaultMinSize,
+                defaultBlockingTimeoutMilliseconds,
+                dataSourceDescription.getMaxIdleTime() != -1 ? dataSourceDescription.getMaxIdleTime() : defaultIdleTimeoutMinutes,
+                false,
+                false,
+                true);
+    }
+    
+    public Object $getResource() throws ResourceException {
+        return connectionManager.createConnectionFactory();
+    }
+    
+    public void doFail() {
+    }
+
+    public void doStart() throws Exception {
+        connectionRegistration.register();
+    }
+ 
+    public void doStop() throws Exception {
+        connectionRegistration.unregister();
+    }
+      
+    private class PooledConnectionDataSourceMCF extends AbstractPooledConnectionDataSourceMCF {
+        
+        public PooledConnectionDataSourceMCF(ConnectionPoolDataSource ds) {
+            super(ds, new NoExceptionsAreFatalSorter());
+        }
+
+        @Override
+        public String getPassword() {
+            return dataSourceDescription.getPassword();
+        }
+
+        @Override
+        public String getUserName() {
+            return dataSourceDescription.getUser();
+        }
+    }
+    
+    private class XADataSourceMCF extends AbstractXADataSourceMCF {
+        
+        public XADataSourceMCF(XADataSource ds) {
+            super(ds, new NoExceptionsAreFatalSorter());
+        }
+
+        @Override
+        public String getPassword() {
+            return dataSourceDescription.getPassword();
+        }
+
+        @Override
+        public String getUserName() {
+            return dataSourceDescription.getUser();
+        }
+    }
+    
+    private class LocalDataSourceMCF extends AbstractLocalDataSourceMCF {
+        
+        public LocalDataSourceMCF(DataSource ds, boolean commitBeforeAutocommit) {
+            super(ds, new NoExceptionsAreFatalSorter(), commitBeforeAutocommit);
+        }
+
+        @Override
+        public String getPassword() {
+            return dataSourceDescription.getPassword();
+        }
+
+        @Override
+        public String getUserName() {
+            return dataSourceDescription.getUser();
+        }
+    }
+
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/DataSourceGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/DataSourceGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/datasource/DataSourceGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml?rev=931583&r1=931582&r2=931583&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/pom.xml Wed Apr  7 15:19:18 2010
@@ -96,11 +96,7 @@
             <artifactId>geronimo-system</artifactId>
             <version>${version}</version>
         </dependency>
-        
-        <!--<dependency>-->
-            <!--<groupId>org.apache.geronimo.schema</groupId>-->
-            <!--<artifactId>geronimo-schema-j2ee_1.4</artifactId>-->
-        <!--</dependency>-->
+
         <dependency>
             <groupId>org.apache.openejb</groupId>
             <artifactId>openejb-jee</artifactId>
@@ -127,6 +123,7 @@
             <artifactId>geronimo-transaction-1_6</artifactId>
             <version>${version}</version>
         </dependency>
+
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-test-ddbean</artifactId>
@@ -188,6 +185,7 @@
                             org.apache.geronimo.connector.deployment,
                             org.apache.geronimo.connector.deployment.dconfigbean,
                             org.apache.geronimo.connector.deployment.jsr88,
+                            org.apache.geronimo.datasource.deployment,
                             org.apache.geronimo.xbeans.connector,
                             org.apache.geronimo.xbeans.connector.impl
                         </Export-Package>

Added: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java?rev=931583&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java (added)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java Wed Apr  7 15:19:18 2010
@@ -0,0 +1,377 @@
+/**
+ *  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.datasource.deployment;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.sql.DataSourceDefinition;
+import javax.annotation.sql.DataSourceDefinitions;
+import javax.resource.ResourceException;
+import javax.sql.DataSource;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.datasource.DataSourceDescription;
+import org.apache.geronimo.datasource.DataSourceGBean;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamAttribute;
+import org.apache.geronimo.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.osgi.BundleAnnotationFinder;
+import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
+import org.apache.geronimo.naming.reference.ResourceReferenceFactory;
+import org.apache.geronimo.xbeans.javaee6.DataSourceType;
+import org.apache.geronimo.xbeans.javaee6.IsolationLevelType;
+import org.apache.geronimo.xbeans.javaee6.PropertyType;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@GBean(j2eeType = NameFactory.MODULE_BUILDER)
+public class DataSourceBuilder extends AbstractNamingBuilder {
+
+    private static final Logger log = LoggerFactory.getLogger(DataSourceBuilder.class);
+
+    private final int defaultMaxSize;
+    private final int defaultMinSize;
+    private final int defaultBlockingTimeoutMilliseconds;
+    private final int defaultIdleTimeoutMinutes;
+    private final boolean defaultXATransactionCaching;
+    private final boolean defaultXAThreadCaching;
+    
+    private final PackageAdmin packageAdmin;
+    private final QNameSet dataSourceQNameSet;
+
+    public DataSourceBuilder(@ParamAttribute(name = "eeNamespaces") String[] eeNamespaces,
+                             @ParamAttribute(name = "defaultMaxSize") int defaultMaxSize,
+                             @ParamAttribute(name = "defaultMinSize") int defaultMinSize,
+                             @ParamAttribute(name = "defaultBlockingTimeoutMilliseconds") int defaultBlockingTimeoutMilliseconds,
+                             @ParamAttribute(name = "defaultIdleTimeoutMinutes") int defaultIdleTimeoutMinutes,
+                             @ParamAttribute(name = "defaultXATransactionCaching") boolean defaultXATransactionCaching,
+                             @ParamAttribute(name = "defaultXAThreadCaching") boolean defaultXAThreadCaching,
+                             @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle) {
+        this.defaultMaxSize = defaultMaxSize;
+        this.defaultMinSize = defaultMinSize;
+        this.defaultBlockingTimeoutMilliseconds = defaultBlockingTimeoutMilliseconds;
+        this.defaultIdleTimeoutMinutes = defaultIdleTimeoutMinutes;
+        this.defaultXATransactionCaching = defaultXATransactionCaching;
+        this.defaultXAThreadCaching = defaultXAThreadCaching;
+        
+        ServiceReference sr = bundle.getBundleContext().getServiceReference(PackageAdmin.class.getName());
+        this.packageAdmin = (PackageAdmin) bundle.getBundleContext().getService(sr);
+        
+        this.dataSourceQNameSet = buildQNameSet(eeNamespaces, "data-source");
+    }
+    
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+                        
+        Bundle bundle = module.getEarContext().getDeploymentBundle();
+        
+        BundleAnnotationFinder classFinder;
+        try {
+            classFinder = new BundleAnnotationFinder(packageAdmin, bundle);
+        } catch (Exception e) {
+            throw new DeploymentException("could not create class finder " + bundle, e);
+        }
+        
+        AnnotatedApp app = module.getAnnotatedApp();
+        
+        // step 1: process annotations and update deployment descriptor
+        List<Class> classes;        
+        classes = classFinder.findAnnotatedClasses(DataSourceDefinitions.class);
+        if (classes != null) {
+            for (Class clazz : classes) {
+                DataSourceDefinitions dsDefinitions = (DataSourceDefinitions) clazz.getAnnotation(DataSourceDefinitions.class);
+                for (DataSourceDefinition dsDefinition : dsDefinitions.value()) {
+                    processDefinition(dsDefinition, app);
+                }
+                
+            }
+        }
+        classes = classFinder.findAnnotatedClasses(DataSourceDefinition.class);
+        if (classes != null) {
+            for (Class clazz : classes) {
+                DataSourceDefinition dsDefinition = (DataSourceDefinition) clazz.getAnnotation(DataSourceDefinition.class);
+                processDefinition(dsDefinition, app);
+            }
+        }
+        
+        // step 2: bind all defined data sources into jndi
+        DataSourceType[] dataSources = app.getDataSourceArray();
+        if (dataSources != null) {
+            for (int i = 0; i < dataSources.length; i++) {
+                try {
+                    addDataSourceGBean(module, componentContext, dataSources[i], "DataSource-" + i);
+                } catch (GBeanAlreadyExistsException e) {
+                    throw new DeploymentException("Error creating DataSource gbean", e);
+                }
+            }
+        }        
+    }
+
+    private void addDataSourceGBean(Module module, Map componentContext, DataSourceType ds, String name)
+        throws GBeanAlreadyExistsException {
+                        
+        String jndiName = ds.getName().getStringValue();
+        
+        if (lookupJndiContextMap(componentContext, jndiName) != null) {
+            return;
+        }
+        
+        EARContext earContext = module.getEarContext();
+                       
+        AbstractName dataSourceAbstractName = earContext.getNaming().createChildName(module.getModuleName(), name, "GBean");
+
+        GBeanData dataSourceGBean = new GBeanData(dataSourceAbstractName, DataSourceGBean.class);
+        
+        DataSourceDescription dsDescription = createDataSourceDescription(ds);
+        dataSourceGBean.setAttribute("dataSourceDescription", dsDescription);
+        
+        dataSourceGBean.setAttribute("defaultMaxSize", defaultMaxSize);
+        dataSourceGBean.setAttribute("defaultMinSize", defaultMinSize);
+        dataSourceGBean.setAttribute("defaultBlockingTimeoutMilliseconds", defaultBlockingTimeoutMilliseconds);
+        dataSourceGBean.setAttribute("defaultIdleTimeoutMinutes", defaultIdleTimeoutMinutes);
+        
+        dataSourceGBean.setAttribute("defaultXATransactionCaching", defaultXATransactionCaching);
+        dataSourceGBean.setAttribute("defaultXAThreadCaching", defaultXAThreadCaching);
+        
+        dataSourceGBean.setReferencePattern("ConnectionTracker", earContext.getConnectionTrackerName());
+        dataSourceGBean.setReferencePattern("TransactionManager", earContext.getTransactionManagerName());
+        
+        earContext.addGBean(dataSourceGBean);
+                
+        Object ref = new ResourceReferenceFactory<ResourceException>(module.getConfigId(), new AbstractNameQuery(dataSourceAbstractName), DataSource.class);
+        put(jndiName, ref, getJndiContextMap(componentContext));
+    }
+    
+    private DataSourceType processDefinition(DataSourceDefinition dsDefinition, AnnotatedApp annotatedApp) {
+        DataSourceType dataSource = findDataSource(dsDefinition, annotatedApp);
+        if (dataSource == null) {
+            dataSource = annotatedApp.addNewDataSource();
+            dataSource.addNewName().setStringValue(dsDefinition.name());
+        }
+        
+        if (!dataSource.isSetClassName()) {
+            dataSource.addNewClassName().setStringValue(dsDefinition.className());
+        }
+        
+        if (!dataSource.isSetDescription() && dsDefinition.description().trim().length() > 0) {
+            dataSource.addNewDescription().setStringValue(dsDefinition.description().trim());            
+        }
+        
+        if (!dataSource.isSetUrl() && dsDefinition.url().trim().length() > 0) {
+            dataSource.addNewUrl().setStringValue(dsDefinition.description().trim());
+        }
+        
+        if (!dataSource.isSetUser() && dsDefinition.user().trim().length() > 0) {
+            dataSource.addNewUser().setStringValue(dsDefinition.user().trim());
+        }
+        
+        if (!dataSource.isSetPassword() && dsDefinition.password().trim().length() > 0) {
+            dataSource.addNewPassword().setStringValue(dsDefinition.password().trim());
+        }
+        
+        if (!dataSource.isSetDatabaseName() && dsDefinition.databaseName().trim().length() > 0) {
+            dataSource.addNewDatabaseName().setStringValue(dsDefinition.databaseName().trim());
+        }
+        
+        if (!dataSource.isSetPortNumber() && dsDefinition.portNumber() != -1) {
+            dataSource.addNewPortNumber().setStringValue(String.valueOf(dsDefinition.portNumber()));
+        }
+        
+        if (!dataSource.isSetServerName() && dsDefinition.serverName().trim().length() > 0) {
+            dataSource.addNewServerName().setStringValue(dsDefinition.serverName().trim());
+        }
+        
+        if (!dataSource.isSetUrl() && dsDefinition.url().trim().length() > 0) {
+            dataSource.addNewUrl().setStringValue(dsDefinition.url().trim());
+        }
+        
+        if (!dataSource.isSetInitialPoolSize() && dsDefinition.initialPoolSize() != -1) {
+            dataSource.addNewInitialPoolSize().setStringValue(String.valueOf(dsDefinition.initialPoolSize()));            
+        }
+        
+        if (!dataSource.isSetMaxPoolSize() && dsDefinition.maxPoolSize() != -1) {
+            dataSource.addNewMaxPoolSize().setStringValue(String.valueOf(dsDefinition.maxPoolSize()));            
+        }
+        
+        if (!dataSource.isSetMinPoolSize() && dsDefinition.minPoolSize() != -1) {
+            dataSource.addNewMinPoolSize().setStringValue(String.valueOf(dsDefinition.minPoolSize()));            
+        }
+        
+        if (!dataSource.isSetMaxIdleTime() && dsDefinition.maxIdleTime() != -1) {
+            dataSource.addNewMaxIdleTime().setStringValue(String.valueOf(dsDefinition.maxIdleTime()));            
+        }
+        
+        if (!dataSource.isSetMaxStatements() && dsDefinition.maxStatements() != -1) {
+            dataSource.addNewMaxStatements().setStringValue(String.valueOf(dsDefinition.maxStatements()));            
+        }
+        
+        if (!dataSource.isSetLoginTimeout() && dsDefinition.loginTimeout() != 0) {
+            dataSource.addNewLoginTimeout().setStringValue(String.valueOf(dsDefinition.loginTimeout()));            
+        }
+        
+        if (!dataSource.isSetIsolationLevel() && dsDefinition.isolationLevel() != -1) {
+            dataSource.setIsolationLevel(IsolationLevelType.Enum.forInt(dsDefinition.isolationLevel()));
+        }
+        
+        if (!dataSource.isSetTransactional()) {
+            dataSource.addNewTransactional().setBooleanValue(dsDefinition.transactional());
+        }
+        
+        if (dataSource.getPropertyArray() == null || dataSource.getPropertyArray().length == 0) {
+            String[] properties = dsDefinition.properties();
+            if (properties != null) {
+                for (String property : properties) {
+                    String[] tokens = property.split("=");
+                    PropertyType propertyType = dataSource.addNewProperty();
+                    propertyType.addNewName().setStringValue(tokens[0]);
+                    propertyType.addNewValue().setStringValue(tokens[1]);                    
+                }               
+            }
+        }
+        
+        return dataSource;
+    }
+
+    private DataSourceType findDataSource(DataSourceDefinition dsDefinition, AnnotatedApp annotatedApp) {
+        String dsDefinitionName = getJndiName(dsDefinition.name().trim());
+        DataSourceType[] dataSources = annotatedApp.getDataSourceArray();
+        for (DataSourceType ds : dataSources) {
+            String dsName = getJndiName(ds.getName().getStringValue().trim());
+            if (dsDefinitionName.equals(dsName)) {
+                return ds;
+            }
+        }
+        return null;        
+    }
+    
+    private DataSourceDescription createDataSourceDescription(DataSourceType ds) {
+        DataSourceDescription dsDescription = new DataSourceDescription();
+        
+        dsDescription.setName(ds.getName().getStringValue());
+        dsDescription.setClassName(ds.getClassName().getStringValue());
+        
+        if (ds.isSetDescription()) {
+            dsDescription.setDescription(ds.getDescription().getStringValue());
+        }
+        
+        if (ds.isSetUrl()) {
+            dsDescription.setUrl(ds.getUrl().getStringValue());
+        }
+        
+        if (ds.isSetUser()) {
+            dsDescription.setUser(ds.getUser().getStringValue());
+        }
+        
+        if (ds.isSetPassword()) {
+            dsDescription.setPassword(ds.getPassword().getStringValue());
+        }
+        
+        if (ds.isSetDatabaseName()) {
+            dsDescription.setDatabaseName(ds.getDatabaseName().getStringValue());
+        }
+        
+        if (ds.isSetServerName()) {
+            dsDescription.setServerName(ds.getServerName().getStringValue());
+        }
+        
+        if (ds.isSetPortNumber()) {
+            dsDescription.setPortNumber(ds.getPortNumber().getBigIntegerValue().intValue());
+        }
+                
+        if (ds.isSetLoginTimeout()) {
+            dsDescription.setLoginTimeout(ds.getLoginTimeout().getBigIntegerValue().intValue());      
+        }
+        
+        PropertyType[] props = ds.getPropertyArray();
+        if (props != null) {
+            Map<String, String> properties = new HashMap<String, String>();
+            for (PropertyType prop : props) {
+                properties.put(prop.getName().getStringValue(), prop.getValue().getStringValue());
+            }
+            dsDescription.setProperties(properties);
+        }
+        
+        // transaction properties
+        
+        if (ds.isSetTransactional()) {
+            dsDescription.setTransactional(ds.getTransactional().getBooleanValue());
+        }
+        
+        if (ds.isSetIsolationLevel()) {
+            // dsDefinition.setIsolationLevel(ds.getIsolationLevel().intValue());
+        }
+        
+        // pool properties
+        
+        if (ds.isSetInitialPoolSize()) {
+            dsDescription.setInitialPoolSize(ds.getInitialPoolSize().getBigIntegerValue().intValue());
+        }
+        
+        if (ds.isSetMaxPoolSize()) {
+            dsDescription.setMaxPoolSize(ds.getMaxPoolSize().getBigIntegerValue().intValue());
+        }
+        
+        if (ds.isSetMinPoolSize()) {
+            dsDescription.setMinPoolSize(ds.getMinPoolSize().getBigIntegerValue().intValue());
+        }
+        
+        if (ds.isSetMaxStatements()) {
+            dsDescription.setMaxStatements(ds.getMaxStatements().getBigIntegerValue().intValue());
+        }
+        
+        if (ds.isSetMaxIdleTime()) {
+            dsDescription.setMaxIdleTime(ds.getMaxIdleTime().getBigIntegerValue().intValue());
+        }
+        
+        return dsDescription;
+    }
+    
+    private static String getJndiName(String name) {
+        if (name.startsWith("java:")) {
+            return name;
+        } else {
+            return "java:comp/env/" + name;
+        }
+    }
+    
+    public QNameSet getPlanQNameSet() {
+        return QNameSet.EMPTY; 
+    }
+
+    public QNameSet getSpecQNameSet() {
+        return dataSourceQNameSet;
+    }
+}

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/datasource/deployment/DataSourceBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/connector-1_6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/pom.xml?rev=931583&r1=931582&r2=931583&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/pom.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/pom.xml Wed Apr  7 15:19:18 2010
@@ -55,6 +55,12 @@
     <dependencyManagement>
         <dependencies>
             <dependency>
+                <groupId>org.tranql</groupId>
+                <artifactId>tranql-connector</artifactId>
+                <version>1.6-SNAPSHOT</version>
+            </dependency>
+
+            <dependency>
                 <groupId>org.apache.aries.transaction</groupId>
                 <artifactId>org.apache.aries.transaction.blueprint</artifactId>
                 <version>0.1-incubating-SNAPSHOT</version>

Modified: geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml?rev=931583&r1=931582&r2=931583&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/connector-1_6/transaction-1_6/src/main/history/dependencies.xml Wed Apr  7 15:19:18 2010
@@ -51,4 +51,9 @@
         <artifactId>geronimo-jpa_2.0_spec</artifactId>
         <type>jar</type>
     </dependency>
+    <dependency>
+        <groupId>org.tranql</groupId>
+        <artifactId>tranql-connector</artifactId>
+        <type>jar</type>
+    </dependency>
 </plugin-artifact>



Mime
View raw message