[jboss-cvs] JBossAS SVN: r106784 - in projects/jboss-jca/trunk/common/src/main: java/org/jboss/jca/common/metadata/jbossra and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jul 16 11:40:47 EDT 2010


Author: maeste
Date: 2010-07-16 11:40:46 -0400 (Fri, 16 Jul 2010)
New Revision: 106784

Added:
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataParser.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRa.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/package.html
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/package.html
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java
   projects/jboss-jca/trunk/common/src/main/resources/schema/jboss-ra_1_0.xsd
Removed:
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa.java
Modified:
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/RaConfigProperty.java
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/package.html
   projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/Connector.java
Log:
JBJCA-385: a bit of refactoring, adding jboss-ra_1_0 support, initial object hierarchy design for parser and metadataFactory

Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jca.common.metadata;
+
+import org.jboss.jca.common.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.metadata.jbossra.JbossRaParser;
+import org.jboss.jca.common.metadata.ra.Connector;
+import org.jboss.jca.common.metadata.ra.RaParser;
+
+import java.io.File;
+
+import org.jboss.logging.Logger;
+
+/**
+ * The metadata processor for JCA 1.x
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @author <a href="mailto:jeff.zhang at redhat.com">Jeff Zhang</a>
+ */
+public class MetadataFactory
+{
+   private static Logger log = Logger.getLogger(MetadataFactory.class);
+
+   /**
+    * Constructor
+    */
+   public MetadataFactory()
+   {
+   }
+
+   /**
+    * Get the JCA standard metadata
+    * @param root The root of the deployment
+    * @return The metadata
+    * @exception Exception Thrown if an error occurs
+    */
+   public Connector getStandardMetaData(File root) throws Exception
+   {
+      Connector result = null;
+      File metadataFile = new File(root, "/META-INF/ra.xml");
+
+      if (metadataFile.exists())
+      {
+         String url = metadataFile.getAbsolutePath();
+         try
+         {
+            long start = System.currentTimeMillis();
+
+            result = (new RaParser()).parse(metadataFile);
+
+            log.debugf("Total parse for %s took %d ms", url, (System.currentTimeMillis() - start));
+
+            log.tracef("successufully deployed $s", result.toString());
+
+         }
+         catch (Exception e)
+         {
+            log.errorf(e, "Error during parsing: %s", url);
+            throw e;
+         }
+      }
+
+      return result;
+   }
+
+   /**
+    * Get the JBoss specific metadata
+    * @param root The root of the deployment
+    * @return The metadata
+    * @exception Exception Thrown if an error occurs
+    */
+   public JbossRa getJBossMetaData(File root) throws Exception
+   {
+      JbossRa result = null;
+
+      File metadataFile = new File(root, "/META-INF/jboss-ra.xml");
+
+      if (metadataFile.exists())
+      {
+         String url = metadataFile.getAbsolutePath();
+         try
+         {
+            long start = System.currentTimeMillis();
+
+            result = (new JbossRaParser()).parse(metadataFile);
+
+            log.debugf("Total parse for $s took %d ms", url, (System.currentTimeMillis() - start));
+
+            log.tracef("successufully deployed $s", result.toString());
+         }
+         catch (Exception e)
+         {
+            log.error("Error during parsing: " + url, e);
+            throw e;
+         }
+      }
+
+      return result;
+   }
+
+}

Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataParser.java	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataParser.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,22 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.jca.common.metadata;
+
+import java.io.File;
+
+public interface MetadataParser<T extends JCAMetadata>
+{
+
+   /**
+    * Get the JCAMetaData for the file parser is designed
+    * @param xmlFile The xml file to parse
+    * @return The metadata
+    * @exception Exception Thrown if an error occurs
+    */
+   public T parse(File xmlFile) throws Exception;
+
+}

Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRa.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRa.java	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRa.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.jca.common.metadata.jbossra;
+
+import org.jboss.jca.common.metadata.JCAMetadata;
+import org.jboss.jca.common.metadata.jbossra.jbossra20.RaConfigProperty;
+
+import java.util.Collections;
+import java.util.List;
+
+public abstract class JbossRa implements JCAMetadata
+{
+
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 1L;
+   private final List<RaConfigProperty<?>> raConfigProperties;
+
+
+   protected JbossRa(List<RaConfigProperty<?>> raConfigProperties) {
+      this.raConfigProperties = raConfigProperties;
+   }
+
+   /**
+    * @return raConfigProperties
+    */
+   public List<RaConfigProperty<?>> getRaConfigProperties()
+   {
+      return Collections.unmodifiableList(raConfigProperties);
+   }
+
+   @Override
+   public int hashCode()
+   {
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + ((raConfigProperties == null) ? 0 : raConfigProperties.hashCode());
+      return result;
+   }
+
+   @Override
+   public boolean equals(Object obj)
+   {
+      if (this == obj)
+         return true;
+      if (obj == null)
+         return false;
+      if (!(obj instanceof JbossRa))
+         return false;
+      JbossRa other = (JbossRa) obj;
+      if (raConfigProperties == null)
+      {
+         if (other.raConfigProperties != null)
+            return false;
+      }
+      else if (!raConfigProperties.equals(other.raConfigProperties))
+         return false;
+      return true;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "JbossRa [raConfigProperties=" + raConfigProperties + "]";
+   }
+
+}
\ No newline at end of file

Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,23 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.jca.common.metadata.jbossra;
+
+import org.jboss.jca.common.metadata.JCAMetadata;
+import org.jboss.jca.common.metadata.MetadataParser;
+
+import java.io.File;
+
+public class JbossRaParser implements MetadataParser<JbossRa>
+{
+
+   @Override
+   public JbossRa parse(File xmlFile) throws Exception
+   {
+      return null;
+   }
+
+}

Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10.java	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.jca.common.metadata.jbossra.jbossra10;
+
+import org.jboss.jca.common.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.metadata.jbossra.jbossra20.RaConfigProperty;
+
+import java.util.List;
+
+public class JbossRa10 extends JbossRa
+{
+
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 1L;
+
+   public JbossRa10(List<RaConfigProperty<?>> raConfigProperties)
+   {
+      super(raConfigProperties);
+   }
+
+   @Override
+   public String toString()
+   {
+      return "JbossRa10 [getRaConfigProperties()=" + getRaConfigProperties() + "]";
+   }
+
+}

Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/package.html
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/package.html	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,3 @@
+<body>
+This package contains metadatas for jboss-ra_1_0.xsd 
+</body>

