[jboss-cvs] JBossAS SVN: r108033 - in projects/jboss-jca/trunk/common/src/main: java/org/jboss/jca/common/metadata/resourceadapter and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 8 01:37:37 EDT 2010


Author: maeste
Date: 2010-09-08 01:37:36 -0400 (Wed, 08 Sep 2010)
New Revision: 108033

Modified:
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapter.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterImpl.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParser.java
   projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapter_1_0.xsd
Log:
JBJCA-401 adding bean-validatio-groups and bootstrap-context

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapter.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapter.java	2010-09-08 05:14:23 UTC (rev 108032)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/resourceadapter/ResourceAdapter.java	2010-09-08 05:37:36 UTC (rev 108033)
@@ -73,6 +73,20 @@
    public Map<String, String> getConfigProperties();
 
    /**
+    * Get the beanValidationGroups.
+    *
+    * @return the beanValidationGroups.
+    */
+   public List<String> getBeanValidationGroups();
+
+   /**
+    * Get the bootstrapContext.
+    *
+    * @return the bootstrapContext.
+    */
+   public String getBootstrapContext();
+
+   /**
    *
    * A Tag.
    *
@@ -97,6 +111,21 @@
       ARCHIVE("archive"),
 
       /**
+       * bean-validation-groups tag
+       */
+      BEAN_VALIDATION_GROUPS("bean-validation-groups"),
+
+      /**
+       * bean-validation-group tag
+       */
+      BEAN_VALIDATION_GROUP("bean-validation-group"),
+
+      /**
+       * bootstrap-context tag
+       */
+      BOOTSTRAP_CONTEXT("bootstrap-context"),
+
+      /**
        * transaction-support tag
        */
       TRANSACTION_SUPPORT("transaction-support"),
@@ -104,15 +133,15 @@
        * connection-definitions tag
        */
       CONNECTION_DEFINITIONS("connection-definitions"),
+      /**
+       * connection-definition tag
+       */
+      CONNECTION_DEFINITION("connection-definition"),
 
       /**
        * admin-objects tag
        */
       ADMIN_OBJECTS("admin-objects"),
-      /**
-      * connection-definition tag
-      */
-     CONNECTION_DEFINITION("connection-definition"),
 
      /**
       * admin-objects tag

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterImpl.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterImpl.java	2010-09-08 05:14:23 UTC (rev 108032)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterImpl.java	2010-09-08 05:37:36 UTC (rev 108033)
@@ -52,6 +52,10 @@
 
    private final ArrayList<ConnectionDefinition> connectionDefinitions;
 
+   private final ArrayList<String> beanValidationGroups;
+
+   private final String bootstrapContext;
+
    /**
     *
     * Create a new ResourceAdapterImpl.
@@ -61,10 +65,12 @@
     * @param connectionDefinitions connectionDefinitions
     * @param adminObjects adminObjects
     * @param configProperties configProperties
+    * @param beanValidationGroups beanValidationGroups
+    * @param bootstrapContext bootstrapContext
     */
    public ResourceAdapterImpl(String archive, TransactionSupportEnum transactionSupport,
       List<ConnectionDefinition> connectionDefinitions, List<AdminObject> adminObjects,
-      Map<String, String> configProperties)
+      Map<String, String> configProperties, List<String> beanValidationGroups, String bootstrapContext)
    {
       super();
       this.archive = archive;
@@ -97,6 +103,16 @@
       {
          this.configProperties = new HashMap<String, String>(0);
       }
+      if (beanValidationGroups != null)
+      {
+         this.beanValidationGroups = new ArrayList<String>(beanValidationGroups.size());
+         this.beanValidationGroups.addAll(beanValidationGroups);
+      }
+      else
+      {
+         this.beanValidationGroups = new ArrayList<String>(0);
+      }
+      this.bootstrapContext = bootstrapContext;
 
    }
 
@@ -154,5 +170,108 @@
    {
       return Collections.unmodifiableMap(configProperties);
    }
