[jboss-cvs] JBossAS SVN: r108696 - in projects/jboss-jca/trunk: common/src/main/java/org/jboss/jca/common/metadata/ds and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 21 11:22:05 EDT 2010


Author: jesper.pedersen
Date: 2010-10-21 11:22:04 -0400 (Thu, 21 Oct 2010)
New Revision: 108696

Modified:
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/DataSource.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/XaDataSource.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceImpl.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XADataSourceImpl.java
   projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd
   projects/jboss-jca/trunk/doc/userguide/en/modules/schemas.xml
Log:
[JBJCA-446] Add module tag to datasource definition

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/DataSource.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/DataSource.java	2010-10-21 13:18:02 UTC (rev 108695)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/DataSource.java	2010-10-21 15:22:04 UTC (rev 108696)
@@ -51,6 +51,11 @@
     */
    public String getDriverClass();
 
+   /**
+    * Get the module
+    * @return The value
+    */
+   public String getModule();
 
    /**
     * Get the connectionProperties.
@@ -124,6 +129,10 @@
       */
       DRIVERCLASS("driver-class"),
       /**
+      * module tag
+      */
+      MODULE("module"),
+      /**
       * transactionIsolation tag
       */
       TRANSACTIONISOLATION("transaction-isolation"),

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/XaDataSource.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/XaDataSource.java	2010-10-21 13:18:02 UTC (rev 108695)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ds/XaDataSource.java	2010-10-21 15:22:04 UTC (rev 108696)
@@ -43,6 +43,11 @@
     */
    public String getXaDataSourceClass();
 
+   /**
+    * Get the module
+    * @return The value
+    */
+   public String getModule();
 
    /**
     * Get the statement.
@@ -110,6 +115,10 @@
       */
       XADATASOURCECLASS("xa-datasource-class"),
       /**
+      * module tag
+      */
+      MODULE("module"),
+      /**
       * transactionIsolation tag
       */
       TRANSACTIONISOLATION("transaction-isolation"),

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceImpl.java	2010-10-21 13:18:02 UTC (rev 108695)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DataSourceImpl.java	2010-10-21 15:22:04 UTC (rev 108696)
@@ -49,6 +49,8 @@
 
    private final String driverClass;
 
+   private final String module;
+
    private final HashMap<String, String> connectionProperties;
 
    private final String newConnectionSql;
@@ -60,6 +62,7 @@
     *
     * @param connectionUrl connectionUrl
     * @param driverClass driverClass
+    * @param module module
     * @param transactionIsolation transactionIsolation
     * @param connectionProperties connectionProperties
     * @param timeOut timeOut
@@ -75,15 +78,18 @@
     * @param jndiName jndiName
     * @param pool pool
     */