Deleted: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa.java	2010-07-16 15:38:54 UTC (rev 106783)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.jca.common.metadata.jbossra.jbossra20;
-
-import org.jboss.jca.common.metadata.JCAMetadata;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
- */
-public class JbossRa implements JCAMetadata
-{
-
-   /**
-    */
-   private static final long serialVersionUID = -1494921311038998843L;
-
-   private final List<RaConfigProperty<?>> raConfigProperties;
-
-   private final String bootstrapContext;
-
-   private final List<BeanValidationGroups> beanValidationGroups;
-
-   /**
-    * @param raConfigProperties List of properties for configuration
-    * @param bootstrapContext String representing the bootstrap context name
-    * @param beanValidationGroups for validations
-    */
-   public JbossRa(List<RaConfigProperty<?>> raConfigProperties, String bootstrapContext,
-         List<BeanValidationGroups> beanValidationGroups)
-   {
-      super();
-      this.raConfigProperties = raConfigProperties;
-      this.bootstrapContext = bootstrapContext;
-      this.beanValidationGroups = beanValidationGroups;
-   }
-
-   /**
-    * @return raConfigProperties
-    */
-   public List<RaConfigProperty<?>> getRaConfigProperties()
-   {
-      return Collections.unmodifiableList(raConfigProperties);
-   }
-
-   /**
-    * @return bootstrapContext
-    */
-   public String getBootstrapContext()
-   {
-      return bootstrapContext;
-   }
-
-   /**
-    * @return beanValidationGroups
-    */
-   public List<BeanValidationGroups> getBeanValidationGroups()
-   {
-      return Collections.unmodifiableList(beanValidationGroups);
-   }
-
-   /**
-    * {@inheritDoc}
-    *
-    * @see java.lang.Object#hashCode()
-    */
-   @Override
-   public int hashCode()
-   {
-      final int prime = 31;
-      int result = 1;
-      result = prime * result + ((beanValidationGroups == null) ? 0 : beanValidationGroups.hashCode());
-      result = prime * result + ((bootstrapContext == null) ? 0 : bootstrapContext.hashCode());
-      result = prime * result + ((raConfigProperties == null) ? 0 : raConfigProperties.hashCode());
-      return result;
-   }
-
-   /**
-    * {@inheritDoc}
-    *
-    * @see java.lang.Object#equals(java.lang.Object)
-    */
-   @Override
-   public boolean equals(Object obj)
-   {
-      if (this == obj)
-         return true;
-      if (obj == null)
-         return false;
-      if (!(obj instanceof JbossRa))
-         return false;
-      JbossRa other = (JbossRa) obj;
-      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 (raConfigProperties == null)
-      {
-         if (other.raConfigProperties != null)
-            return false;
-      }
-      else if (!raConfigProperties.equals(other.raConfigProperties))
-         return false;
-      return true;
-   }
-
-}

Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20.java (from rev 106783, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20.java	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.jca.common.metadata.jbossra.jbossra20;
+
+import org.jboss.jca.common.metadata.jbossra.JbossRa;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ */
+public class JbossRa20 extends JbossRa
+{
+
+   /**
+    */
+   private static final long serialVersionUID = -1494921311038998843L;
+
+   private final String bootstrapContext;
+
+   private final List<BeanValidationGroups> beanValidationGroups;
+
+   /**
+    * @param raConfigProperties List of properties for configuration
+    * @param bootstrapContext String representing the bootstrap context name
+    * @param beanValidationGroups for validations
+    */
+   public JbossRa20(List<RaConfigProperty<?>> raConfigProperties, String bootstrapContext,
+         List<BeanValidationGroups> beanValidationGroups)
+   {
+      super(raConfigProperties);
+      this.bootstrapContext = bootstrapContext;
+      this.beanValidationGroups = beanValidationGroups;
+   }
+
+   /**
+    * @return bootstrapContext
+    */
+   public String getBootstrapContext()
+   {
+      return bootstrapContext;
+   }
+
+   /**
+    * @return beanValidationGroups
+    */
+   public List<BeanValidationGroups> getBeanValidationGroups()
+   {
+      return Collections.unmodifiableList(beanValidationGroups);
+   }
+
+   /**
+    * {@inheritDoc}
+    *
+    * @see java.lang.Object#hashCode()
+    */
+   @Override
+   public int hashCode()
+   {
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + ((beanValidationGroups == null) ? 0 : beanValidationGroups.hashCode());
+      result = prime * result + ((bootstrapContext == null) ? 0 : bootstrapContext.hashCode());
+      result = prime * result + ((getRaConfigProperties() == null) ? 0 : getRaConfigProperties().hashCode());
+      return result;
+   }
+
+   /**
+    * {@inheritDoc}
+    *
+    * @see java.lang.Object#equals(java.lang.Object)
+    */
+   @Override
+   public boolean equals(Object obj)
+   {
+      if (this == obj)
+         return true;
+      if (obj == null)
+         return false;
+      if (!(obj instanceof JbossRa20))
+         return false;
+      JbossRa20 other = (JbossRa20) obj;
+      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 (getRaConfigProperties() == null)
+      {
+         if (other.getRaConfigProperties() != null)
+            return false;
+      }
+      else if (!getRaConfigProperties().equals(other.getRaConfigProperties()))
+         return false;
+      return true;
+   }
+
+}

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/RaConfigProperty.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/RaConfigProperty.java	2010-07-16 15:38:54 UTC (rev 106783)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/RaConfigProperty.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -40,18 +40,35 @@
 
    private final T value;
 
+   private final String typeName;
+
    /**
     * @param name the name of the property
     * @param value the value of the property
     */
-   public RaConfigProperty(String name, T value)
+   private RaConfigProperty(String name, T value)
    {
       super();
       this.name = name;
       this.value = value;
+      this.typeName = value.getClass().getName();
    }
 
    /**
+    * @param name the name of the property
+    * @param value the value of the property
+    * @param typeName full qualified name of value's type
+    */
+   private RaConfigProperty(String name, T value, String type)
+   {
+      super();
+      this.name = name;
+      this.value = value;
+      this.typeName = value.getClass().getName();
+   }
+
+
+   /**
     *
     * Static method to build actualised implementation of this generic class.
     * According to jboss-ra_2_0.xsd value values are:
@@ -65,7 +82,13 @@
     *   java.lang.Float
     *   java.lang.Character
     *
+    *   In case passed type is one of above ones a correct actualised {@link RaConfigProperty} is returned.
+    *   TypeName field will be set accordly
     *
+    *   In case the passed type isn't one of above ones (possible for jboss-ra_1_0.xsd) an RaConfigProperty<Object>
+    *   is returned and typeName will be set as passed parameter type.
+    *
+    *
     * @param name name of the property
     * @param value value of the property.
     * @param type the full qualified name of the class to be actualised
@@ -73,7 +96,7 @@
     * @throws NumberFormatException in case passed value isn't assignable to type class
     */
    public static RaConfigProperty<?> buildRaConfigProperty(String name, String value, String type)
-      throws NumberFormatException
+         throws NumberFormatException
    {
       if (type == null || type.trim().length() == 0)
       {
@@ -113,7 +136,7 @@
       }
       else
       {
-         return new RaConfigProperty<String>(name, value);
+         return new RaConfigProperty<Object>(name, value, type);
       }
 
    }

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/package.html
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/package.html	2010-07-16 15:38:54 UTC (rev 106783)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/package.html	2010-07-16 15:40:46 UTC (rev 106784)
@@ -1,3 +1,3 @@
 <body>
-This package contains metadatas for jboss-ra.xsd 
+This package contains metadatas for jboss-ra_2_0.xsd 
 </body>

Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/package.html
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/package.html	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,3 @@
+<body>
+This package contains common metadatas fand parser for jboss-ra_2_0.xsd and jboss_ra_10.xsd 
+</body>

Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/Connector.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/Connector.java	2010-07-16 15:38:54 UTC (rev 106783)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/Connector.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -1,12 +1,14 @@
 /*
  * JBoss, the OpenSource J2EE webOS
- * 
+ *
  * Distributable under LGPL license.
  * See terms of license at gnu.org.
  */
 package org.jboss.jca.common.metadata.ra;
 
-public interface Connector
+import org.jboss.jca.common.metadata.JCAMetadata;
+
+public interface Connector extends JCAMetadata
 {
 
 }

Added: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,22 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.jca.common.metadata.ra;
+
+import org.jboss.jca.common.metadata.MetadataParser;
+
+import java.io.File;
+
+public class RaParser implements MetadataParser<Connector>
+{
+
+   @Override
+   public Connector parse(File xmlFile) throws Exception
+   {
+      return null;
+   }
+
+}

Added: projects/jboss-jca/trunk/common/src/main/resources/schema/jboss-ra_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/jboss-ra_1_0.xsd	                        (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/jboss-ra_1_0.xsd	2010-07-16 15:40:46 UTC (rev 106784)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.jboss.org/schema/ra"
+    xmlns:ra="http://www.jboss.org/schema/ra" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+    elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+
+    <xs:import namespace="http://java.sun.com/xml/ns/j2ee" schemaLocation="http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd"/>
+
+    <xs:element name="jboss-ra" type="ra:jbossRaType"/>                              
+    
+    <xs:complexType name="jbossRaType">           
+        
+        <xs:sequence>
+            <xs:element name="ra-config-property" type="ra:ra-config-property-type" minOccurs="0" maxOccurs="unbounded"/>  
+        </xs:sequence>
+        
+    </xs:complexType>
+    
+    <xs:complexType name="ra-config-property-type">
+
+        <xs:sequence>
+            <xs:element name="ra-config-property-name" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="ra-config-property-type" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="ra-config-property-value" type="xs:string" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>
\ No newline at end of file



More information about the jboss-cvs-commits mailing list