+
+   /**
+    * Get the beanValidationGroups.
+    *
+    * @return the beanValidationGroups.
+    */
+   @Override
+   public final List<String> getBeanValidationGroups()
+   {
+      return Collections.unmodifiableList(beanValidationGroups);
+   }
+
+   /**
+    * Get the bootstrapContext.
+    *
+    * @return the bootstrapContext.
+    */
+   @Override
+   public final String getBootstrapContext()
+   {
+      return bootstrapContext;
+   }
+
+   @Override
+   public int hashCode()
+   {
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + ((adminObjects == null) ? 0 : adminObjects.hashCode());
+      result = prime * result + ((archive == null) ? 0 : archive.hashCode());
+      result = prime * result + ((beanValidationGroups == null) ? 0 : beanValidationGroups.hashCode());
+      result = prime * result + ((bootstrapContext == null) ? 0 : bootstrapContext.hashCode());
+      result = prime * result + ((configProperties == null) ? 0 : configProperties.hashCode());
+      result = prime * result + ((connectionDefinitions == null) ? 0 : connectionDefinitions.hashCode());
+      result = prime * result + ((transactionSupport == null) ? 0 : transactionSupport.hashCode());
+      return result;
+   }
+
+   @Override
+   public boolean equals(Object obj)
+   {
+      if (this == obj)
+         return true;
+      if (obj == null)
+         return false;
+      if (!(obj instanceof ResourceAdapterImpl))
+         return false;
+      ResourceAdapterImpl other = (ResourceAdapterImpl) obj;
+      if (adminObjects == null)
+      {
+         if (other.adminObjects != null)
+            return false;
+      }
+      else if (!adminObjects.equals(other.adminObjects))
+         return false;
+      if (archive == null)
+      {
+         if (other.archive != null)
+            return false;
+      }
+      else if (!archive.equals(other.archive))
+         return false;
+      if (beanValidationGroups == null)
+      {
+         if (other.beanValidationGroups != null)
+            return false;
+      }
+      else if (!beanValidationGroups.equals(other.beanValidationGroups))
+         return false;
+      if (bootstrapContext == null)
+      {
+         if (other.bootstrapContext != null)
+            return false;
+      }
+      else if (!bootstrapContext.equals(other.bootstrapContext))
+         return false;
+      if (configProperties == null)
+      {
+         if (other.configProperties != null)
+            return false;
+      }
+      else if (!configProperties.equals(other.configProperties))
+         return false;
+      if (connectionDefinitions == null)
+      {
+         if (other.connectionDefinitions != null)
+            return false;
+      }
+      else if (!connectionDefinitions.equals(other.connectionDefinitions))
+         return false;
+      if (transactionSupport != other.transactionSupport)
+         return false;
+      return true;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "ResourceAdapterImpl [archive=" + archive + ", transactionSupport=" + transactionSupport +
+             ", configProperties=" + configProperties + ", adminObjects=" + adminObjects +
+             ", connectionDefinitions=" + connectionDefinitions + ", beanValidationGroups=" +
+             beanValidationGroups + ", bootstrapContext=" + bootstrapContext + "]";
+   }
 }
 

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParser.java	2010-09-08 05:14:23 UTC (rev 108032)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/resourceadapter/ResourceAdapterParser.java	2010-09-08 05:37:36 UTC (rev 108033)
@@ -159,6 +159,8 @@
    {
       ArrayList<ConnectionDefinition> connectionDefinitions = new ArrayList<ConnectionDefinition>();
       ArrayList<AdminObject> adminObjects = new ArrayList<AdminObject>();
+      ArrayList<String> beanValidationGroups = new ArrayList<String>();
+      String bootstrapContext = null;
       String archive = null;
       TransactionSupportEnum transactionSupport = null;
       HashMap<String, String> configProperties = new HashMap<String, String>();
@@ -170,7 +172,7 @@
                if (ResourceAdapters.Tag.forName(reader.getLocalName()) == ResourceAdapters.Tag.RESOURCE_ADPTER)
                {
                   return new ResourceAdapterImpl(archive, transactionSupport, connectionDefinitions, adminObjects,
-                                                 configProperties);
+                                                 configProperties, beanValidationGroups, bootstrapContext);
                }
                else
                {
@@ -185,8 +187,9 @@
                switch (ResourceAdapter.Tag.forName(reader.getLocalName()))
                {
                   case ADMIN_OBJECTS :
-                  case CONNECTION_DEFINITIONS : {
-                     //ignore it, we will parse single admin_object and connection_definition directly
+                  case CONNECTION_DEFINITIONS :
+                  case BEAN_VALIDATION_GROUPS : {
+                     //ignore it,we will parse bean-validation-group,admin_object and connection_definition directly
                      break;
                   }
                   case ADMIN_OBJECT : {
@@ -198,6 +201,14 @@
                      connectionDefinitions.add(parseConnectionDefinitions(reader));
                      break;
                   }
+                  case BEAN_VALIDATION_GROUP : {
+                     beanValidationGroups.add(elementAsString(reader));
+                     break;
+                  }
+                  case BOOTSTRAP_CONTEXT : {
+                     bootstrapContext = elementAsString(reader);
+                     break;
+                  }
                   case CONFIG_PROPERTY : {
                      configProperties.put(attributeAsString(reader, "name"), elementAsString(reader));
                      break;

Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapter_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapter_1_0.xsd	2010-09-08 05:14:23 UTC (rev 108032)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapter_1_0.xsd	2010-09-08 05:37:36 UTC (rev 108033)
@@ -21,10 +21,12 @@
           </xs:documentation>
         </xs:annotation>
       </xs:element>
+      <xs:element name="bean-validation-groups" type="bean-validation-groupsType" minOccurs="0" maxOccurs="1"></xs:element>
+      <xs:element name="bootstrap-context" type="xs:token" minOccurs="0" maxOccurs="1"></xs:element>
       <xs:element name="transaction-support" type="transaction-supportType" minOccurs="0"></xs:element>
       <xs:element name="connection-definitions" type="connection-definitionsType" minOccurs="0" maxOccurs="1"></xs:element>
-            <xs:element name="admin-objects" type="admin-objectsType" minOccurs="0" maxOccurs="1"></xs:element>
-        </xs:sequence>
+      <xs:element name="admin-objects" type="admin-objectsType" minOccurs="0" maxOccurs="1"></xs:element>
+    </xs:sequence>
   </xs:complexType>
   <xs:simpleType name="transaction-supportType">
     <xs:annotation>
@@ -264,4 +266,10 @@
   <xs:complexType name="admin-objectsType">
     <xs:sequence><xs:element name="admin-object" type="admin-objectType" minOccurs="0" maxOccurs="unbounded"></xs:element></xs:sequence>
   </xs:complexType>
+
+  <xs:complexType name="bean-validation-groupsType">
+    <xs:sequence>
+      <xs:element name="bean-validation-group" type="xs:token" minOccurs="1" maxOccurs="unbounded"></xs:element>
+    </xs:sequence>
+  </xs:complexType>
 </xs:schema>
\ No newline at end of file



More information about the jboss-cvs-commits mailing list