-   public DataSourceImpl(String connectionUrl, String driverClass, TransactionIsolation transactionIsolation,
-      Map<String, String> connectionProperties, TimeOut timeOut, CommonSecurity security, Statement statement,
-      Validation validation, String urlDelimiter, String urlSelectorStrategyClassName, String newConnectionSql,
-      boolean useJavaContext, String poolName, boolean enabled, String jndiName, CommonPool pool)
+   public DataSourceImpl(String connectionUrl, String driverClass, String module,
+                         TransactionIsolation transactionIsolation,
+                         Map<String, String> connectionProperties, TimeOut timeOut, CommonSecurity security, 
+                         Statement statement, Validation validation, String urlDelimiter, 
+                         String urlSelectorStrategyClassName, String newConnectionSql,
+                         boolean useJavaContext, String poolName, boolean enabled, String jndiName, CommonPool pool)
    {
       super(transactionIsolation, timeOut, security, statement, validation, urlDelimiter,
             urlSelectorStrategyClassName, useJavaContext, poolName, enabled, jndiName);
       this.connectionUrl = connectionUrl;
       this.driverClass = driverClass;
+      this.module = module;
       if (connectionProperties != null)
       {
          this.connectionProperties = new HashMap<String, String>(connectionProperties.size());
@@ -121,6 +127,17 @@
    }
 
    /**
+    * Get the module.
+    *
+    * @return the module.
+    */
+   @Override
+   public final String getModule()
+   {
+      return module;
+   }
+
+   /**
     * Get the connectionProperties.
     *
     * @return the connectionProperties.
@@ -194,6 +211,7 @@
       result = prime * result + ((connectionProperties == null) ? 0 : connectionProperties.hashCode());
       result = prime * result + ((connectionUrl == null) ? 0 : connectionUrl.hashCode());
       result = prime * result + ((driverClass == null) ? 0 : driverClass.hashCode());
+      result = prime * result + ((module == null) ? 0 : module.hashCode());
       result = prime * result + ((newConnectionSql == null) ? 0 : newConnectionSql.hashCode());
       result = prime * result + ((pool == null) ? 0 : pool.hashCode());
       return result;
@@ -230,6 +248,13 @@
       }
       else if (!driverClass.equals(other.driverClass))
          return false;
+      if (module == null)
+      {
+         if (other.module != null)
+            return false;
+      }
+      else if (!module.equals(other.module))
+         return false;
       if (newConnectionSql == null)
       {
          if (other.newConnectionSql != null)
@@ -251,14 +276,12 @@
    public String toString()
    {
       return "DataSourceImpl [connectionUrl=" + connectionUrl + ", driverClass=" + driverClass +
-             ", connectionProperties=" + connectionProperties + ", newConnectionSql=" + newConnectionSql +
-             ", pool=" + pool + ", transactionIsolation=" + transactionIsolation + ", timeOut=" + timeOut +
-             ", security=" + security + ", statement=" + statement + ", validation=" + validation +
-             ", urlDelimiter=" + urlDelimiter + ", urlSelectorStrategyClassName=" + urlSelectorStrategyClassName +
-             ", useJavaContext=" + useJavaContext + ", poolName=" + poolName + ", enabled=" + enabled +
-             ", jndiName=" + jndiName + "]";
+         ", module=" + module +
+         ", connectionProperties=" + connectionProperties + ", newConnectionSql=" + newConnectionSql +
+         ", pool=" + pool + ", transactionIsolation=" + transactionIsolation + ", timeOut=" + timeOut +
+         ", security=" + security + ", statement=" + statement + ", validation=" + validation +
+         ", urlDelimiter=" + urlDelimiter + ", urlSelectorStrategyClassName=" + urlSelectorStrategyClassName +
+         ", useJavaContext=" + useJavaContext + ", poolName=" + poolName + ", enabled=" + enabled +
+         ", jndiName=" + jndiName + "]";
    }
-
-
-
 }

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java	2010-10-21 13:18:02 UTC (rev 108695)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java	2010-10-21 15:22:04 UTC (rev 108696)
@@ -182,6 +182,7 @@
       CommonXaPool xaPool = null;
 
       String xaDataSourceClass = null;
+      String module = null;
 
       //attributes reading
 
@@ -227,8 +228,8 @@
                   return new XADataSourceImpl(transactionIsolation, timeOutSettings, securitySettings,
                                               statementSettings, validationSettings, urlDelimiter,
                                               urlSelectorStrategyClassName, useJavaContext, poolName, enabled,
-                                              jndiName, xaDataSourceProperty, xaDataSourceClass, newConnectionSql,
-                                              xaPool);
+                                              jndiName, xaDataSourceProperty, xaDataSourceClass, module, 
+                                              newConnectionSql, xaPool);
                }
                else
                {
@@ -250,6 +251,10 @@
                      xaDataSourceClass = elementAsString(reader);
                      break;
                   }
+                  case MODULE : {
+                     module = elementAsString(reader);
+                     break;
+                  }
                   case XA_POOL : {
                      xaPool = parseXaPool(reader);
                      break;
@@ -303,6 +308,7 @@
       boolean prefill = false;
       String connectionUrl = null;
       String driverClass = null;
+      String module = null;
       TransactionIsolation transactionIsolation = null;
       Map<String, String> connectionProperties = new HashMap<String, String>();
       TimeOut timeOutSettings = null;
@@ -354,8 +360,9 @@
                if (DataSources.Tag.forName(reader.getLocalName()) == DataSources.Tag.DATASOURCE)
                {
 
-                  return new DataSourceImpl(connectionUrl, driverClass, transactionIsolation, connectionProperties,
-                                            timeOutSettings, securitySettings, statementSettings, validationSettings,
+                  return new DataSourceImpl(connectionUrl, driverClass, module, transactionIsolation, 
+                                            connectionProperties, timeOutSettings, securitySettings, 
+                                            statementSettings, validationSettings,
                                             urlDelimiter, urlSelectorStrategyClassName, newConnectionSql,
                                             useJavaContext, poolName, enabled, jndiName, pool);
                }
@@ -383,6 +390,10 @@
                      driverClass = elementAsString(reader);
                      break;
                   }
+                  case MODULE : {
+                     module = elementAsString(reader);
+                     break;
+                  }
                   case POOL : {
                      pool = parsePool(reader);
                      break;

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XADataSourceImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XADataSourceImpl.java	2010-10-21 13:18:02 UTC (rev 108695)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/XADataSourceImpl.java	2010-10-21 15:22:04 UTC (rev 108696)
@@ -49,6 +49,8 @@
 
    private final String xaDataSourceClass;
 
+   private final String module;
+
    private final String newConnectionSql;
 
    private final CommonXaPool xaPool;
@@ -69,13 +71,14 @@
     * @param jndiName jndiName
     * @param xaDataSourceProperty xaDataSourceProperty
     * @param xaDataSourceClass xaDataSourceClass
+    * @param module module
     * @param newConnectionSql newConnectionSql
     * @param xaPool xaPool
     */
    public XADataSourceImpl(TransactionIsolation transactionIsolation, TimeOut timeOut, CommonSecurity security,
       Statement statement, Validation validation, String urlDelimiter, String urlSelectorStrategyClassName,
       boolean useJavaContext, String poolName, boolean enabled, String jndiName,
-      Map<String, String> xaDataSourceProperty, String xaDataSourceClass, String newConnectionSql,
+      Map<String, String> xaDataSourceProperty, String xaDataSourceClass, String module, String newConnectionSql,
       CommonXaPool xaPool)
    {
       super(transactionIsolation, timeOut, security, statement, validation, urlDelimiter,
@@ -90,15 +93,16 @@
          this.xaDataSourceProperty = new HashMap<String, String>(0);
       }
       this.xaDataSourceClass = xaDataSourceClass;
+      this.module = module;
       this.newConnectionSql = newConnectionSql;
       this.xaPool = xaPool;
    }
 
    /**
-   * Get the xaDataSourceClass.
-   *
-   * @return the xaDataSourceClass.
-   */
+    * Get the xaDataSourceClass.
+    *
+    * @return the xaDataSourceClass.
+    */
    @Override
    public final String getXaDataSourceClass()
    {
@@ -106,6 +110,17 @@
    }
 
    /**
+    * Get the module.
+    *
+    * @return the module.
+    */
+   @Override
+   public final String getModule()
+   {
+      return module;
+   }
+
+   /**
     * Get the statement.
     *
     * @return the statement.
@@ -156,6 +171,7 @@
       int result = 1;
       result = prime * result + ((newConnectionSql == null) ? 0 : newConnectionSql.hashCode());
       result = prime * result + ((xaDataSourceClass == null) ? 0 : xaDataSourceClass.hashCode());
+      result = prime * result + ((module == null) ? 0 : module.hashCode());
       result = prime * result + ((xaDataSourceProperty == null) ? 0 : xaDataSourceProperty.hashCode());
       result = prime * result + ((xaPool == null) ? 0 : xaPool.hashCode());
       return result;
@@ -185,6 +201,13 @@
       }
       else if (!xaDataSourceClass.equals(other.xaDataSourceClass))
          return false;
+      if (module == null)
+      {
+         if (other.module != null)
+            return false;
+      }
+      else if (!module.equals(other.module))
+         return false;
       if (xaDataSourceProperty == null)
       {
          if (other.xaDataSourceProperty != null)
@@ -206,7 +229,8 @@
    public String toString()
    {
       return "XADataSourceImpl [xaDataSourceProperty=" + xaDataSourceProperty + ", xaDataSourceClass=" +
-             xaDataSourceClass + ", newConnectionSql=" + newConnectionSql + ", xaPool=" + xaPool +
+             xaDataSourceClass + ", module=" +
+             module + ", newConnectionSql=" + newConnectionSql + ", xaPool=" + xaPool +
              ", transactionIsolation=" + transactionIsolation + ", timeOut=" + timeOut + ", security=" + security +
              ", statement=" + statement + ", validation=" + validation + ", urlDelimiter=" + urlDelimiter +
              ", urlSelectorStrategyClassName=" + urlSelectorStrategyClassName + ", useJavaContext=" +

Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd	2010-10-21 13:18:02 UTC (rev 108695)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd	2010-10-21 15:22:04 UTC (rev 108696)
@@ -55,6 +55,15 @@
           </xs:documentation>
         </xs:annotation>
       </xs:element>
+      <xs:element name="module" type="xs:token" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            <![CDATA[[
+              An unique reference to the classloader module which contains the JDBC driver
+             ]]>
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
       <xs:element name="connection-property" type="connection-propertyType" minOccurs="0" maxOccurs="unbounded">
         <xs:annotation>
           <xs:documentation>
@@ -188,6 +197,15 @@
           </xs:documentation>
         </xs:annotation>
       </xs:element>
+      <xs:element name="module" type="xs:token" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            <![CDATA[[
+              A unique reference to the classloader module which contains the JDBC driver
+             ]]>
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
       <xs:element name="url-delimiter" type="xs:token" minOccurs="0">
         <xs:annotation>
           <xs:documentation>

Modified: projects/jboss-jca/trunk/doc/userguide/en/modules/schemas.xml
===================================================================
--- projects/jboss-jca/trunk/doc/userguide/en/modules/schemas.xml	2010-10-21 13:18:02 UTC (rev 108695)
+++ projects/jboss-jca/trunk/doc/userguide/en/modules/schemas.xml	2010-10-21 15:22:04 UTC (rev 108696)
@@ -2825,7 +2825,7 @@
         </xs:documentation>
       </xs:annotation>
     </xs:attribute>
-    <xs:attribute default="false" name="use-java-context" type="xs:boolean">
+    <xs:attribute default="true" name="use-java-context" type="xs:boolean">
       <xs:annotation>
         <xs:documentation>
           Specifies if a global JNDI context should be used 
@@ -3270,7 +3270,7 @@
         </xs:documentation>
       </xs:annotation>
     </xs:attribute>
-    <xs:attribute default="false" name="use-java-context" type="xs:boolean">
+    <xs:attribute default="true" name="use-java-context" type="xs:boolean">
       <xs:annotation>
         <xs:documentation>
           Specifies if a global JNDI context should be used 
@@ -3654,6 +3654,13 @@
           </xs:documentation>
         </xs:annotation>
       </xs:element>
+      <xs:element name="module" type="xs:token" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            An unique reference to the classloader module which contains the JDBC driver
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
       <xs:element name="connection-property" type="connection-propertyType" minOccurs="0" maxOccurs="unbounded">
         <xs:annotation>
           <xs:documentation>
@@ -3763,6 +3770,13 @@
           </xs:documentation>
         </xs:annotation>
       </xs:element>
+      <xs:element name="module" type="xs:token" minOccurs="0">
+        <xs:annotation>
+          <xs:documentation>
+            An unique reference to the classloader module which contains the JDBC driver
+          </xs:documentation>
+        </xs:annotation>
+      </xs:element>
       <xs:element name="url-delimiter" type="xs:token" minOccurs="0">
         <xs:annotation>
           <xs:documentation>
@@ -3883,7 +3897,7 @@
         </xs:documentation>
       </xs:annotation>
     </xs:attribute>
-    <xs:attribute default="false" name="use-java-context" type="xs:boolean">
+    <xs:attribute default="true" name="use-java-context" type="xs:boolean">
       <xs:annotation>
         <xs:documentation>
           Setting this to false will bind the DataSource into global jndi



More information about the jboss-cvs-commits mailing list