[jboss-cvs] JBossAS SVN: r107383 - in projects/jboss-jca/trunk: common/src/main/java/org/jboss/jca/common/annotations and 16 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 4 08:58:48 EDT 2010
Author: maeste
Date: 2010-08-04 08:58:46 -0400 (Wed, 04 Aug 2010)
New Revision: 107383
Added:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/JCAMetadata.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MergeUtil.java
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/ParserException.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaAbstractImpl.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/JbossRa10Impl.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/
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/BeanValidationGroupImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20Impl.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/jbossra/package.html
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/package.html
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/
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/common/
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AdminObjectImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AuthenticationMechanismImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConfigPropertyImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectionDefinitionImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/InboundResourceAdapterImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageAdapterImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageListenerImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/OutboundResourceAdapterImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/RaConfigPropertyImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/SecurityPermissionImpl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/package.html
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/package.html
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/ResourceAdapter10Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/package.html
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Activationspec15Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/package.html
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Activationspec16Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/ConfigProperty16Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16Impl.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/package.html
Removed:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/
projects/jboss-jca/trunk/validator/src/test/tmp/
Modified:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/annotations/Annotations.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/jbossra/JbossRa.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/IdDecoratedMetadata.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/LicenseType.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/LocalizedMetadata.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/Path.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra10/package.html
projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/JbossRaParserTestCase.java
projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/RaParserTestCase.java
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validation.java
Log:
JBJCA-385: removing ArrayList and using List whereever is possible. packaging refactoring, remove tmp dir
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/annotations/Annotations.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/annotations/Annotations.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/annotations/Annotations.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -43,18 +43,18 @@
import org.jboss.jca.common.api.metadata.ra.ra16.Activationspec16;
import org.jboss.jca.common.api.metadata.ra.ra16.ConfigProperty16;
import org.jboss.jca.common.api.metadata.ra.ra16.Connector16;
-import org.jboss.jca.common.metadataimpl.ra.common.AdminObjectImpl;
-import org.jboss.jca.common.metadataimpl.ra.common.AuthenticationMechanismImpl;
-import org.jboss.jca.common.metadataimpl.ra.common.ConnectionDefinitionImpl;
-import org.jboss.jca.common.metadataimpl.ra.common.InboundResourceAdapterImpl;
-import org.jboss.jca.common.metadataimpl.ra.common.MessageAdapterImpl;
-import org.jboss.jca.common.metadataimpl.ra.common.MessageListenerImpl;
-import org.jboss.jca.common.metadataimpl.ra.common.OutboundResourceAdapterImpl;
-import org.jboss.jca.common.metadataimpl.ra.common.ResourceAdapter1516Impl;
-import org.jboss.jca.common.metadataimpl.ra.common.SecurityPermissionImpl;
-import org.jboss.jca.common.metadataimpl.ra.ra16.Activationspec16Impl;
-import org.jboss.jca.common.metadataimpl.ra.ra16.ConfigProperty16Impl;
-import org.jboss.jca.common.metadataimpl.ra.ra16.Connector16Impl;
+import org.jboss.jca.common.metadata.ra.common.AdminObjectImpl;
+import org.jboss.jca.common.metadata.ra.common.AuthenticationMechanismImpl;
+import org.jboss.jca.common.metadata.ra.common.ConnectionDefinitionImpl;
+import org.jboss.jca.common.metadata.ra.common.InboundResourceAdapterImpl;
+import org.jboss.jca.common.metadata.ra.common.MessageAdapterImpl;
+import org.jboss.jca.common.metadata.ra.common.MessageListenerImpl;
+import org.jboss.jca.common.metadata.ra.common.OutboundResourceAdapterImpl;
+import org.jboss.jca.common.metadata.ra.common.ResourceAdapter1516Impl;
+import org.jboss.jca.common.metadata.ra.common.SecurityPermissionImpl;
+import org.jboss.jca.common.metadata.ra.ra16.Activationspec16Impl;
+import org.jboss.jca.common.metadata.ra.ra16.ConfigProperty16Impl;
+import org.jboss.jca.common.metadata.ra.ra16.Connector16Impl;
import org.jboss.jca.common.validator.ValidateException;
import java.lang.reflect.Array;
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/jbossra/JbossRa.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/jbossra/JbossRa.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/jbossra/JbossRa.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -23,7 +23,7 @@
import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
import org.jboss.jca.common.api.metadata.ra.RaConfigProperty;
-import org.jboss.jca.common.metadataimpl.JCAMetadata;
+import org.jboss.jca.common.metadata.JCAMetadata;
import java.util.List;
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/IdDecoratedMetadata.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/IdDecoratedMetadata.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/IdDecoratedMetadata.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -21,7 +21,7 @@
*/
package org.jboss.jca.common.api.metadata.ra;
-import org.jboss.jca.common.metadataimpl.JCAMetadata;
+import org.jboss.jca.common.metadata.JCAMetadata;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/LicenseType.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/LicenseType.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/LicenseType.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -23,9 +23,8 @@
-import org.jboss.jca.common.metadataimpl.MergeUtil;
+import org.jboss.jca.common.metadata.MergeUtil;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -42,7 +41,7 @@
*/
private static final long serialVersionUID = 1590514246054447090L;
- private final ArrayList<LocalizedXsdString> description;
+ private final List<LocalizedXsdString> description;
private final boolean licenseRequired;
@@ -53,7 +52,7 @@
* @param licenseRequired mandatory boolena value
* @param id XML ID
*/
- public LicenseType(ArrayList<LocalizedXsdString> description, boolean licenseRequired, String id)
+ public LicenseType(List<LocalizedXsdString> description, boolean licenseRequired, String id)
{
super();
this.description = description;
@@ -289,7 +288,7 @@
boolean newLicenseRequired = this.licenseRequired || inputLicense.licenseRequired;
String newId = this.id == null ? inputLicense.id : this.id;
- ArrayList<LocalizedXsdString> newDescription = MergeUtil.mergeArrayList(this.description,
+ List<LocalizedXsdString> newDescription = MergeUtil.mergeList(this.description,
inputLicense.description);
return new LicenseType(newDescription, newLicenseRequired, newId);
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/LocalizedMetadata.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/LocalizedMetadata.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/LocalizedMetadata.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -21,7 +21,7 @@
*/
package org.jboss.jca.common.api.metadata.ra;
-import org.jboss.jca.common.metadataimpl.JCAMetadata;
+import org.jboss.jca.common.metadata.JCAMetadata;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/Path.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/Path.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/Path.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -21,7 +21,7 @@
*/
package org.jboss.jca.common.api.metadata.ra;
-import org.jboss.jca.common.metadataimpl.JCAMetadata;
+import org.jboss.jca.common.metadata.JCAMetadata;
import java.security.InvalidParameterException;
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra10/package.html
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra10/package.html 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/api/metadata/ra/ra10/package.html 2010-08-04 12:58:46 UTC (rev 107383)
@@ -1,3 +1,4 @@
<body>
-This package contains common metadatas fand parser for connector_1_0.xsd
+This package contains common metadatas fand parser for connector_1_0
+.xsd
</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/JCAMetadata.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/JCAMetadata.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/JCAMetadata.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/JCAMetadata.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+
+/**
+ *
+ * A generic JCAMetadata.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public interface JCAMetadata extends Serializable
+{
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MergeUtil.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/MergeUtil.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MergeUtil.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MergeUtil.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,111 @@
+/*
+ * 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;
+
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ *
+ * A static class with Merge Utilities methods.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class MergeUtil
+{
+ /**
+ *
+ * Merge to List. The results is the union of the two arrays. Element present in left and right List
+ * (letft.equals(right) = true) are present only one and left ones are selected
+ *
+ * @param <T> the type of List elements
+ * @param left left side List to merge
+ * @param right right side List to merge
+ * @return merged List
+ */
+ public static <T> List<T> mergeList(List<T> left, List<T> right)
+ {
+ Set<T> newSet = new HashSet<T>((left == null ? 0 : left.size())
+ + (right == null ? 0 : right.size()));
+ if (left != null)
+ newSet.addAll(left);
+ if (right != null)
+ newSet.addAll(right);
+ List<T> newList = new ArrayList<T>(newSet.size());
+ newList.addAll(newSet);
+ return newList;
+ }
+
+ /**
+ *
+ * F Merge to List of ConfigProperty. The results is the union of the two arrays.
+ * Element present in left and right List
+ * (letft.equals(right) = true) are present only one and left ones are selected
+ *
+ *
+ * @param left left side List to merge
+ * @param right right side List to merge
+ * @return merged List
+ */
+ public static List<? extends ConfigProperty> mergeConfigList(
+ List<? extends ConfigProperty> left, List<? extends ConfigProperty> right)
+ {
+ ArrayList<ConfigProperty> newList = new ArrayList<ConfigProperty>((left == null ? 0 : left.size())
+ + (right == null ? 0 : right.size()));
+ if (left == null)
+ {
+ if (right != null)
+ newList.addAll(right);
+ }
+ else
+ {
+ List<String> leftNames = new ArrayList<String>(left.size());
+
+ for (ConfigProperty l : left)
+ {
+ newList.add(l);
+ leftNames.add(l.getConfigPropertyName().getValue());
+ }
+ if (right != null)
+ {
+ for (ConfigProperty r : right)
+ {
+ boolean toAdd = true;
+ for (String name : leftNames)
+ {
+ if (name.equals(r.getConfigPropertyName().getValue()))
+ toAdd = false;
+ }
+ if (toAdd)
+ newList.add(r);
+ }
+ }
+ }
+ newList.trimToSize();
+ return newList;
+ }
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataFactory.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/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-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,143 @@
+/*
+ * 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.api.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.api.metadata.ra.Connector;
+import org.jboss.jca.common.metadata.jbossra.JbossRaParser;
+import org.jboss.jca.common.metadata.ra.RaParser;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+
+import org.jboss.logging.Logger;
+
+/**
+ *
+ * A MetadataFactory.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</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())
+ {
+ InputStream input = null;
+ String url = metadataFile.getAbsolutePath();
+ try
+ {
+ long start = System.currentTimeMillis();
+ input = new FileInputStream(metadataFile);
+
+ result = (new RaParser()).parse(input);
+
+ 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;
+ }
+ finally
+ {
+ if (input != null)
+ input.close();
+ }
+
+ }
+ else
+ {
+ log.errorf("metadafile %s does not exist", metadataFile.toString());
+ }
+
+ 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())
+ {
+ InputStream input = null;
+ String url = metadataFile.getAbsolutePath();
+ try
+ {
+ long start = System.currentTimeMillis();
+
+ input = new FileInputStream(metadataFile);
+ result = (new JbossRaParser()).parse(input);
+
+ 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;
+ }
+ finally
+ {
+ if (input != null)
+ input.close();
+ }
+ }
+
+ return result;
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/MetadataParser.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/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-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,46 @@
+/*
+ * 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;
+
+import java.io.InputStream;
+
+/**
+ *
+ * A MetadataParser.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ * @param <T>
+ *
+ */
+public interface MetadataParser<T extends JCAMetadata>
+{
+
+ /**
+ * Parse the xml file and return the JCAMetaData for which the concrete parser is designed.
+ * Note that is responsibility of the client to open and close the stream
+ * @param xmlInputStream an InputStrema opened on the xml file to parse
+ * @return The metadata
+ * @exception Exception Thrown if an error occurs
+ */
+ public T parse(InputStream xmlInputStream) throws Exception;
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ParserException.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ParserException.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ParserException.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ParserException.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,77 @@
+/*
+ * 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;
+
+/**
+ *
+ * A ParserException.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class ParserException extends Exception
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Create a new ParserException.
+ *
+ */
+ public ParserException()
+ {
+ super();
+ }
+
+ /**
+ * Create a new ParserException.
+ *
+ * @param message a message
+ * @param cause a cause
+ */
+ public ParserException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ /**
+ * Create a new ParserException.
+ *
+ * @param message a message
+ */
+ public ParserException(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Create a new ParserException.
+ *
+ * @param cause a cause
+ */
+ public ParserException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaAbstractImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/jbossra/JbossRaAbstractImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaAbstractImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaAbstractImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,102 @@
+/*
+ * 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;
+
+import org.jboss.jca.common.api.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.api.metadata.ra.RaConfigProperty;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ *
+ * A JbossRa. Abstract class containig common memeber for jboss_ra_1_0 and jboss_ra_2_0
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public abstract class JbossRaAbstractImpl implements JbossRa
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private final List<RaConfigProperty<?>> raConfigProperties;
+
+ /**
+ *
+ * Create a new JbossRa. Protected constructor for subclass convenience
+ *
+ * @param raConfigProperties properties list
+ */
+ protected JbossRaAbstractImpl(List<RaConfigProperty<?>> raConfigProperties)
+ {
+ this.raConfigProperties = raConfigProperties;
+ }
+
+ /**
+ * @return raConfigProperties properties list
+ */
+ @Override
+ public List<RaConfigProperty<?>> getRaConfigProperties()
+ {
+ return raConfigProperties == null ? null : 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 JbossRaAbstractImpl))
+ return false;
+ JbossRaAbstractImpl other = (JbossRaAbstractImpl) 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 + "]";
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/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-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,388 @@
+/*
+ * 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;
+
+import org.jboss.jca.common.api.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.api.metadata.jbossra.jbossra10.JbossRa10;
+import org.jboss.jca.common.api.metadata.jbossra.jbossra20.BeanValidationGroup;
+import org.jboss.jca.common.api.metadata.jbossra.jbossra20.JbossRa20;
+import org.jboss.jca.common.api.metadata.ra.OverrideElementAttribute;
+import org.jboss.jca.common.api.metadata.ra.RaConfigProperty;
+import org.jboss.jca.common.metadata.MetadataParser;
+import org.jboss.jca.common.metadata.ParserException;
+import org.jboss.jca.common.metadata.jbossra.jbossra10.JbossRa10Impl;
+import org.jboss.jca.common.metadata.jbossra.jbossra20.BeanValidationGroupImpl;
+import org.jboss.jca.common.metadata.jbossra.jbossra20.JbossRa20Impl;
+import org.jboss.jca.common.metadata.ra.common.RaConfigPropertyImpl;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+/**
+ * A JbossRaParser.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class JbossRaParser implements MetadataParser<JbossRa>
+{
+
+ /**
+ * Parse the xml file and return the {@link JbossRaAbstractImpl} metadata
+ * @param xmlInputStream The stream on xml file to parse
+ * @return The {@link JbossRaAbstractImpl} metadata
+ * @exception Exception Thrown if an error occurs
+ */
+ @Override
+ public JbossRa parse(InputStream xmlInputStream) throws Exception
+ {
+ XMLStreamReader reader = null;
+ JbossRa jbossRa = null;
+
+ try
+ {
+ XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ reader = inputFactory.createXMLStreamReader(xmlInputStream);
+
+ //iterate over tags
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ // should mean we're done, so ignore it.
+ break;
+ }
+ case START_ELEMENT : {
+ if (JbossRa10.NAMESPACE.equals(reader.getNamespaceURI()))
+ {
+ switch (Tag.forName(reader.getLocalName()))
+ {
+ case JBOSSRA : {
+ jbossRa = parseJbossRa10(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+
+ }
+ else if (JbossRa20.NAMESPACE.equals(reader.getNamespaceURI()))
+ {
+ switch (Tag.forName(reader.getLocalName()))
+ {
+ case JBOSSRA : {
+ jbossRa = parseJbossRa20(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ }
+ else
+ {
+ throw new ParserException(String.format("Namespace %s is not supported by %s parser",
+ reader.getNamespaceURI(), this.getClass().getName()));
+ }
+
+ break;
+ }
+ default :
+ throw new IllegalStateException();
+ }
+ }
+ catch (XMLStreamException e)
+ {
+ //ignore it. It is just saying that it isn't a tag
+ }
+ finally
+ {
+ if (reader != null)
+ reader.close();
+ }
+ return jbossRa;
+
+ }
+
+ private JbossRa20 parseJbossRa20(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ ArrayList<RaConfigProperty<?>> raConfigProperties = new ArrayList<RaConfigProperty<?>>();
+ ArrayList<BeanValidationGroup> beanValidationGroups = new ArrayList<BeanValidationGroup>();
+ String bootStrapContext = null;
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Tag.forName(reader.getLocalName()) == Tag.JBOSSRA)
+ {
+ raConfigProperties.trimToSize();
+ beanValidationGroups.trimToSize();
+ return new JbossRa20Impl(raConfigProperties, bootStrapContext, beanValidationGroups);
+ }
+ else
+ {
+ if (JbossRa10.Tag.forName(reader.getLocalName()) == JbossRa10.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (JbossRa20.Tag.forName(reader.getLocalName()))
+ {
+ case RA_CONFIG_PROPERTY : {
+ raConfigProperties.add(parseConfigProperty(reader));
+ break;
+ }
+ case BOOTSTRAP_CONTEXT : {
+ bootStrapContext = reader.getElementText();
+ break;
+ }
+ case BEAN_VALIDATION_GROUPS : {
+ beanValidationGroups.add(parseBeanValidationGroups(reader));
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private JbossRa10 parseJbossRa10(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ ArrayList<RaConfigProperty<?>> raConfigProperties = new ArrayList<RaConfigProperty<?>>();
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Tag.forName(reader.getLocalName()) == Tag.JBOSSRA)
+ {
+ raConfigProperties.trimToSize();
+ return new JbossRa10Impl(raConfigProperties);
+ }
+ else
+ {
+ if (JbossRa10.Tag.forName(reader.getLocalName()) == JbossRa10.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (JbossRa10.Tag.forName(reader.getLocalName()))
+ {
+ case RA_CONFIG_PROPERTY : {
+ raConfigProperties.add(parseConfigProperty(reader));
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private RaConfigProperty<?> parseConfigProperty(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ String value = null;
+ String type = null;
+ String name = null;
+ //do it now because we are on right START_ELEMENT
+ OverrideElementAttribute overrideElementAttribute = OverrideElementAttribute.forName(reader.getAttributeValue(0));
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (JbossRa10.Tag.forName(reader.getLocalName()) == JbossRa10.Tag.RA_CONFIG_PROPERTY
+ || JbossRa20.Tag.forName(reader.getLocalName()) == JbossRa20.Tag.RA_CONFIG_PROPERTY)
+ {
+ return RaConfigPropertyImpl.buildRaConfigProperty(name, value, type, overrideElementAttribute);
+ }
+ else
+ {
+ if (JbossRa10.Tag.forName(reader.getLocalName()) == JbossRa10.Tag.UNKNOWN
+ && JbossRa20.Tag.forName(reader.getLocalName()) == JbossRa20.Tag.UNKNOWN
+ && RaConfigProperty.Tag.forName(reader.getLocalName()) == RaConfigProperty.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (RaConfigProperty.Tag.forName(reader.getLocalName()))
+ {
+ case RA_CONFIG_PROPERTY_NAME : {
+ name = reader.getElementText();
+ break;
+ }
+ case RA_CONFIG_PROPERTY_VALUE : {
+ value = reader.getElementText();
+ break;
+ }
+ case RA_CONFIG_PROPERTY_TYPE : {
+ type = reader.getElementText();
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private BeanValidationGroupImpl parseBeanValidationGroups(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
+ {
+ ArrayList<String> beanValidationGroup = new ArrayList<String>();
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (JbossRa20.Tag.forName(reader.getLocalName()) == JbossRa20.Tag.BEAN_VALIDATION_GROUPS)
+ {
+ beanValidationGroup.trimToSize();
+ return new BeanValidationGroupImpl(beanValidationGroup);
+ }
+ else
+ {
+ if (JbossRa10.Tag.forName(reader.getLocalName()) == JbossRa10.Tag.UNKNOWN
+ && JbossRa20.Tag.forName(reader.getLocalName()) == JbossRa20.Tag.UNKNOWN
+ && BeanValidationGroup.Tag.forName(reader.getLocalName()) == BeanValidationGroup.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (BeanValidationGroup.Tag.forName(reader.getLocalName()))
+ {
+ case BEAN_VALIDATION_GROUP : {
+ beanValidationGroup.add(reader.getElementText());
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /** jboss-ra tag name
+ *
+ */
+ JBOSSRA("jboss-ra");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Tag(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ private static final Map<String, Tag> MAP;
+
+ static
+ {
+ final Map<String, Tag> map = new HashMap<String, Tag>();
+ for (Tag element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName string
+ *
+ * @param localName a string used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Tag forName(String localName)
+ {
+ final Tag element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/jbossra/jbossra10/JbossRa10Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,66 @@
+/*
+ * 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.jbossra10;
+
+import org.jboss.jca.common.api.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.api.metadata.jbossra.jbossra10.JbossRa10;
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.RaConfigProperty;
+import org.jboss.jca.common.metadata.jbossra.JbossRaAbstractImpl;
+
+import java.util.List;
+
+/**
+ *
+ * A JbossRa10.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class JbossRa10Impl extends JbossRaAbstractImpl implements JbossRa10
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * @param raConfigProperties List of properties for configuration
+ *
+ */
+ public JbossRa10Impl(List<RaConfigProperty<?>> raConfigProperties)
+ {
+ super(raConfigProperties);
+ }
+
+ @Override
+ public String toString()
+ {
+ return "JbossRa10 [getRaConfigProperties()=" + getRaConfigProperties() + "]";
+ }
+
+ @Override
+ public JbossRa merge(MergeableMetadata<?> jmd) throws Exception
+ {
+ return this;
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/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-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains metadatas for jboss-ra_1_0.xsd
+</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/BeanValidationGroupImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/jbossra/jbossra20/BeanValidationGroupImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/BeanValidationGroupImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/BeanValidationGroupImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,113 @@
+/*
+ * 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.api.metadata.jbossra.jbossra20.BeanValidationGroup;
+import org.jboss.jca.common.metadata.JCAMetadata;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class BeanValidationGroupImpl implements JCAMetadata, BeanValidationGroup
+{
+
+ /**
+ */
+ private static final long serialVersionUID = 6856138720550993874L;
+
+ private final List<String> beanValidationGroup;
+
+ /**
+ * @param beanValidationGroup List of bean validation group
+ */
+ public BeanValidationGroupImpl(List<String> beanValidationGroup)
+ {
+ super();
+ this.beanValidationGroup = beanValidationGroup;
+ }
+
+ /**
+ * @return beanValidationGroup the list of bena validation group
+ */
+ @Override
+ public List<String> getBeanValidationGroup()
+ {
+ return beanValidationGroup == null ? null : Collections.unmodifiableList(beanValidationGroup);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((beanValidationGroup == null) ? 0 : beanValidationGroup.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 BeanValidationGroupImpl))
+ return false;
+ BeanValidationGroupImpl other = (BeanValidationGroupImpl) obj;
+ if (beanValidationGroup == null)
+ {
+ if (other.beanValidationGroup != null)
+ return false;
+ }
+ else if (!beanValidationGroup.equals(other.beanValidationGroup))
+ return false;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "BeanValidationGroups [beanValidationGroup=" + beanValidationGroup + ", getBeanValidationGroup()="
+ + getBeanValidationGroup() + ", hashCode()=" + hashCode() + "]";
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/jbossra/jbossra20/JbossRa20Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,139 @@
+/*
+ * 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.api.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.api.metadata.jbossra.jbossra20.BeanValidationGroup;
+import org.jboss.jca.common.api.metadata.jbossra.jbossra20.JbossRa20;
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.RaConfigProperty;
+import org.jboss.jca.common.metadata.jbossra.JbossRaAbstractImpl;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ */
+public class JbossRa20Impl extends JbossRaAbstractImpl implements JbossRa20
+{
+
+ private static final long serialVersionUID = -1494921311038998843L;
+
+ private final String bootstrapContext;
+
+ private final List<BeanValidationGroup> beanValidationGroups;
+
+ /**
+ * @param raConfigProperties List of properties for configuration
+ * @param bootstrapContext String representing the bootstrap context name
+ * @param beanValidationGroups for validations
+ */
+ public JbossRa20Impl(List<RaConfigProperty<?>> raConfigProperties, String bootstrapContext,
+ List<BeanValidationGroup> beanValidationGroups)
+ {
+ super(raConfigProperties);
+ this.bootstrapContext = bootstrapContext;
+ this.beanValidationGroups = beanValidationGroups;
+ }
+
+ /**
+ * @return bootstrapContext
+ */
+ @Override
+ public String getBootstrapContext()
+ {
+ return bootstrapContext;
+ }
+
+ /**
+ * @return beanValidationGroups
+ */
+ @Override
+ public List<BeanValidationGroup> getBeanValidationGroups()
+ {
+ return beanValidationGroups == null ? null : 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 JbossRa20Impl))
+ return false;
+ JbossRa20Impl other = (JbossRa20Impl) 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;
+ }
+
+ @Override
+ public JbossRa merge(MergeableMetadata<?> jmd) throws Exception
+ {
+ return this;
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/jbossra/jbossra20/package.html)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/package.html (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/package.html 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains metadatas for jboss-ra_2_0.xsd
+</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/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-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains common metadatas fand parser for jboss-ra_2_0.xsd and jboss_ra_10.xsd
+</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/package.html)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/package.html (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/package.html 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains classes that handles common metadata operations.
+</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/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-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,1463 @@
+/*
+ * 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.ra;
+
+import org.jboss.jca.common.api.metadata.ra.AdminObject;
+import org.jboss.jca.common.api.metadata.ra.AuthenticationMechanism;
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.ConnectionDefinition;
+import org.jboss.jca.common.api.metadata.ra.Connector;
+import org.jboss.jca.common.api.metadata.ra.CredentialInterfaceEnum;
+import org.jboss.jca.common.api.metadata.ra.Icon;
+import org.jboss.jca.common.api.metadata.ra.InboundResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.LicenseType;
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
+import org.jboss.jca.common.api.metadata.ra.MessageListener;
+import org.jboss.jca.common.api.metadata.ra.Messageadapter;
+import org.jboss.jca.common.api.metadata.ra.OutboundResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.Path;
+import org.jboss.jca.common.api.metadata.ra.RequiredConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
+import org.jboss.jca.common.api.metadata.ra.SecurityPermission;
+import org.jboss.jca.common.api.metadata.ra.TransactionSupportEnum;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra10.Connector10;
+import org.jboss.jca.common.api.metadata.ra.ra10.ResourceAdapter10;
+import org.jboss.jca.common.api.metadata.ra.ra15.Activationspec15;
+import org.jboss.jca.common.api.metadata.ra.ra15.Connector15;
+import org.jboss.jca.common.api.metadata.ra.ra16.Activationspec16;
+import org.jboss.jca.common.api.metadata.ra.ra16.ConfigProperty16;
+import org.jboss.jca.common.api.metadata.ra.ra16.Connector16;
+import org.jboss.jca.common.metadata.MetadataParser;
+import org.jboss.jca.common.metadata.ParserException;
+import org.jboss.jca.common.metadata.ra.common.AdminObjectImpl;
+import org.jboss.jca.common.metadata.ra.common.AuthenticationMechanismImpl;
+import org.jboss.jca.common.metadata.ra.common.ConfigPropertyImpl;
+import org.jboss.jca.common.metadata.ra.common.ConnectionDefinitionImpl;
+import org.jboss.jca.common.metadata.ra.common.InboundResourceAdapterImpl;
+import org.jboss.jca.common.metadata.ra.common.MessageAdapterImpl;
+import org.jboss.jca.common.metadata.ra.common.MessageListenerImpl;
+import org.jboss.jca.common.metadata.ra.common.OutboundResourceAdapterImpl;
+import org.jboss.jca.common.metadata.ra.common.ResourceAdapter1516Impl;
+import org.jboss.jca.common.metadata.ra.common.SecurityPermissionImpl;
+import org.jboss.jca.common.metadata.ra.ra10.Connector10Impl;
+import org.jboss.jca.common.metadata.ra.ra10.ResourceAdapter10Impl;
+import org.jboss.jca.common.metadata.ra.ra15.Activationspec15Impl;
+import org.jboss.jca.common.metadata.ra.ra15.Connector15Impl;
+import org.jboss.jca.common.metadata.ra.ra16.Activationspec16Impl;
+import org.jboss.jca.common.metadata.ra.ra16.ConfigProperty16Impl;
+import org.jboss.jca.common.metadata.ra.ra16.Connector16Impl;
+
+import static org.jboss.jca.common.api.metadata.ra.XsdString.NULL_XSDSTRING;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+
+
+
+/**
+ *
+ * A RaParser.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class RaParser implements MetadataParser<Connector>
+{
+
+ @Override
+ public Connector parse(InputStream xmlInputStream) throws Exception
+ {
+ XMLStreamReader reader = null;
+ Connector connector = null;
+
+ try
+ {
+
+ XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+ reader = inputFactory.createXMLStreamReader(xmlInputStream);
+
+ //iterate over tags
+ int iterate;
+ try
+ {
+ iterate = reader.nextTag();
+ }
+ catch (XMLStreamException e)
+ {
+ //fpunding a non tag..go on
+ iterate = reader.nextTag();
+ }
+ switch (iterate)
+ {
+ case END_ELEMENT : {
+ // should mean we're done, so ignore it.
+ break;
+ }
+ case START_ELEMENT : {
+ if (Connector16.XML_VERSION.equals(reader.getAttributeValue(null, "version")))
+ {
+ switch (Tag.forName(reader.getLocalName()))
+ {
+ case CONNECTOR : {
+ connector = parseConnector16(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+
+ }
+ else if (Connector15.XML_VERSION.equals(reader.getAttributeValue(null, "version")))
+ {
+ switch (Tag.forName(reader.getLocalName()))
+ {
+ case CONNECTOR : {
+ connector = parseConnector15(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ }
+ else
+ {
+ switch (Tag.forName(reader.getLocalName()))
+ {
+ case CONNECTOR : {
+ connector = parseConnector10(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ }
+
+ break;
+ }
+ default :
+ throw new IllegalStateException();
+ }
+ }
+ finally
+ {
+ if (reader != null)
+ reader.close();
+ }
+ return connector;
+
+ }
+
+ private Connector parseConnector10(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ LicenseType license = null;
+ String id = reader.getAttributeValue(null, Connector16.Attribute.ID.getLocalName());;
+ ArrayList<Icon> icon = new ArrayList<Icon>();
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+ XsdString eisType = NULL_XSDSTRING;
+ ResourceAdapter10 resourceadapter = null;
+ XsdString vendorName = NULL_XSDSTRING;
+ String moduleName = null;
+ XsdString displayName = NULL_XSDSTRING;
+ XsdString resourceadapterVersion = NULL_XSDSTRING;
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Tag.forName(reader.getLocalName()) == Tag.CONNECTOR)
+ {
+
+ //trimming collections
+ icon.trimToSize();
+ description.trimToSize();
+
+ //building and returning object
+ return new Connector10Impl(moduleName, description, displayName, icon, vendorName, eisType,
+ resourceadapterVersion, license, resourceadapter, id);
+
+ }
+ else
+ {
+ if (Connector10.Tag.forName(reader.getLocalName()) == Connector10.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (Connector10.Tag.forName(reader.getLocalName()))
+ {
+ case MODULENAME : {
+ moduleName = reader.getElementText().trim();
+ break;
+ }
+ case VENDORNAME : {
+ vendorName = elementAsXsdString(reader);
+ break;
+ }
+ case EIS_TYPE : {
+ eisType = elementAsXsdString(reader);
+ break;
+ }
+ case LICENSE : {
+ license = parseLicense(reader);
+ break;
+ }
+ case RESOURCEADPTER_VERSION : {
+ resourceadapterVersion = elementAsXsdString(reader);
+ }
+ break;
+ case RESOURCEADAPTER : {
+ resourceadapter = parseResourceAdapter10(reader);
+ break;
+ }
+ case DESCRIPTION : {
+ description.add(elementAsLocalizedXsdString(reader));
+ break;
+ }
+ case DISPLAY_NAME : {
+ displayName = elementAsLocalizedXsdString(reader);
+ break;
+ }
+ case ICON : {
+ icon.add(parseIcon(reader));
+ break;
+ }
+ case SPEC_VERSION :
+ case VERSION : {
+ //ignore
+ elementAsLocalizedXsdString(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private Connector parseConnector15(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ LicenseType license = null;
+ String id = reader.getAttributeValue(null, Connector15.Attribute.ID.getLocalName());;
+ XsdString eisType = NULL_XSDSTRING;
+ ResourceAdapter1516 resourceadapter = null;
+ XsdString vendorName = NULL_XSDSTRING;
+ XsdString resourceadapterVersion = NULL_XSDSTRING;
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Tag.forName(reader.getLocalName()) == Tag.CONNECTOR)
+ {
+
+ //building and returning object
+ return new Connector15Impl(vendorName, eisType, resourceadapterVersion, license, resourceadapter, id);
+
+ }
+ else
+ {
+ if (Connector15.Tag.forName(reader.getLocalName()) == Connector15.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (Connector15.Tag.forName(reader.getLocalName()))
+ {
+ case VENDORNAME : {
+ vendorName = elementAsXsdString(reader);
+ break;
+ }
+ case EIS_TYPE : {
+ eisType = elementAsXsdString(reader);
+ break;
+ }
+ case LICENSE : {
+ license = parseLicense(reader);
+ break;
+ }
+ case RESOURCEADPTER_VERSION : {
+ resourceadapterVersion = elementAsXsdString(reader);
+ }
+ break;
+ case RESOURCEADAPTER : {
+ resourceadapter = parseResourceAdapter(reader);
+ break;
+ }
+ case DISPLAY_NAME : {
+ elementAsLocalizedXsdString(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private Connector parseConnector16(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ boolean metadataComplete = Boolean.valueOf(reader.getAttributeValue(null,
+ Connector16.Attribute.METADATA_COMPLETE.getLocalName()));;
+ LicenseType license = null;
+ String id = reader.getAttributeValue(null, Connector16.Attribute.ID.getLocalName());;
+ ArrayList<Icon> icon = new ArrayList<Icon>();
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+ XsdString eisType = NULL_XSDSTRING;
+ ResourceAdapter1516 resourceadapter = null;
+ XsdString vendorName = NULL_XSDSTRING;
+ String moduleName = null;
+ ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
+ ArrayList<String> requiredWorkContext = new ArrayList<String>();
+ XsdString resourceadapterVersion = NULL_XSDSTRING;
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Tag.forName(reader.getLocalName()) == Tag.CONNECTOR)
+ {
+
+ //trimming collections
+ icon.trimToSize();
+ description.trimToSize();
+ displayName.trimToSize();
+ requiredWorkContext.trimToSize();
+ //building and returning object
+ return new Connector16Impl(moduleName, description, displayName, icon, vendorName, eisType,
+ resourceadapterVersion, license, resourceadapter, requiredWorkContext, metadataComplete, id);
+
+ }
+ else
+ {
+ if (Connector16.Tag.forName(reader.getLocalName()) == Connector16.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+
+ switch (Connector16.Tag.forName(reader.getLocalName()))
+ {
+ case MODULENAME : {
+ moduleName = reader.getElementText().trim();
+ break;
+ }
+ case VENDORNAME : {
+ vendorName = elementAsXsdString(reader);
+ break;
+ }
+ case EIS_TYPE : {
+ eisType = elementAsXsdString(reader);
+ break;
+ }
+ case LICENSE : {
+ license = parseLicense(reader);
+ break;
+ }
+ case RESOURCEADPTER_VERSION : {
+ resourceadapterVersion = elementAsXsdString(reader);
+ }
+ break;
+ case RESOURCEADAPTER : {
+ resourceadapter = parseResourceAdapter(reader);
+ break;
+ }
+ case REQUIRED_WORK_CONTEXT : {
+ requiredWorkContext.add(reader.getElementText().trim());
+ break;
+ }
+ case DESCRIPTION : {
+ description.add(elementAsLocalizedXsdString(reader));
+ break;
+ }
+ case DISPLAY_NAME : {
+ displayName.add(elementAsLocalizedXsdString(reader));
+ break;
+ }
+ case ICON : {
+ icon.add(parseIcon(reader));
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private Icon parseIcon(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ Path largeIcon = null;
+ Path smallIcon = null;
+
+ //getting attributes
+ String id = reader.getAttributeValue(null, Icon.Attribute.ID.getLocalName());
+ String lang = reader.getAttributeValue(null, Icon.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Connector16.Tag.forName(reader.getLocalName()) == Connector16.Tag.ICON)
+ {
+ //building and returning object
+
+ return new Icon(smallIcon, largeIcon, lang, id);
+
+ }
+ else
+ {
+ if (Icon.Tag.forName(reader.getLocalName()) == Icon.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (Icon.Tag.forName(reader.getLocalName()))
+ {
+ case SMALL_ICON : {
+ smallIcon = Path.valueOf(reader.getElementText().trim());
+ break;
+ }
+ case LARGE_ICON : {
+ largeIcon = Path.valueOf(reader.getElementText().trim());
+ break;
+ }
+
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private ResourceAdapter1516 parseResourceAdapter(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ ArrayList<ConfigProperty> configProperty = new ArrayList<ConfigProperty>();
+ String resourceadapterClass = null;
+ OutboundResourceAdapter outboundResourceadapter = null;
+ ArrayList<SecurityPermission> securityPermission = new ArrayList<SecurityPermission>();
+ InboundResourceAdapter inboundResourceadapter = null;
+ ArrayList<AdminObject> adminobject = new ArrayList<AdminObject>();
+ String id = reader.getAttributeValue(null, ResourceAdapter1516.Attribute.ID.getLocalName());
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Connector16.Tag.forName(reader.getLocalName()) == Connector16.Tag.RESOURCEADAPTER)
+ {
+ //trimming collections
+ configProperty.trimToSize();
+ securityPermission.trimToSize();
+ adminobject.trimToSize();
+
+ //building and returning object
+ return new ResourceAdapter1516Impl(resourceadapterClass, configProperty, outboundResourceadapter,
+ inboundResourceadapter, adminobject, securityPermission, id);
+
+ }
+ else
+ {
+ if (ResourceAdapter1516.Tag.forName(reader.getLocalName()) == ResourceAdapter1516.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+
+ switch (ResourceAdapter1516.Tag.forName(reader.getLocalName()))
+ {
+ case RESOURCEADAPTER_CLASS : {
+ resourceadapterClass = reader.getElementText().trim();
+ break;
+ }
+ case CONFIG_PROPERTY : {
+ configProperty.add(parseConfigProperty(reader));
+ break;
+ }
+
+ case OUTBOUND_RESOURCEADAPTER : {
+ outboundResourceadapter = parseOutboundResourceadapter(reader);
+ break;
+ }
+ case INBOUND_RESOURCEADAPTER : {
+ inboundResourceadapter = parseInboundResourceadapter(reader);
+ break;
+ }
+ case ADMINOBJECT : {
+ adminobject.add(parseAdminObject(reader));
+ break;
+ }
+ case SECURITY_PERMISSION : {
+ securityPermission.add(parseSecurityPermission(reader));
+ break;
+ }
+
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private ResourceAdapter10 parseResourceAdapter10(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ XsdString managedConnectionFactoryClass = NULL_XSDSTRING;
+ XsdString connectionFactoryInterface = NULL_XSDSTRING;
+ XsdString connectionFactoryImplClass = NULL_XSDSTRING;
+ XsdString connectionInterface = NULL_XSDSTRING;
+ XsdString connectionImplClass = NULL_XSDSTRING;
+ TransactionSupportEnum transactionSupport = null;
+ ArrayList<AuthenticationMechanism> authenticationMechanism = new ArrayList<AuthenticationMechanism>();
+ ArrayList<ConfigProperty> configProperties = new ArrayList<ConfigProperty>();
+ Boolean reauthenticationSupport = null;
+ ArrayList<SecurityPermission> securityPermission = new ArrayList<SecurityPermission>();
+ String id = reader.getAttributeValue(null, ResourceAdapter1516.Attribute.ID.getLocalName());
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Connector10.Tag.forName(reader.getLocalName()) == Connector10.Tag.RESOURCEADAPTER)
+ {
+ //trimming collections
+ authenticationMechanism.trimToSize();
+ configProperties.trimToSize();
+ securityPermission.trimToSize();
+
+ //building and returning object
+ return new ResourceAdapter10Impl(managedConnectionFactoryClass, connectionFactoryInterface,
+ connectionFactoryImplClass, connectionInterface, connectionImplClass, transactionSupport,
+ authenticationMechanism, configProperties, reauthenticationSupport, securityPermission, id);
+
+ }
+ else
+ {
+ if (ResourceAdapter10.Tag.forName(reader.getLocalName()) == ResourceAdapter10.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+
+ switch (ResourceAdapter10.Tag.forName(reader.getLocalName()))
+ {
+ case CONFIG_PROPERTY : {
+ configProperties.add(parseConfigProperty(reader));
+ break;
+ }
+ case AUTHENTICATION_MECHANISM : {
+ authenticationMechanism.add(parseAuthenticationMechanism(reader));
+ break;
+ }
+ case MANAGED_CONNECTIONFACTORY_CLASS : {
+ managedConnectionFactoryClass = elementAsXsdString(reader);
+ break;
+ }
+ case CONNECTION_INTERFACE : {
+ connectionInterface = elementAsXsdString(reader);
+ break;
+ }
+ case CONNECTION_IMPL_CLASS : {
+ connectionImplClass = elementAsXsdString(reader);
+ break;
+ }
+ case CONNECTIONFACTORY_INTERFACE : {
+ connectionFactoryInterface = elementAsXsdString(reader);
+ break;
+ }
+ case CONNECTIONFACTORY_IMPL_CLASS : {
+ connectionFactoryImplClass = elementAsXsdString(reader);
+ break;
+ }
+ case REAUTHENTICATION_SUPPORT : {
+ reauthenticationSupport = elementAsBoolean(reader);
+ break;
+ }
+ case SECURITY_PERMISSION : {
+ securityPermission.add(parseSecurityPermission(reader));
+ break;
+ }
+ case TRANSACTION_SUPPORT : {
+ transactionSupport = TransactionSupportEnum.valueOf(reader.getElementText().trim());
+ break;
+ }
+
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private InboundResourceAdapter parseInboundResourceadapter(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
+ {
+ Messageadapter messageadapter = null;
+ String id = reader.getAttributeValue(null, InboundResourceAdapter.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (ResourceAdapter1516.Tag.
+ forName(reader.getLocalName()) == ResourceAdapter1516.Tag.INBOUND_RESOURCEADAPTER)
+ {
+
+ //building and returning object
+ return new InboundResourceAdapterImpl(messageadapter, id);
+
+ }
+ else
+ {
+ if (InboundResourceAdapter.Tag.forName(reader.getLocalName()) == InboundResourceAdapter.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (InboundResourceAdapter.Tag.forName(reader.getLocalName()))
+ {
+ case MESSAGEADAPTER : {
+ messageadapter = parseMessageAdapter(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private Messageadapter parseMessageAdapter(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ ArrayList<MessageListener> messagelistener = new ArrayList<MessageListener>();
+ String id = reader.getAttributeValue(null, Messageadapter.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (InboundResourceAdapter.Tag.
+ forName(reader.getLocalName()) == InboundResourceAdapter.Tag.MESSAGEADAPTER)
+ {
+ //trimming collections
+ messagelistener.trimToSize();
+
+ //building and returning object
+ return new MessageAdapterImpl(messagelistener, id);
+
+ }
+ else
+ {
+ if (Messageadapter.Tag.forName(reader.getLocalName()) == Messageadapter.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (Messageadapter.Tag.forName(reader.getLocalName()))
+ {
+ case MESSAGELISTENER : {
+ messagelistener.add(parseMessageListener(reader));
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private MessageListener parseMessageListener(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ Activationspec15 activationspec = null;
+ XsdString messagelistenerType = NULL_XSDSTRING;
+ //getting attributes
+ String id = reader.getAttributeValue(null, MessageListener.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Messageadapter.Tag.forName(reader.getLocalName()) == Messageadapter.Tag.MESSAGELISTENER)
+ {
+
+ //trimming collections
+
+ //building and returning object
+ return new MessageListenerImpl(messagelistenerType, activationspec, id);
+
+ }
+ else
+ {
+ if (MessageListener.Tag.forName(reader.getLocalName()) == MessageListener.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (MessageListener.Tag.forName(reader.getLocalName()))
+ {
+ case MESSAGELISTENER_TYPE : {
+ messagelistenerType = elementAsXsdString(reader);
+ break;
+ }
+ case ACTIVATIONSPEC : {
+ activationspec = parseActivationspec(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private Activationspec15 parseActivationspec(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ ArrayList<RequiredConfigProperty> requiredConfigProperty = new ArrayList<RequiredConfigProperty>();
+ XsdString activationspecClass = NULL_XSDSTRING;
+ ArrayList<ConfigProperty> configProperty = new ArrayList<ConfigProperty>();
+ //getting attributes
+ String id = reader.getAttributeValue(null, Activationspec16.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (MessageListener.Tag.forName(reader.getLocalName()) == MessageListener.Tag.ACTIVATIONSPEC)
+ {
+
+ //trimming collections
+ requiredConfigProperty.trimToSize();
+ configProperty.trimToSize();
+
+ //building and returning object
+ if (configProperty.size() != 0)
+ {
+ return new Activationspec16Impl(activationspecClass, requiredConfigProperty, configProperty, id);
+ }
+ else
+ {
+ return new Activationspec15Impl(activationspecClass, requiredConfigProperty, id);
+ }
+
+ }
+ else
+ {
+ if (Activationspec16.Tag.forName(reader.getLocalName()) == Activationspec16.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (Activationspec16.Tag.forName(reader.getLocalName()))
+ {
+ case ACTIVATIONSPEC_CLASS : {
+ activationspecClass = elementAsXsdString(reader);
+ break;
+ }
+ case REQUIRED_CONFIG_PROPERTY : {
+ requiredConfigProperty.add(parseRequiredConfigProperty(reader));
+ break;
+ }
+ case CONFIG_PROPERTY : {
+ configProperty.add(parseConfigProperty(reader));
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private RequiredConfigProperty parseRequiredConfigProperty(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
+ {
+ XsdString configPropertyName = NULL_XSDSTRING;
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+ //getting attributes
+ String id = reader.getAttributeValue(null, RequiredConfigProperty.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Activationspec16.Tag.forName(reader.getLocalName()) == Activationspec16.Tag.REQUIRED_CONFIG_PROPERTY)
+ {
+
+ //trimming collections
+ description.trimToSize();
+
+ //building and returning object
+ return new RequiredConfigProperty(description, configPropertyName, id);
+
+ }
+ else
+ {
+ if (RequiredConfigProperty.Tag.forName(reader.getLocalName()) == RequiredConfigProperty.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (RequiredConfigProperty.Tag.forName(reader.getLocalName()))
+ {
+ case DESCRIPTION : {
+ description.add(elementAsLocalizedXsdString(reader));
+ break;
+ }
+ case CONFIG_PROPERTY_NAME : {
+ configPropertyName = elementAsXsdString(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private OutboundResourceAdapter parseOutboundResourceadapter(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
+ {
+ Boolean reauthenticationSupport = null;
+ TransactionSupportEnum transactionSupport = null;
+ ArrayList<ConnectionDefinition> connectionDefinition = new ArrayList<ConnectionDefinition>();
+ ArrayList<AuthenticationMechanism> authenticationMechanism = new ArrayList<AuthenticationMechanism>();
+ //getting attributes
+ String id = reader.getAttributeValue(null, OutboundResourceAdapter.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (ResourceAdapter1516.Tag.
+ forName(reader.getLocalName()) == ResourceAdapter1516.Tag.OUTBOUND_RESOURCEADAPTER)
+ {
+
+ //trimming collections
+ authenticationMechanism.trimToSize();
+ connectionDefinition.trimToSize();
+
+ //building and returning object
+ return new OutboundResourceAdapterImpl(connectionDefinition, transactionSupport,
+ authenticationMechanism,
+ reauthenticationSupport, id);
+
+ }
+ else
+ {
+ if (OutboundResourceAdapter.Tag.forName(reader.getLocalName()) == OutboundResourceAdapter.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (OutboundResourceAdapter.Tag.forName(reader.getLocalName()))
+ {
+ case CONNECTION_DEFINITION : {
+ connectionDefinition.add(parseConncetionDefinition(reader));
+ break;
+ }
+ case AUTHENTICATION_MECHANISM : {
+ authenticationMechanism.add(parseAuthenticationMechanism(reader));
+ break;
+ }
+ case TRANSACTION_SUPPORT : {
+ transactionSupport = TransactionSupportEnum.valueOf(reader.getElementText().trim());
+ break;
+ }
+ case REAUTHENTICATION_SUPPORT : {
+ reauthenticationSupport = elementAsBoolean(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private ConnectionDefinition parseConncetionDefinition(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
+ {
+ XsdString managedconnectionfactoryClass = NULL_XSDSTRING;
+ ArrayList<ConfigProperty> configProperty = new ArrayList<ConfigProperty>();
+ XsdString connectionImplClass = NULL_XSDSTRING;
+ XsdString connectionInterface = NULL_XSDSTRING;
+ XsdString connectionfactoryImplClass = NULL_XSDSTRING;
+ XsdString connectionfactoryInterface = NULL_XSDSTRING;
+ //getting attributes
+ String id = reader.getAttributeValue(null, AuthenticationMechanism.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (OutboundResourceAdapter.Tag.
+ forName(reader.getLocalName()) == OutboundResourceAdapter.Tag.CONNECTION_DEFINITION)
+ {
+
+ //trimming collections
+ configProperty.trimToSize();
+
+ //building and returning object
+ return new ConnectionDefinitionImpl(managedconnectionfactoryClass, configProperty,
+ connectionfactoryInterface, connectionfactoryImplClass, connectionInterface,
+ connectionImplClass, id);
+
+ }
+ else
+ {
+ if (ConnectionDefinition.Tag.forName(reader.getLocalName()) == ConnectionDefinition.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (ConnectionDefinition.Tag.forName(reader.getLocalName()))
+ {
+ case CONFIG_PROPERTY : {
+ configProperty.add(parseConfigProperty(reader));
+ break;
+ }
+ case MANAGED_CONNECTIONFACTORY_CLASS : {
+ managedconnectionfactoryClass = elementAsXsdString(reader);
+ break;
+ }
+ case CONNECTIONFACTORY_INTERFACE : {
+ connectionfactoryInterface = elementAsXsdString(reader);
+ break;
+ }
+ case CONNECTIONFACTORY_IMPL_CLASS : {
+ connectionfactoryImplClass = elementAsXsdString(reader);
+ break;
+ }
+ case CONNECTION_INTERFACE : {
+ connectionInterface = elementAsXsdString(reader);
+ break;
+ }
+ case CONNECTION_IMPL_CLASS : {
+ connectionImplClass = elementAsXsdString(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private AuthenticationMechanism parseAuthenticationMechanism(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
+ {
+ XsdString authenticationMechanismType = NULL_XSDSTRING;
+ CredentialInterfaceEnum credentialInterface = null;
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+
+ //getting attributes
+ String id = reader.getAttributeValue(null, AuthenticationMechanism.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (OutboundResourceAdapter.Tag.
+ forName(reader.getLocalName()) == OutboundResourceAdapter.Tag.AUTHENTICATION_MECHANISM)
+ {
+
+ //trimming collections
+ description.trimToSize();
+
+ //building and returning object
+
+ return new AuthenticationMechanismImpl(description, authenticationMechanismType, credentialInterface,
+ id);
+
+ }
+ else
+ {
+ if (AuthenticationMechanism.Tag.forName(reader.getLocalName()) == AuthenticationMechanism.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (AuthenticationMechanism.Tag.forName(reader.getLocalName()))
+ {
+ case AUTHENTICATION_MECHANISM_TYPE : {
+ authenticationMechanismType = elementAsXsdString(reader);
+ break;
+ }
+ case CREDENTIAL_INTERFACE : {
+ credentialInterface = CredentialInterfaceEnum.forName(reader.getElementText().trim());
+ break;
+ }
+ case DESCRIPTION : {
+ description.add(elementAsLocalizedXsdString(reader));
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private AdminObject parseAdminObject(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ ArrayList<ConfigProperty> configProperty = new ArrayList<ConfigProperty>();
+ XsdString adminobjectInterface = NULL_XSDSTRING;
+ XsdString adminobjectClass = NULL_XSDSTRING;
+
+ //getting attributes
+ String id = reader.getAttributeValue(null, AdminObject.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (ResourceAdapter1516.Tag.forName(reader.getLocalName()) == ResourceAdapter1516.Tag.ADMINOBJECT)
+ {
+ //trimming collections
+ configProperty.trimToSize();
+
+ //building and returning object
+ return new AdminObjectImpl(adminobjectInterface, adminobjectClass, configProperty, id);
+
+ }
+ else
+ {
+ if (AdminObject.Tag.forName(reader.getLocalName()) == AdminObject.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (AdminObject.Tag.forName(reader.getLocalName()))
+ {
+ case ADMINOBJECT_CLASS : {
+ adminobjectClass = elementAsXsdString(reader);
+ break;
+ }
+ case ADMINOBJECT_INTERFACE : {
+ adminobjectInterface = elementAsXsdString(reader);
+ break;
+ }
+ case CONFIG_PROPERTY : {
+ configProperty.add(parseConfigProperty(reader));
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private ConfigProperty parseConfigProperty(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+ XsdString configPropertyType = NULL_XSDSTRING;
+ XsdString configPropertyValue = NULL_XSDSTRING;
+ Boolean configPropertyIgnore = null;
+ XsdString configPropertyName = NULL_XSDSTRING;
+ Boolean configPropertySupportsDynamicUpdates = null;
+ Boolean configPropertyConfidential = null;
+
+ //getting attributes
+ String id = reader.getAttributeValue(null, ConfigProperty16.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (ResourceAdapter1516.Tag.forName(reader.getLocalName()) == ResourceAdapter1516.Tag.CONFIG_PROPERTY)
+ {
+ //trimming collections
+ description.trimToSize();
+
+ //building and returning object
+
+ if (configPropertyIgnore != null || configPropertySupportsDynamicUpdates != null
+ || configPropertyConfidential != null)
+ {
+ return new ConfigProperty16Impl(description, configPropertyName, configPropertyType,
+ configPropertyValue,
+ configPropertyIgnore, configPropertySupportsDynamicUpdates, configPropertyConfidential, id);
+ }
+ else
+ {
+ return new ConfigPropertyImpl(description, configPropertyName, configPropertyType,
+ configPropertyValue, id);
+ }
+
+ }
+ else
+ {
+ if (ConfigProperty16.Tag.forName(reader.getLocalName()) == ConfigProperty16.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (ConfigProperty16.Tag.forName(reader.getLocalName()))
+ {
+ case DESCRIPTION : {
+ description.add(elementAsLocalizedXsdString(reader));
+ break;
+ }
+ case CONFIG_PROPERTY_NAME : {
+ configPropertyName = elementAsXsdString(reader);
+ break;
+ }
+ case CONFIG_PROPERTY_TYPE : {
+ configPropertyType = elementAsXsdString(reader);
+ break;
+ }
+ case CONFIG_PROPERTY_VALUE : {
+ configPropertyValue = elementAsXsdString(reader);
+ break;
+ }
+ case CONFIG_PROPERTY_IGNORE : {
+ configPropertyIgnore = elementAsBoolean(reader);
+ break;
+ }
+ case CONFIG_PROPERTY_CONFIDENTIAL : {
+ configPropertyConfidential = elementAsBoolean(reader);
+ break;
+ }
+ case CONFIG_PROPERTY_SUPPORT_DYNAMIC_UPDATE : {
+ configPropertySupportsDynamicUpdates = elementAsBoolean(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private SecurityPermission parseSecurityPermission(XMLStreamReader reader) throws XMLStreamException,
+ ParserException
+ {
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+ XsdString securityPermissionSpec = NULL_XSDSTRING;
+
+ //getting attributes
+ String id = reader.getAttributeValue(null, SecurityPermission.Attribute.ID.getLocalName());
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (ResourceAdapter1516.Tag.
+ forName(reader.getLocalName()) == ResourceAdapter1516.Tag.SECURITY_PERMISSION)
+ {
+ //trimming collections
+ description.trimToSize();
+
+ //building and returning object
+ return new SecurityPermissionImpl(description, securityPermissionSpec, id);
+
+ }
+ else
+ {
+ if (SecurityPermission.Tag.forName(reader.getLocalName()) == SecurityPermission.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (SecurityPermission.Tag.forName(reader.getLocalName()))
+ {
+ case DESCRIPTION : {
+ description.add(elementAsLocalizedXsdString(reader));
+ break;
+ }
+ case SECURITY_PERMISSION_SPEC : {
+ securityPermissionSpec = elementAsXsdString(reader);
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private LicenseType parseLicense(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ String id = reader.getAttributeValue(null, LicenseType.Attribute.ID.getLocalName());;
+ boolean licenseRequired = false;
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Connector16.Tag.forName(reader.getLocalName()) == Connector16.Tag.LICENSE)
+ {
+ description.trimToSize();
+ return new LicenseType(description, licenseRequired, id);
+
+ }
+ else
+ {
+ if (LicenseType.Tag.forName(reader.getLocalName()) == LicenseType.Tag.UNKNOWN)
+ {
+ throw new ParserException("unexpected end tag" + reader.getLocalName());
+ }
+ }
+ break;
+ }
+ case START_ELEMENT : {
+ switch (LicenseType.Tag.forName(reader.getLocalName()))
+ {
+ case LICENSE_REQUIRED : {
+ licenseRequired = elementAsBoolean(reader);
+ break;
+ }
+ case DESCRIPTION : {
+ description.add(elementAsLocalizedXsdString(reader));
+ break;
+ }
+ default :
+ throw new ParserException("Unexpected element:" + reader.getLocalName());
+ }
+ break;
+ }
+ }
+ }
+ throw new ParserException("Reached end of xml document unexpectedly");
+ }
+
+ private XsdString elementAsXsdString(XMLStreamReader reader) throws XMLStreamException
+ {
+ String id = reader.getAttributeValue(null, "id");
+ return new XsdString(reader.getElementText().trim(), id);
+ }
+
+ private LocalizedXsdString elementAsLocalizedXsdString(XMLStreamReader reader) throws XMLStreamException
+ {
+ String id = reader.getAttributeValue(null, "id");
+ String lang = reader.getAttributeValue(null, "lang");
+ return new LocalizedXsdString(reader.getElementText().trim(), id, lang);
+ }
+
+ private boolean elementAsBoolean(XMLStreamReader reader) throws XMLStreamException
+ {
+ return Boolean.valueOf(reader.getElementText().trim());
+ }
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /** connector tag name
+ *
+ */
+ CONNECTOR("connector");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Tag(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ private static final Map<String, Tag> MAP;
+
+ static
+ {
+ final Map<String, Tag> map = new HashMap<String, Tag>();
+ for (Tag element : values())
+ {
+ final String name = element.getLocalName();
+ if (name != null)
+ map.put(name, element);
+ }
+ MAP = map;
+ }
+
+ /**
+ *
+ * Static method to get enum instance given localName string
+ *
+ * @param localName a string used as localname (typically tag name as defined in xsd)
+ * @return the enum instance
+ */
+ public static Tag forName(String localName)
+ {
+ final Tag element = MAP.get(localName);
+ return element == null ? UNKNOWN : element;
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AdminObjectImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/AdminObjectImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AdminObjectImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AdminObjectImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,199 @@
+/*
+ * 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.ra.common;
+
+
+import org.jboss.jca.common.api.metadata.ra.AdminObject;
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class AdminObjectImpl implements AdminObject
+{
+ /**
+ */
+ private static final long serialVersionUID = -7653991400977178783L;
+
+ private final XsdString adminobjectInterface;
+
+ private final XsdString adminobjectClass;
+
+ private final List<? extends ConfigProperty> configProperty;
+
+ private final String id;
+
+ /**
+ * @param adminobjectInterface full qualified name of the interface
+ * @param adminobjectClass full qualified name of the implementation class
+ * @param configProperty List of config propeties
+ * @param id xmlid
+ */
+ public AdminObjectImpl(final XsdString adminobjectInterface, final XsdString adminobjectClass,
+ final List<? extends ConfigProperty> configProperty, final String id)
+ {
+ super();
+ this.adminobjectInterface = adminobjectInterface;
+ this.adminobjectClass = adminobjectClass;
+ this.configProperty = configProperty;
+ this.id = id;
+ }
+
+ /**
+ * @return adminobjectInterface
+ */
+ @Override
+ public XsdString getAdminobjectInterface()
+ {
+ return adminobjectInterface;
+ }
+
+ /**
+ * @return adminobjectClass
+ */
+ @Override
+ public XsdString getAdminobjectClass()
+ {
+ return adminobjectClass;
+ }
+
+ /**
+ * @return configProperty
+ */
+ @Override
+ public List<? extends ConfigProperty> getConfigProperties()
+ {
+ return configProperty == null ? null : Collections.unmodifiableList(configProperty);
+ }
+
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((adminobjectClass == null) ? 0 : adminobjectClass.hashCode());
+ result = prime * result + ((adminobjectInterface == null) ? 0 : adminobjectInterface.hashCode());
+ result = prime * result + ((configProperty == null) ? 0 : configProperty.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(final Object obj)
+ {
+ if (this == obj)
+ {
+ return true;
+ }
+ if (obj == null)
+ {
+ return false;
+ }
+ if (!(obj instanceof AdminObjectImpl))
+ {
+ return false;
+ }
+ final AdminObjectImpl other = (AdminObjectImpl) obj;
+ if (adminobjectClass == null)
+ {
+ if (other.adminobjectClass != null)
+ {
+ return false;
+ }
+ }
+ else if (!adminobjectClass.equals(other.adminobjectClass))
+ {
+ return false;
+ }
+ if (adminobjectInterface == null)
+ {
+ if (other.adminobjectInterface != null)
+ {
+ return false;
+ }
+ }
+ else if (!adminobjectInterface.equals(other.adminobjectInterface))
+ {
+ return false;
+ }
+ if (configProperty == null)
+ {
+ if (other.configProperty != null)
+ {
+ return false;
+ }
+ }
+ else if (!configProperty.equals(other.configProperty))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "Adminobject [adminobjectInterface=" + adminobjectInterface + ", adminobjectClass=" + adminobjectClass
+ + ", configProperty=" + configProperty + ", id=" + id + "]";
+ }
+
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AuthenticationMechanismImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/AuthenticationMechanismImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AuthenticationMechanismImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AuthenticationMechanismImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,200 @@
+/*
+ * 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.ra.common;
+
+import org.jboss.jca.common.api.metadata.ra.AuthenticationMechanism;
+import org.jboss.jca.common.api.metadata.ra.CredentialInterfaceEnum;
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class AuthenticationMechanismImpl implements AuthenticationMechanism
+{
+ /**
+ */
+ private static final long serialVersionUID = -1448136517857827148L;
+
+ private final List<LocalizedXsdString> description;
+
+ private final XsdString authenticationMechanismType;
+
+ private final CredentialInterfaceEnum credentialInterface;
+
+ private final String id;
+
+ /**
+ * @param description description attribute in xml
+ * @param authenticationMechanismType specifies type of an authentication mechanism.
+ The example values are:
+
+ <authentication-mechanism-type>BasicPassword
+ </authentication-mechanism-type>
+
+ <authentication-mechanism-type>Kerbv5
+ </authentication-mechanism-type>
+
+ Any additional security mechanisms are outside the
+ scope of the Connector architecture specification.
+ * @param credentialInterface enumeration representing credentialInterface.
+ * @param id xml ID
+ */
+ public AuthenticationMechanismImpl(List<LocalizedXsdString> description, XsdString authenticationMechanismType,
+ CredentialInterfaceEnum credentialInterface, String id)
+ {
+ super();
+ this.description = description;
+ this.authenticationMechanismType = authenticationMechanismType;
+ this.credentialInterface = credentialInterface;
+ this.id = id;
+ }
+
+ /**
+ * @return description
+ */
+ @Override
+ public List<LocalizedXsdString> getDescriptions()
+ {
+ return description == null ? null : Collections.unmodifiableList(description);
+ }
+
+ /**
+ * @return authenticationMechanismType
+ */
+ @Override
+ public XsdString getAuthenticationMechanismType()
+ {
+ return authenticationMechanismType;
+ }
+
+ /**
+ * @return credentialInterface
+ */
+ @Override
+ public CredentialInterfaceEnum getCredentialInterface()
+ {
+ return credentialInterface;
+ }
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((authenticationMechanismType == null) ? 0 : authenticationMechanismType.hashCode());
+ result = prime * result + ((credentialInterface == null) ? 0 : credentialInterface.hashCode());
+ result = prime * result + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.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 AuthenticationMechanismImpl))
+ {
+ return false;
+ }
+ AuthenticationMechanismImpl other = (AuthenticationMechanismImpl) obj;
+ if (authenticationMechanismType == null)
+ {
+ if (other.authenticationMechanismType != null)
+ {
+ return false;
+ }
+ }
+ else if (!authenticationMechanismType.equals(other.authenticationMechanismType))
+ {
+ return false;
+ }
+ if (credentialInterface != other.credentialInterface)
+ {
+ return false;
+ }
+ if (description == null)
+ {
+ if (other.description != null)
+ {
+ return false;
+ }
+ }
+ else if (!description.equals(other.description))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "AuthenticationMechanism [description=" + description + ", authenticationMechanismType="
+ + authenticationMechanismType + ", credentialInterface=" + credentialInterface + ", id=" + id + "]";
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConfigPropertyImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/ConfigPropertyImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConfigPropertyImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConfigPropertyImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,146 @@
+/*
+ * 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.ra.common;
+
+
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.IdDecoratedMetadata;
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ *
+ * A ConfigProperty.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class ConfigPropertyImpl implements IdDecoratedMetadata, ConfigProperty
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 4840388990647778928L;
+
+ /**
+ * description
+ */
+ protected final List<LocalizedXsdString> description;
+
+ /**
+ * configPropertyName
+ */
+ protected final XsdString configPropertyName;
+
+ /**
+ * configPropertyType
+ */
+ protected final XsdString configPropertyType;
+
+ /**
+ * configPropertyValue
+ */
+ protected final XsdString configPropertyValue;
+
+ /**
+ * id
+ */
+ protected final String id;
+
+ /**
+ * Create a new ConfigProperty15.
+ *
+ * @param description the description
+ * @param configPropertyName name of config-property
+ * @param configPropertyType type of config-property
+ * @param configPropertyValue value of config-property
+ * @param id id attribute in xml file
+ */
+ public ConfigPropertyImpl(List<LocalizedXsdString> description, XsdString configPropertyName,
+ XsdString configPropertyType, XsdString configPropertyValue, String id)
+ {
+ super();
+ this.description = description;
+ this.configPropertyName = configPropertyName;
+ this.configPropertyType = configPropertyType;
+ this.configPropertyValue = configPropertyValue;
+ this.id = id;
+ }
+
+ /**
+ * @return description
+ */
+ @Override
+ public List<LocalizedXsdString> getDescriptions()
+ {
+ return description == null ? null : Collections.unmodifiableList(description);
+ }
+
+ /**
+ * @return configPropertyName
+ */
+ @Override
+ public XsdString getConfigPropertyName()
+ {
+ return configPropertyName;
+ }
+
+ /**
+ * @return configPropertyType
+ */
+ @Override
+ public XsdString getConfigPropertyType()
+ {
+ return configPropertyType;
+ }
+
+ /**
+ * @return configPropertyValue
+ */
+ @Override
+ public XsdString getConfigPropertyValue()
+ {
+ return configPropertyValue;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see IdDecoratedMetadata#getId()
+ */
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ @Override
+ public boolean isValueSet()
+ {
+ return (this.getConfigPropertyValue() != null && this.getConfigPropertyValue().getValue() != null && !this
+ .getConfigPropertyValue().getValue().trim().equals(""));
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectionDefinitionImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/ConnectionDefinitionImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectionDefinitionImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectionDefinitionImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,314 @@
+/*
+ * 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.ra.common;
+
+
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.ConnectionDefinition;
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.metadata.MergeUtil;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class ConnectionDefinitionImpl implements ConnectionDefinition
+{
+ /**
+ */
+ private static final long serialVersionUID = 197264648585424765L;
+
+ private final XsdString managedconnectionfactoryClass;
+
+ private final List<? extends ConfigProperty> configProperty;
+
+ private final XsdString connectionfactoryInterface;
+
+ private final XsdString connectionfactoryImplClass;
+
+ private final XsdString connectionInterface;
+
+ private final XsdString connectionImplClass;
+
+ private final String id;
+
+ /**
+ * @param managedconnectionfactoryClass full qualified name of the class
+ * @param configProperty List of configproperties
+ * @param connectionfactoryInterface full qualified name of the factory interface
+ * @param connectionfactoryImplClass full qualified name of the factory implementation class
+ * @param connectionInterface full qualified name of the connection interface
+ * @param connectionImplClass full qualified name of the connection implementation class
+ * @param id XML ID
+ */
+ public ConnectionDefinitionImpl(XsdString managedconnectionfactoryClass,
+ List<? extends ConfigProperty> configProperty,
+ XsdString connectionfactoryInterface, XsdString connectionfactoryImplClass, XsdString connectionInterface,
+ XsdString connectionImplClass, String id)
+ {
+ super();
+ this.managedconnectionfactoryClass = managedconnectionfactoryClass;
+ this.configProperty = configProperty;
+ this.connectionfactoryInterface = connectionfactoryInterface;
+ this.connectionfactoryImplClass = connectionfactoryImplClass;
+ this.connectionInterface = connectionInterface;
+ this.connectionImplClass = connectionImplClass;
+ this.id = id;
+ }
+
+ /**
+ * @return managedconnectionfactoryClass
+ */
+ @Override
+ public XsdString getManagedconnectionfactoryClass()
+ {
+ return managedconnectionfactoryClass;
+ }
+
+ /**
+ * @return configProperty
+ */
+ @Override
+ public List<? extends ConfigProperty> getConfigProperties()
+ {
+ return configProperty == null ? null : Collections.unmodifiableList(configProperty);
+ }
+
+ /**
+ * @return connectionfactoryInterface
+ */
+ @Override
+ public XsdString getConnectionfactoryInterface()
+ {
+ return connectionfactoryInterface;
+ }
+
+ /**
+ * @return connectionfactoryImplClass
+ */
+ @Override
+ public XsdString getConnectionfactoryImplClass()
+ {
+ return connectionfactoryImplClass;
+ }
+
+ /**
+ * @return connectionInterface
+ */
+ @Override
+ public XsdString getConnectionInterface()
+ {
+ return connectionInterface;
+ }
+
+ /**
+ * @return connectionImplClass
+ */
+ @Override
+ public XsdString getConnectionImplClass()
+ {
+ return connectionImplClass;
+ }
+
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((configProperty == null) ? 0 : configProperty.hashCode());
+ result = prime * result + ((connectionImplClass == null) ? 0 : connectionImplClass.hashCode());
+ result = prime * result + ((connectionInterface == null) ? 0 : connectionInterface.hashCode());
+ result = prime * result + ((connectionfactoryImplClass == null) ? 0 : connectionfactoryImplClass.hashCode());
+ result = prime * result + ((connectionfactoryInterface == null) ? 0 : connectionfactoryInterface.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result
+ + ((managedconnectionfactoryClass == null) ? 0 : managedconnectionfactoryClass.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 ConnectionDefinitionImpl))
+ {
+ return false;
+ }
+ ConnectionDefinitionImpl other = (ConnectionDefinitionImpl) obj;
+ if (configProperty == null)
+ {
+ if (other.configProperty != null)
+ {
+ return false;
+ }
+ }
+ else if (!configProperty.equals(other.configProperty))
+ {
+ return false;
+ }
+ if (connectionImplClass == null)
+ {
+ if (other.connectionImplClass != null)
+ {
+ return false;
+ }
+ }
+ else if (!connectionImplClass.equals(other.connectionImplClass))
+ {
+ return false;
+ }
+ if (connectionInterface == null)
+ {
+ if (other.connectionInterface != null)
+ {
+ return false;
+ }
+ }
+ else if (!connectionInterface.equals(other.connectionInterface))
+ {
+ return false;
+ }
+ if (connectionfactoryImplClass == null)
+ {
+ if (other.connectionfactoryImplClass != null)
+ {
+ return false;
+ }
+ }
+ else if (!connectionfactoryImplClass.equals(other.connectionfactoryImplClass))
+ {
+ return false;
+ }
+ if (connectionfactoryInterface == null)
+ {
+ if (other.connectionfactoryInterface != null)
+ {
+ return false;
+ }
+ }
+ else if (!connectionfactoryInterface.equals(other.connectionfactoryInterface))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ if (managedconnectionfactoryClass == null)
+ {
+ if (other.managedconnectionfactoryClass != null)
+ {
+ return false;
+ }
+ }
+ else if (!managedconnectionfactoryClass.equals(other.managedconnectionfactoryClass))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "ConnectionDefinition [managedconnectionfactoryClass=" + managedconnectionfactoryClass
+ + ", configProperty=" + configProperty + ", connectionfactoryInterface=" + connectionfactoryInterface
+ + ", connectionfactoryImplClass=" + connectionfactoryImplClass + ", connectionInterface="
+ + connectionInterface + ", connectionImplClass=" + connectionImplClass + ", id=" + id + "]";
+ }
+
+ @Override
+ public ConnectionDefinition merge(MergeableMetadata<?> jmd) throws Exception
+ {
+ if (jmd instanceof ConnectionDefinitionImpl)
+ {
+ ConnectionDefinitionImpl input = (ConnectionDefinitionImpl) jmd;
+
+ List<? extends ConfigProperty> newConfigProperty = MergeUtil.mergeConfigList(this.configProperty,
+ input.configProperty);
+ XsdString newManagedconnectionfactoryClass = this.managedconnectionfactoryClass == null
+ ? input.managedconnectionfactoryClass
+ : this.managedconnectionfactoryClass;
+ XsdString newConnectionInterface = this.connectionInterface == null
+ ? input.connectionInterface
+ : this.connectionInterface;
+ XsdString newConnectionfactoryImplClass = this.connectionfactoryImplClass == null
+ ? input.connectionfactoryImplClass
+ : this.connectionfactoryImplClass;
+ XsdString newConnectionfactoryInterface = this.connectionfactoryInterface == null
+ ? input.connectionfactoryInterface
+ : this.connectionfactoryInterface;
+ String newId = this.id == null ? input.id : this.id;
+ XsdString newConnectionImplClass = this.connectionImplClass == null
+ ? input.connectionImplClass
+ : this.connectionImplClass;
+ return new ConnectionDefinitionImpl(newManagedconnectionfactoryClass, newConfigProperty,
+ newConnectionfactoryInterface, newConnectionfactoryImplClass, newConnectionInterface,
+ newConnectionImplClass, newId);
+ }
+ else
+ {
+ return this;
+ }
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/ConnectorAbstractmpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectorAbstractmpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,389 @@
+/*
+ * 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.ra.common;
+
+import org.jboss.jca.common.api.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.Connector;
+import org.jboss.jca.common.api.metadata.ra.LicenseType;
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.OverrideElementAttribute;
+import org.jboss.jca.common.api.metadata.ra.RaConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra10.Connector10;
+import org.jboss.jca.common.api.metadata.ra.ra16.Activationspec16;
+import org.jboss.jca.common.api.metadata.ra.ra16.Connector16;
+import org.jboss.jca.common.validator.ValidateException;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ *
+ * A Connector.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public abstract class ConnectorAbstractmpl implements Connector
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -2054156739973617322L;
+
+ /**
+ * vendor name
+ */
+ protected final XsdString vendorName;
+
+ /**
+ * EIS type
+ */
+ protected final XsdString eisType;
+
+ /**
+ * license information
+ */
+ protected final LicenseType license;
+
+ /**
+ * resource adapter
+ */
+ protected final ResourceAdapter resourceadapter;
+
+ /**
+ * id attribute
+ */
+ protected final String id;
+
+ /**
+ * Create a new Connector.
+ *
+ * @param vendorName vandor name
+ * @param eisType tyeo of EIS
+ * @param license license information
+ * @param resourceadapter resource adapter instance
+ * @param id id attribute in xml file
+ */
+ protected ConnectorAbstractmpl(XsdString vendorName, XsdString eisType, LicenseType license,
+ ResourceAdapter resourceadapter, String id)
+ {
+ super();
+ this.vendorName = vendorName;
+ this.eisType = eisType;
+ this.license = license;
+ this.resourceadapter = resourceadapter;
+ this.id = id;
+ }
+
+ /**
+ * Get the vendorName.
+ *
+ * @return the vendorName.
+ */
+ @Override
+ public XsdString getVendorName()
+ {
+ return vendorName;
+ }
+
+ /**
+ * Get the eisType.
+ *
+ * @return the eisType.
+ */
+ @Override
+ public XsdString getEisType()
+ {
+ return eisType;
+ }
+
+ /**
+ * Get the license.
+ *
+ * @return the license.
+ */
+ @Override
+ public LicenseType getLicense()
+ {
+ return license;
+ }
+
+ /**
+ * Get the resourceadapter.
+ *
+ * @return the resourceadapter.
+ */
+ @Override
+ public ResourceAdapter getResourceadapter()
+ {
+ return resourceadapter;
+ }
+
+ /**
+ * Get the id.
+ *
+ * @return the id.
+ */
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((eisType == null) ? 0 : eisType.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((license == null) ? 0 : license.hashCode());
+ result = prime * result + ((resourceadapter == null) ? 0 : resourceadapter.hashCode());
+ result = prime * result + ((vendorName == null) ? 0 : vendorName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof ConnectorAbstractmpl))
+ return false;
+ ConnectorAbstractmpl other = (ConnectorAbstractmpl) obj;
+ if (eisType == null)
+ {
+ if (other.eisType != null)
+ return false;
+ }
+ else if (!eisType.equals(other.eisType))
+ return false;
+ if (id == null)
+ {
+ if (other.id != null)
+ return false;
+ }
+ else if (!id.equals(other.id))
+ return false;
+ if (license == null)
+ {
+ if (other.license != null)
+ return false;
+ }
+ else if (!license.equals(other.license))
+ return false;
+ if (resourceadapter == null)
+ {
+ if (other.resourceadapter != null)
+ return false;
+ }
+ else if (!resourceadapter.equals(other.resourceadapter))
+ return false;
+ if (vendorName == null)
+ {
+ if (other.vendorName != null)
+ return false;
+ }
+ else if (!vendorName.equals(other.vendorName))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Connector [vendorName=" + vendorName + ", eisType=" + eisType + ", license=" + license
+ + ", resourceadapter=" + resourceadapter + ", id=" + id + "]";
+ }
+
+ /**
+ * Validate specification metadata
+ * @exception ValidateException Thrown if an error occurs
+ */
+ @Override
+ public void validate() throws ValidateException
+ {
+ ResourceAdapter ra = this.getResourceadapter();
+
+ //make sure all need metadata parsered and processed after annotation handle
+ if (ra == null)
+ throw new ValidateException("ResourceAdapter metadata should be defined");
+
+ //make sure ra metadata contains inbound or outbound at least
+ ra.validate();
+
+ }
+
+ /**
+ * Merge metadatas
+ * @param inputMd The metadata to merge with this
+ * @exception Exception Thrown if an error occurs
+ * @return a new immutable connector instance result of the merging
+ */
+ @Override
+ public Connector merge(MergeableMetadata<?> inputMd) throws Exception
+ {
+ {
+ if (inputMd instanceof JbossRa)
+ {
+ mergeJbossMetaData((JbossRa) inputMd);
+ }
+
+ return this;
+
+ }
+ }
+
+ /**
+ * Merge specification metadata with vendor metadata
+ *
+ * @param jmd the vendor metadata
+ */
+ protected void mergeJbossMetaData(JbossRa jmd)
+ {
+ if (jmd != null)
+ {
+ /*
+ <xs:restriction base="javaee:string">
+ <xs:enumeration value="connection-definition"/>
+ <xs:enumeration value="resourceadapter"/>
+ <xs:enumeration value="activationspec"/>
+ <xs:enumeration value="adminobject"/>
+ </xs:restriction>
+ */
+
+ List<RaConfigProperty<?>> props = jmd.getRaConfigProperties();
+
+ List<ConfigProperty> append = null;
+
+ if (props != null)
+ {
+ for (RaConfigProperty<?> rcmd : props)
+ {
+ List<? extends ConfigProperty> listConfigProp = null;
+ OverrideElementAttribute override = rcmd.getOverrideElementAttribute();
+ if (override == OverrideElementAttribute.UNKNOWN
+ || override == OverrideElementAttribute.RESOURCE_ADAPTER)
+ {
+ if (this.getResourceadapter() != null)
+ {
+ listConfigProp = this.getResourceadapter().getConfigProperties();
+ }
+ }
+ else if (override == OverrideElementAttribute.CONNECTION_DEFINITION)
+ {
+ if (this.getResourceadapter() != null
+ && !(this instanceof Connector10)
+ && ((ResourceAdapter1516) this.getResourceadapter()).getOutboundResourceadapter() != null
+ && ((ResourceAdapter1516) this.getResourceadapter()).getOutboundResourceadapter()
+ .getConnectionDefinitions() != null
+ && ((ResourceAdapter1516) this.getResourceadapter()).getOutboundResourceadapter()
+ .getConnectionDefinitions().size() > 0
+ && ((ResourceAdapter1516) this.getResourceadapter()).getOutboundResourceadapter()
+ .getConnectionDefinitions().get(0) != null)
+ {
+ listConfigProp = ((ResourceAdapter1516) this.getResourceadapter()).getOutboundResourceadapter()
+ .getConnectionDefinitions().get(0).getConfigProperties();
+ }
+ }
+ else if (override == OverrideElementAttribute.ACTIVATIONSPEC)
+ {
+ if (this.getResourceadapter() != null
+ && (this instanceof Connector16)
+ && ((ResourceAdapter1516) this.getResourceadapter()).getInboundResourceadapter() != null
+ && ((ResourceAdapter1516) this.getResourceadapter()).getInboundResourceadapter()
+ .getMessageadapter() != null
+ && ((ResourceAdapter1516) this.getResourceadapter()).getInboundResourceadapter()
+ .getMessageadapter().getMessagelisteners() != null
+ && ((ResourceAdapter1516) this.getResourceadapter()).getInboundResourceadapter()
+ .getMessageadapter().getMessagelisteners().size() > 0
+ && ((ResourceAdapter1516) this.getResourceadapter()).getInboundResourceadapter()
+ .getMessageadapter().getMessagelisteners().get(0) != null
+ && ((ResourceAdapter1516) this.getResourceadapter()).getInboundResourceadapter()
+ .getMessageadapter().getMessagelisteners().get(0).getActivationspec() != null)
+ {
+ listConfigProp = ((Activationspec16) ((ResourceAdapter1516) this.getResourceadapter())
+ .getInboundResourceadapter()
+ .getMessageadapter().getMessagelisteners().get(0).getActivationspec()).getConfigProperties();
+ }
+ }
+ else if (override == OverrideElementAttribute.ADMINOBJECT)
+ {
+ if (this.getResourceadapter() != null
+ && !(this instanceof Connector10)
+ && ((ResourceAdapter1516) this.getResourceadapter()).getAdminobjects() != null
+ && ((ResourceAdapter1516) this.getResourceadapter()).getAdminobjects().size() > 0
+ && ((ResourceAdapter1516) this.getResourceadapter()).getAdminobjects().get(0) != null)
+ {
+ listConfigProp = ((ResourceAdapter1516) this.getResourceadapter()).getAdminobjects().get(0)
+ .getConfigProperties();
+ }
+ }
+
+ boolean found = false;
+
+ if (listConfigProp != null)
+ {
+ Iterator<? extends ConfigProperty> it = listConfigProp.iterator();
+
+ while (!found && it.hasNext())
+ {
+ ConfigProperty cpmd = it.next();
+ if (cpmd.getConfigPropertyName().getValue().equals(rcmd.getName())
+ && cpmd.getConfigPropertyType().getValue().equals(rcmd.getTypeName()))
+ {
+ found = true;
+ }
+ }
+ }
+
+ if (!found)
+ {
+ if (append == null)
+ append = new ArrayList<ConfigProperty>();
+
+ ConfigProperty cpmd = new ConfigPropertyImpl(null, new XsdString(rcmd.getName(), null),
+ new XsdString(
+ rcmd.getTypeName(), null), new XsdString(rcmd.getValue().toString(), null), null);
+
+ append.add(cpmd);
+ }
+ }
+
+ if (append != null)
+ {
+ for (ConfigProperty cpmd : append)
+ {
+ ((List<ConfigProperty>) this.getResourceadapter().getConfigProperties()).add(cpmd);
+ }
+ }
+ }
+ }
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/InboundResourceAdapterImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/InboundResourceAdapterImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/InboundResourceAdapterImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/InboundResourceAdapterImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,183 @@
+/*
+ * 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.ra.common;
+
+import org.jboss.jca.common.api.metadata.ra.InboundResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.MessageListener;
+import org.jboss.jca.common.api.metadata.ra.Messageadapter;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class InboundResourceAdapterImpl implements InboundResourceAdapter
+{
+ /**
+ */
+ private static final long serialVersionUID = -2854927981408307535L;
+
+ private final Messageadapter messageadapter;
+
+ private final String id;
+
+ /**
+ * @param messageadapter The messageadapterType specifies information about the
+ * messaging capabilities of the resource adapter. This
+ * contains information specific to the implementation of the
+ * resource adapter library as specified through the
+ * messagelistener element.
+ * @param id XML ID
+ */
+ public InboundResourceAdapterImpl(Messageadapter messageadapter, String id)
+ {
+ super();
+ this.messageadapter = messageadapter;
+ this.id = id;
+ }
+
+ /**
+ * @return messageadapter
+ */
+ @Override
+ public Messageadapter getMessageadapter()
+ {
+ return messageadapter;
+ }
+
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((messageadapter == null) ? 0 : messageadapter.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 InboundResourceAdapterImpl))
+ {
+ return false;
+ }
+ InboundResourceAdapterImpl other = (InboundResourceAdapterImpl) obj;
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ if (messageadapter == null)
+ {
+ if (other.messageadapter != null)
+ {
+ return false;
+ }
+ }
+ else if (!messageadapter.equals(other.messageadapter))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "InboundResourceAdapter [messageadapter=" + messageadapter + ", id=" + id + "]";
+ }
+
+ /**
+ *
+ * A validate method. Don't extending for the moment ValidatableMetadata
+ *
+ * @return true if Ra is valid, flase in the other cases
+ */
+ @Override
+ public boolean validationAsBoolean()
+ {
+ if (this.getMessageadapter() == null || this.getMessageadapter().getMessagelisteners() == null
+ || this.getMessageadapter().getMessagelisteners().size() == 0)
+ return false;
+ MessageListener mlmd = this.getMessageadapter().getMessagelisteners().get(0);
+ if (mlmd.getMessagelistenerType() == null || mlmd.getActivationspec() == null
+ || mlmd.getActivationspec().getActivationspecClass() == null)
+ return false;
+ return true;
+ }
+
+ @Override
+ public InboundResourceAdapter merge(MergeableMetadata<?> jmd) throws Exception
+ {
+ if (jmd instanceof InboundResourceAdapterImpl)
+ {
+ InboundResourceAdapterImpl input = (InboundResourceAdapterImpl) jmd;
+ String newId = this.id == null ? input.id : this.id;
+
+ Messageadapter newMessageadapter = this.messageadapter == null ? input.messageadapter : this.messageadapter
+ .merge(input.messageadapter);
+ return new InboundResourceAdapterImpl(newMessageadapter, newId);
+ }
+ else
+ {
+ return this;
+ }
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageAdapterImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/MessageAdapterImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageAdapterImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageAdapterImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,170 @@
+/*
+ * 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.ra.common;
+
+
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.MessageListener;
+import org.jboss.jca.common.api.metadata.ra.Messageadapter;
+import org.jboss.jca.common.metadata.MergeUtil;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class MessageAdapterImpl implements Messageadapter
+{
+ /**
+ */
+ private static final long serialVersionUID = 1731250340667920811L;
+
+ private final List<MessageListener> messagelisteners;
+
+ private final String id;
+
+ /**
+ * @param messagelisteners messagelisteners specifies information about a
+ * specific message listener supported by the messaging
+ * resource adapter. It contains information on the Java type
+ * of the message listener interface and an activation
+ * specification.
+ * @param id XML ID
+ */
+ public MessageAdapterImpl(List<MessageListener> messagelisteners, String id)
+ {
+ super();
+ this.messagelisteners = messagelisteners;
+ this.id = id;
+ }
+
+ /**
+ * @return messagelistener
+ */
+ @Override
+ public List<MessageListener> getMessagelisteners()
+ {
+ return messagelisteners == null ? null : Collections.unmodifiableList(messagelisteners);
+ }
+
+
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((messagelisteners == null) ? 0 : messagelisteners.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 MessageAdapterImpl))
+ {
+ return false;
+ }
+ MessageAdapterImpl other = (MessageAdapterImpl) obj;
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ if (messagelisteners == null)
+ {
+ if (other.messagelisteners != null)
+ {
+ return false;
+ }
+ }
+ else if (!messagelisteners.equals(other.messagelisteners))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "MessageAdapter [messagelisteners=" + messagelisteners + ", id=" + id + "]";
+ }
+
+ @Override
+ public Messageadapter merge(MergeableMetadata<?> jmd) throws Exception
+ {
+ if (jmd instanceof MessageAdapterImpl)
+ {
+ MessageAdapterImpl input = (MessageAdapterImpl) jmd;
+
+ String newId = this.id == null ? input.id : this.id;
+
+ List<MessageListener> newMessagelistener = MergeUtil.mergeList(this.messagelisteners,
+ input.messagelisteners);
+ return new MessageAdapterImpl(newMessagelistener, newId);
+ }
+ else
+ {
+ return this;
+ }
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageListenerImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/MessageListenerImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageListenerImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageListenerImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,171 @@
+/*
+ * 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.ra.common;
+
+import org.jboss.jca.common.api.metadata.ra.MessageListener;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra15.Activationspec15;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class MessageListenerImpl implements MessageListener
+{
+ /**
+ */
+ private static final long serialVersionUID = 6417807206318228618L;
+
+ private final XsdString messagelistenerType;
+
+ private final Activationspec15 activationspec;
+
+ private final String id;
+
+ /**
+ * @param messagelistenerType full qualified name of the java type
+ * @param activationspec The activationspecType specifies an activation
+ * specification. The information includes fully qualified
+ * Java class name of an activation specification and a set of
+ * required configuration property names.
+ * @param id XML ID
+ */
+ public MessageListenerImpl(XsdString messagelistenerType, Activationspec15 activationspec, String id)
+ {
+ super();
+ this.messagelistenerType = messagelistenerType;
+ this.activationspec = activationspec;
+ this.id = id;
+ }
+
+ /**
+ * @return messagelistenerType
+ */
+ @Override
+ public XsdString getMessagelistenerType()
+ {
+ return messagelistenerType;
+ }
+
+ /**
+ * @return activationspec
+ */
+ @Override
+ public Activationspec15 getActivationspec()
+ {
+ return activationspec;
+ }
+
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((activationspec == null) ? 0 : activationspec.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((messagelistenerType == null) ? 0 : messagelistenerType.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 MessageListenerImpl))
+ {
+ return false;
+ }
+ MessageListenerImpl other = (MessageListenerImpl) obj;
+ if (activationspec == null)
+ {
+ if (other.activationspec != null)
+ {
+ return false;
+ }
+ }
+ else if (!activationspec.equals(other.activationspec))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ if (messagelistenerType == null)
+ {
+ if (other.messagelistenerType != null)
+ {
+ return false;
+ }
+ }
+ else if (!messagelistenerType.equals(other.messagelistenerType))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "MessageListener [messagelistenerType=" + messagelistenerType + ", activationspec=" + activationspec
+ + ", id=" + id + "]";
+ }
+
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/OutboundResourceAdapterImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/OutboundResourceAdapterImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/OutboundResourceAdapterImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/OutboundResourceAdapterImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,274 @@
+/*
+ * 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.ra.common;
+
+import org.jboss.jca.common.api.metadata.ra.AuthenticationMechanism;
+import org.jboss.jca.common.api.metadata.ra.ConnectionDefinition;
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.OutboundResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.TransactionSupportEnum;
+import org.jboss.jca.common.metadata.MergeUtil;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class OutboundResourceAdapterImpl implements OutboundResourceAdapter
+{
+ /**
+ */
+ private static final long serialVersionUID = 421345307326415666L;
+
+ private final List<ConnectionDefinition> connectionDefinition;
+
+ private final TransactionSupportEnum transactionSupport;
+
+ private final List<AuthenticationMechanism> authenticationMechanism;
+
+ private final boolean reauthenticationSupport;
+
+ private final String id;
+
+ /**
+ * @param connectionDefinition list of connection definitions
+ * @param transactionSupport transaction supported form this RA. Valid ones are defined by an enum
+ * @param authenticationMechanism list of authentication mechanism supported
+ * @param reauthenticationSupport not mandatary boolean value
+ * @param id XML ID
+ */
+ public OutboundResourceAdapterImpl(List<ConnectionDefinition> connectionDefinition,
+ TransactionSupportEnum transactionSupport, List<AuthenticationMechanism> authenticationMechanism,
+ boolean reauthenticationSupport, String id)
+ {
+ super();
+ this.connectionDefinition = connectionDefinition;
+ this.transactionSupport = transactionSupport;
+ this.authenticationMechanism = authenticationMechanism;
+ this.reauthenticationSupport = reauthenticationSupport;
+ this.id = id;
+ }
+
+ /**
+ * @return connectionDefinition
+ */
+ @Override
+ public List<ConnectionDefinition> getConnectionDefinitions()
+ {
+ return connectionDefinition == null ? null : Collections.unmodifiableList(connectionDefinition);
+ }
+
+ /**
+ * @return transactionSupport
+ */
+ @Override
+ public TransactionSupportEnum getTransactionSupport()
+ {
+ return transactionSupport;
+ }
+
+ /**
+ * @return authenticationMechanism
+ */
+ @Override
+ public List<AuthenticationMechanism> getAuthenticationMechanisms()
+ {
+ return authenticationMechanism == null ? null : Collections.unmodifiableList(authenticationMechanism);
+ }
+
+ /**
+ * @return reauthenticationSupport
+ */
+ @Override
+ public boolean getReauthenticationSupport()
+ {
+ return reauthenticationSupport;
+ }
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((authenticationMechanism == null) ? 0 : authenticationMechanism.hashCode());
+ result = prime * result + ((connectionDefinition == null) ? 0 : connectionDefinition.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((transactionSupport == null) ? 0 : transactionSupport.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 OutboundResourceAdapterImpl))
+ {
+ return false;
+ }
+ OutboundResourceAdapterImpl other = (OutboundResourceAdapterImpl) obj;
+ if (authenticationMechanism == null)
+ {
+ if (other.authenticationMechanism != null)
+ {
+ return false;
+ }
+ }
+ else if (!authenticationMechanism.equals(other.authenticationMechanism))
+ {
+ return false;
+ }
+ if (connectionDefinition == null)
+ {
+ if (other.connectionDefinition != null)
+ {
+ return false;
+ }
+ }
+ else if (!connectionDefinition.equals(other.connectionDefinition))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ if (reauthenticationSupport != other.reauthenticationSupport)
+ {
+ return false;
+ }
+ if (transactionSupport != other.transactionSupport)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "OutboundResourceAdapter [connectionDefinition=" + connectionDefinition + ", transactionSupport="
+ + transactionSupport + ", authenticationMechanism=" + authenticationMechanism
+ + ", reauthenticationSupport=" + reauthenticationSupport + ", id=" + id + "]";
+ }
+
+ /**
+ *
+ * A validate method. Don't extending for the moment ValidatableMetadata
+ *
+ * @return true if Ra is valid, flase in the other cases
+ */
+ @Override
+ public boolean validationAsBoolean()
+ {
+ if (this.getConnectionDefinitions() == null || this.getConnectionDefinitions().size() == 0)
+ return false;
+ ConnectionDefinition cdm = this.getConnectionDefinitions().get(0);
+ if (cdm.getManagedconnectionfactoryClass() == null || cdm.getConnectionfactoryInterface() == null
+ || cdm.getConnectionfactoryImplClass() == null || cdm.getConnectionInterface() == null
+ || cdm.getConnectionImplClass() == null)
+ return false;
+
+ return true;
+ }
+
+ @Override
+ public OutboundResourceAdapter merge(MergeableMetadata<?> jmd) throws Exception
+ {
+ if (jmd instanceof OutboundResourceAdapterImpl)
+ {
+ OutboundResourceAdapterImpl input = (OutboundResourceAdapterImpl) jmd;
+
+ String newId = this.id == null ? input.id : this.id;
+
+ List<ConnectionDefinition> newConnectionDefinition = new ArrayList<ConnectionDefinition>(
+ this.connectionDefinition.size());
+
+ newConnectionDefinition.addAll(this.connectionDefinition);
+ for (ConnectionDefinition rcd : input.connectionDefinition)
+ {
+ boolean isNew = true;
+ for (ConnectionDefinition lcd : this.connectionDefinition)
+ {
+ if (rcd.getManagedconnectionfactoryClass().equals(lcd.getManagedconnectionfactoryClass()))
+ {
+ newConnectionDefinition.remove(lcd);
+ newConnectionDefinition.add(lcd.merge(rcd));
+ isNew = false;
+ }
+ }
+ if (isNew) newConnectionDefinition.add(rcd);
+ }
+
+ TransactionSupportEnum newTransactionSupport = this.transactionSupport;
+
+ boolean newReauthenticationSupport = this.reauthenticationSupport || input.reauthenticationSupport;
+ List<AuthenticationMechanism> newAuthenticationMechanism = MergeUtil.mergeList(
+ this.authenticationMechanism,
+ input.authenticationMechanism);
+ return new OutboundResourceAdapterImpl(newConnectionDefinition, newTransactionSupport,
+ newAuthenticationMechanism, newReauthenticationSupport, newId);
+ }
+ else
+ {
+ return this;
+ }
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/RaConfigPropertyImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/RaConfigPropertyImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/RaConfigPropertyImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/RaConfigPropertyImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,275 @@
+/*
+ * 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.ra.common;
+
+import org.jboss.jca.common.api.metadata.ra.OverrideElementAttribute;
+import org.jboss.jca.common.api.metadata.ra.RaConfigProperty;
+import org.jboss.jca.common.metadata.JCAMetadata;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ * @param <T> generic type of this property.
+ * See {@link #buildRaConfigProperty(String, String, String, OverrideElementAttribute))}
+ * for build right implementation
+ *
+ */
+public class RaConfigPropertyImpl<T> implements JCAMetadata, RaConfigProperty<T>
+{
+
+ /**
+ */
+ private static final long serialVersionUID = 7845799671062777306L;
+
+ private final String name;
+
+ private final T value;
+
+ private final String typeName;
+
+ private final OverrideElementAttribute overrideElementAttribute;
+
+ /**
+ * @param name the name of the property
+ * @param value the value of the property
+ * @param overrideElementAttribute the override-element attribute
+ */
+ private RaConfigPropertyImpl(String name, T value, OverrideElementAttribute overrideElementAttribute)
+ {
+ super();
+ this.name = name;
+ this.value = value;
+ this.typeName = value.getClass().getName();
+ this.overrideElementAttribute = overrideElementAttribute == null
+ ? OverrideElementAttribute.RESOURCE_ADAPTER
+ : overrideElementAttribute;
+ }
+
+ /**
+ * @param name the name of the property
+ * @param value the value of the property
+ * @param typeName full qualified name of value's type
+ * @param overrideElementAttribute the override-element attribute
+ */
+ private RaConfigPropertyImpl(String name, T value, String typeName,
+ OverrideElementAttribute overrideElementAttribute)
+ {
+ super();
+ this.name = name;
+ this.value = value;
+ this.typeName = typeName;
+ this.overrideElementAttribute = overrideElementAttribute == null
+ ? OverrideElementAttribute.RESOURCE_ADAPTER
+ : overrideElementAttribute;
+ }
+
+ /**
+ *
+ * Static method to build actualised implementation of this generic class.
+ * According to jboss-ra_2_0.xsd value values are:
+ * java.lang.Boolean
+ * java.lang.String
+ * java.lang.Integer
+ * java.lang.Double
+ * java.lang.Byte
+ * java.lang.Short
+ * java.lang.Long
+ * java.lang.Float
+ * java.lang.Character
+ *
+ * In case passed type is one of above ones a correct actualised {@link RaConfigPropertyImpl} 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
+ * @return the actualised instance
+ * @param overrideElementAttribute the override-element attribute. Possible value are defined in the enumeration;
+ * if it is null the default RESOURCEADAPTER is used
+ * @throws NumberFormatException in case passed value isn't assignable to type class
+ */
+ public static RaConfigProperty<?> buildRaConfigProperty(String name, String value, String type,
+ OverrideElementAttribute overrideElementAttribute) throws NumberFormatException
+ {
+ if (type == null || type.trim().length() == 0)
+ {
+ return new RaConfigPropertyImpl<String>(name, value, overrideElementAttribute);
+ }
+ if ("java.lang.Boolean".equals(type))
+ {
+ return new RaConfigPropertyImpl<Boolean>(name, Boolean.valueOf(value), overrideElementAttribute);
+ }
+ else if ("java.lang.String".equals(type))
+ {
+ return new RaConfigPropertyImpl<String>(name, value, overrideElementAttribute);
+ }
+ else if ("java.lang.Integer".equals(type))
+ {
+ return new RaConfigPropertyImpl<Integer>(name, Integer.valueOf(value), overrideElementAttribute);
+ }
+ else if ("java.lang.Double".equals(type))
+ {
+ return new RaConfigPropertyImpl<Double>(name, Double.valueOf(value), overrideElementAttribute);
+ }
+ else if ("java.lang.Byte".equals(type))
+ {
+ return new RaConfigPropertyImpl<Byte>(name, Byte.valueOf(value), overrideElementAttribute);
+ }
+ else if ("java.lang.Long".equals(type))
+ {
+ return new RaConfigPropertyImpl<Long>(name, Long.valueOf(value), overrideElementAttribute);
+ }
+ else if ("java.lang.Float".equals(type))
+ {
+ return new RaConfigPropertyImpl<Float>(name, Float.valueOf(value), overrideElementAttribute);
+ }
+ else if ("java.lang.Character".equals(type))
+ {
+ return new RaConfigPropertyImpl<Character>(name, Character.valueOf(value.charAt(0)), overrideElementAttribute);
+ }
+ else
+ {
+ return new RaConfigPropertyImpl<Object>(name, value, type, overrideElementAttribute);
+ }
+
+ }
+
+ /**
+ * @return name
+ */
+ @Override
+ public synchronized String getName()
+ {
+ return name;
+ }
+
+ /**
+ * @return value
+ */
+ @Override
+ public synchronized T getValue()
+ {
+ return value;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.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 RaConfigPropertyImpl))
+ {
+ return false;
+ }
+ RaConfigPropertyImpl other = (RaConfigPropertyImpl) obj;
+ if (name == null)
+ {
+ if (other.name != null)
+ {
+ return false;
+ }
+ }
+ else if (!name.equals(other.name))
+ {
+ return false;
+ }
+ if (value == null)
+ {
+ if (other.value != null)
+ {
+ return false;
+ }
+ }
+ else if (!value.equals(other.value))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "RaConfigProperty [name=" + name + ", value=" + value + "]";
+ }
+
+ /**
+ *
+ * typeName getter
+ *
+ * @return the typeName
+ */
+ @Override
+ public String getTypeName()
+ {
+ return typeName;
+ }
+
+ /**
+ *
+ * override-element-attribute metadata getter
+ *
+ * @return the enum instance {@link OverrideElementAttribute}
+ */
+ @Override
+ public OverrideElementAttribute getOverrideElementAttribute()
+ {
+ return overrideElementAttribute;
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/ResourceAdapter1516Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,327 @@
+/*
+ * 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.ra.common;
+
+import org.jboss.jca.common.api.metadata.ra.AdminObject;
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.InboundResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.OutboundResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
+import org.jboss.jca.common.api.metadata.ra.SecurityPermission;
+import org.jboss.jca.common.metadata.MergeUtil;
+import org.jboss.jca.common.validator.ValidateException;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class ResourceAdapter1516Impl implements ResourceAdapter1516
+{
+ /**
+ */
+ private static final long serialVersionUID = 4841095296099713549L;
+
+ private final String resourceadapterClass;
+
+ private final List<? extends ConfigProperty> configProperties;
+
+ private final OutboundResourceAdapter outboundResourceadapter;
+
+ private final InboundResourceAdapter inboundResourceadapter;
+
+ private final List<AdminObject> adminobjects;
+
+ private final List<SecurityPermission> securityPermissions;
+
+ private final String id;
+
+ /**
+ * @param resourceadapterClass full qualified name of the class
+ * @param configProperties confi properties for this RA
+ * @param outboundResourceadapter outbound RA
+ * @param inboundResourceadapter inbound RA
+ * @param adminobjects list of admin objects of this RA
+ * @param securityPermissions supported security permissions
+ * @param id XML ID
+ */
+ public ResourceAdapter1516Impl(String resourceadapterClass, List<? extends ConfigProperty> configProperties,
+ OutboundResourceAdapter outboundResourceadapter, InboundResourceAdapter inboundResourceadapter,
+ List<AdminObject> adminobjects, List<SecurityPermission> securityPermissions, String id)
+ {
+ super();
+ this.resourceadapterClass = resourceadapterClass;
+ this.configProperties = configProperties;
+ this.outboundResourceadapter = outboundResourceadapter;
+ this.inboundResourceadapter = inboundResourceadapter;
+ this.adminobjects = adminobjects;
+ this.securityPermissions = securityPermissions;
+ this.id = id;
+ }
+
+ /**
+ * @return resourceadapterClass
+ */
+ @Override
+ public String getResourceadapterClass()
+ {
+ return resourceadapterClass;
+ }
+
+ /**
+ * @return configProperty
+ */
+ @Override
+ public List<? extends ConfigProperty> getConfigProperties()
+ {
+ return configProperties == null ? null : Collections.unmodifiableList(configProperties);
+ }
+
+ /**
+ * @return outboundResourceadapter
+ */
+ @Override
+ public OutboundResourceAdapter getOutboundResourceadapter()
+ {
+ return outboundResourceadapter;
+ }
+
+ /**
+ * @return inboundResourceadapter
+ */
+ @Override
+ public InboundResourceAdapter getInboundResourceadapter()
+ {
+ return inboundResourceadapter;
+ }
+
+ /**
+ * @return adminobject
+ */
+ @Override
+ public List<AdminObject> getAdminobjects()
+ {
+ return adminobjects == null ? null : Collections.unmodifiableList(adminobjects);
+ }
+
+ /**
+ * @return securityPermission
+ */
+ @Override
+ public List<SecurityPermission> getSecurityPermissions()
+ {
+ return securityPermissions == null ? null : Collections.unmodifiableList(securityPermissions);
+ }
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((adminobjects == null) ? 0 : adminobjects.hashCode());
+ result = prime * result + ((configProperties == null) ? 0 : configProperties.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((inboundResourceadapter == null) ? 0 : inboundResourceadapter.hashCode());
+ result = prime * result + ((outboundResourceadapter == null) ? 0 : outboundResourceadapter.hashCode());
+ result = prime * result + ((resourceadapterClass == null) ? 0 : resourceadapterClass.hashCode());
+ result = prime * result + ((securityPermissions == null) ? 0 : securityPermissions.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 ResourceAdapter1516Impl))
+ {
+ return false;
+ }
+ ResourceAdapter1516Impl other = (ResourceAdapter1516Impl) obj;
+ if (adminobjects == null)
+ {
+ if (other.adminobjects != null)
+ {
+ return false;
+ }
+ }
+ else if (!adminobjects.equals(other.adminobjects))
+ {
+ return false;
+ }
+ if (configProperties == null)
+ {
+ if (other.configProperties != null)
+ {
+ return false;
+ }
+ }
+ else if (!configProperties.equals(other.configProperties))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ if (inboundResourceadapter == null)
+ {
+ if (other.inboundResourceadapter != null)
+ {
+ return false;
+ }
+ }
+ else if (!inboundResourceadapter.equals(other.inboundResourceadapter))
+ {
+ return false;
+ }
+ if (outboundResourceadapter == null)
+ {
+ if (other.outboundResourceadapter != null)
+ {
+ return false;
+ }
+ }
+ else if (!outboundResourceadapter.equals(other.outboundResourceadapter))
+ {
+ return false;
+ }
+ if (resourceadapterClass == null)
+ {
+ if (other.resourceadapterClass != null)
+ {
+ return false;
+ }
+ }
+ else if (!resourceadapterClass.equals(other.resourceadapterClass))
+ {
+ return false;
+ }
+ if (securityPermissions == null)
+ {
+ if (other.securityPermissions != null)
+ {
+ return false;
+ }
+ }
+ else if (!securityPermissions.equals(other.securityPermissions))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "ResourceAdapter [resourceadapterClass=" + resourceadapterClass + ", configProperties=" + configProperties
+ + ", outboundResourceadapter=" + outboundResourceadapter + ", inboundResourceadapter="
+ + inboundResourceadapter + ", adminobjects=" + adminobjects + ", securityPermission=" + securityPermissions
+ + ", id=" + id + "]";
+ }
+
+ @Override
+ public void validate() throws ValidateException
+ {
+ boolean inboundOrOutbound = false;
+ if (this.getOutboundResourceadapter() != null && this.getOutboundResourceadapter().validationAsBoolean())
+ inboundOrOutbound = true;
+ if (this.getInboundResourceadapter() != null && this.getInboundResourceadapter().validationAsBoolean()
+ && this.getResourceadapterClass() != null)
+ inboundOrOutbound = true;
+ if (!inboundOrOutbound)
+ throw new ValidateException("ResourceAdapter metadata should contains inbound or outbound at least");
+
+ }
+
+ @Override
+ public ResourceAdapter1516 merge(MergeableMetadata<?> jmd) throws Exception
+ {
+ if (jmd instanceof ResourceAdapter1516Impl)
+ {
+ ResourceAdapter1516Impl inputRA = (ResourceAdapter1516Impl) jmd;
+
+ InboundResourceAdapter newInboundResourceadapter = this.inboundResourceadapter == null
+ ? inputRA.inboundResourceadapter
+ : this.inboundResourceadapter
+ .merge(inputRA.inboundResourceadapter);
+
+ OutboundResourceAdapter newOutboundResourceadapter = this.outboundResourceadapter == null
+ ? inputRA.outboundResourceadapter
+ : this.outboundResourceadapter
+ .merge(inputRA.outboundResourceadapter);
+ List<SecurityPermission> newSecurityPermission = MergeUtil.mergeList(this.securityPermissions,
+ inputRA.securityPermissions);
+ List<? extends ConfigProperty> newConfigProperties = MergeUtil.mergeConfigList(
+ this.configProperties,
+ inputRA.configProperties);
+ List<AdminObject> newAdminobjects = MergeUtil.mergeList(this.adminobjects, inputRA.adminobjects);
+ String newId = this.id == null ? inputRA.id : this.id;
+ String newResourceadapterClass = this.resourceadapterClass == null
+ ? inputRA.resourceadapterClass
+ : this.resourceadapterClass;
+ return new ResourceAdapter1516Impl(newResourceadapterClass, newConfigProperties, newOutboundResourceadapter,
+ newInboundResourceadapter, newAdminobjects, newSecurityPermission, newId);
+ }
+ else
+ {
+ return this;
+ }
+ }
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/SecurityPermissionImpl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/SecurityPermissionImpl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/SecurityPermissionImpl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/SecurityPermissionImpl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,170 @@
+/*
+ * 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.ra.common;
+
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
+import org.jboss.jca.common.api.metadata.ra.SecurityPermission;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class SecurityPermissionImpl implements SecurityPermission
+{
+ /**
+ */
+ private static final long serialVersionUID = -7931009018498254330L;
+
+ private final List<LocalizedXsdString> description;
+
+ private final XsdString securityPermissionSpec;
+
+ private final String id;
+
+ /**
+ * @param description descriptions
+ * @param securityPermissionSpec the security permission spec as defined in the xml
+ * @param id XML ID
+ */
+ public SecurityPermissionImpl(List<LocalizedXsdString> description, XsdString securityPermissionSpec, String id)
+ {
+ super();
+ this.description = description;
+ this.securityPermissionSpec = securityPermissionSpec;
+ this.id = id;
+ }
+
+ /**
+ * @return description
+ */
+ @Override
+ public List<LocalizedXsdString> getDescriptions()
+ {
+ return description == null ? null : Collections.unmodifiableList(description);
+ }
+
+ /**
+ * @return securityPermissionSpec
+ */
+ @Override
+ public XsdString getSecurityPermissionSpec()
+ {
+ return securityPermissionSpec;
+ }
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((securityPermissionSpec == null) ? 0 : securityPermissionSpec.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 SecurityPermissionImpl))
+ {
+ return false;
+ }
+ SecurityPermissionImpl other = (SecurityPermissionImpl) obj;
+ if (description == null)
+ {
+ if (other.description != null)
+ {
+ return false;
+ }
+ }
+ else if (!description.equals(other.description))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ if (securityPermissionSpec == null)
+ {
+ if (other.securityPermissionSpec != null)
+ {
+ return false;
+ }
+ }
+ else if (!securityPermissionSpec.equals(other.securityPermissionSpec))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "SecurityPermission [description=" + description + ", securityPermissionSpec=" + securityPermissionSpec
+ + ", id=" + id + "]";
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/common/package.html)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/package.html (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/package.html 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains metadatas common for connector-*.xsd
+</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/package.html)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/package.html (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/package.html 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains common metadatas fand parser for connector_1_*.xsd
+</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra10/Connector10Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,201 @@
+/*
+ * 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.ra.ra10;
+
+import org.jboss.jca.common.api.metadata.ra.Icon;
+import org.jboss.jca.common.api.metadata.ra.LicenseType;
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra10.Connector10;
+import org.jboss.jca.common.metadata.ra.common.ConnectorAbstractmpl;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public final class Connector10Impl extends ConnectorAbstractmpl implements Connector10
+{
+
+ /**
+ */
+ private static final long serialVersionUID = -6095735191032372517L;
+
+ private final String moduleName;
+
+ private final List<LocalizedXsdString> description;
+
+ private final XsdString displayName;
+
+ private final List<Icon> icon;
+
+ /**
+ * @param moduleName name of the module
+ * @param description descriptions of this connector
+ * @param displayName name to display for this connecotro
+ * @param icon icon representing this connectore
+ * @param vendorName vendor name
+ * @param eisType eis type
+ * @param resourceadapterVersion version number for the RA
+ * @param license license information
+ * @param resourceadapter full qualified name of the resource adapter
+ * @param id XML ID
+ */
+ public Connector10Impl(String moduleName, List<LocalizedXsdString> description, XsdString displayName,
+ List<Icon> icon, XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
+ LicenseType license, ResourceAdapter resourceadapter, String id)
+ {
+ super(vendorName, eisType, license, resourceadapter, id);
+ this.moduleName = moduleName;
+ this.description = description;
+ this.displayName = displayName;
+ this.icon = icon;
+ }
+
+ /**
+ * @return moduleName
+ */
+ @Override
+ public String getModuleName()
+ {
+ return moduleName;
+ }
+
+ /**
+ * @return description
+ */
+ @Override
+ public List<LocalizedXsdString> getDescriptions()
+ {
+ return description == null ? null : Collections.unmodifiableList(description);
+ }
+
+ /**
+ * @return displayName
+ */
+ @Override
+ public XsdString getDisplayName()
+ {
+ return displayName;
+ }
+
+ /**
+ * @return icon
+ */
+ @Override
+ public List<Icon> getIcons()
+ {
+ return icon == null ? null : Collections.unmodifiableList(icon);
+ }
+
+ /**
+ * Get the version.
+ *
+ * @return the version.
+ */
+ @Override
+ public Version getVersion()
+ {
+ return Version.V_10;
+ }
+
+ /**
+ * Get the specVersion.
+ *
+ * @return the specVersion.
+ */
+ public Version getSpecVersion()
+ {
+ return Version.V_10;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((displayName == null) ? 0 : displayName.hashCode());
+ result = prime * result + ((icon == null) ? 0 : icon.hashCode());
+ result = prime * result + ((moduleName == null) ? 0 : moduleName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (!(obj instanceof Connector10Impl))
+ return false;
+ Connector10Impl other = (Connector10Impl) obj;
+ if (description == null)
+ {
+ if (other.description != null)
+ return false;
+ }
+ else if (!description.equals(other.description))
+ return false;
+ if (displayName == null)
+ {
+ if (other.displayName != null)
+ return false;
+ }
+ else if (!displayName.equals(other.displayName))
+ return false;
+ if (icon == null)
+ {
+ if (other.icon != null)
+ return false;
+ }
+ else if (!icon.equals(other.icon))
+ return false;
+ if (moduleName == null)
+ {
+ if (other.moduleName != null)
+ return false;
+ }
+ else if (!moduleName.equals(other.moduleName))
+ return false;
+
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Connector10 [moduleName=" + moduleName + ", description=" + description + ", displayName=" + displayName
+ + ", version=" + Version.V_10 + ", specVersion=" + Version.V_10 + ", icon=" + icon + ", vendorName="
+ + vendorName
+ + ", eisType=" + eisType + ", license=" + license + ", resourceadapter=" + resourceadapter + ", id=" + id
+ + "]";
+ }
+
+
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/ResourceAdapter10Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra10/ResourceAdapter10Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/ResourceAdapter10Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/ResourceAdapter10Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,353 @@
+/*
+ * 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.ra.ra10;
+
+import org.jboss.jca.common.api.metadata.ra.AuthenticationMechanism;
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.SecurityPermission;
+import org.jboss.jca.common.api.metadata.ra.TransactionSupportEnum;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra10.ResourceAdapter10;
+import org.jboss.jca.common.validator.ValidateException;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class ResourceAdapter10Impl implements ResourceAdapter10
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6841574517370539456L;
+
+ private final XsdString managedConnectionFactoryClass;
+
+ private final XsdString connectionFactoryInterface;
+
+ private final XsdString connectionFactoryImplClass;
+
+ private final XsdString connectionInterface;
+
+ private final XsdString connectionImplClass;
+
+ private final TransactionSupportEnum transactionSupport;
+
+ private final List<AuthenticationMechanism> authenticationMechanism;
+
+ private final List<ConfigProperty> configProperty;
+
+ private final Boolean reauthenticationSupport;
+
+ private final List<SecurityPermission> securityPermission;
+
+ private final String id;
+
+ /**
+ *
+ * Create a new ResourceAdapter10.
+ *
+ * @param managedConnectionFactoryClass class name
+ * @param connectionFactoryInterface interface name
+ * @param connectionFactoryImplClass class name
+ * @param connectionInterface interface name
+ * @param connectionImplClass class name
+ * @param transactionSupport how transactions are supported
+ * @param authenticationMechanism how authentication is performed
+ * @param configProperty list of configs
+ * @param reauthenticationSupport true if reautentication is supported
+ * @param securityPermission what security permissions are supported
+ * @param id the id attribute in xml file
+ */
+ public ResourceAdapter10Impl(XsdString managedConnectionFactoryClass, XsdString connectionFactoryInterface,
+ XsdString connectionFactoryImplClass, XsdString connectionInterface, XsdString connectionImplClass,
+ TransactionSupportEnum transactionSupport, List<AuthenticationMechanism> authenticationMechanism,
+ List<ConfigProperty> configProperty, Boolean reauthenticationSupport,
+ List<SecurityPermission> securityPermission, String id)
+ {
+ super();
+ this.managedConnectionFactoryClass = managedConnectionFactoryClass;
+ this.connectionFactoryInterface = connectionFactoryInterface;
+ this.connectionFactoryImplClass = connectionFactoryImplClass;
+ this.connectionInterface = connectionInterface;
+ this.connectionImplClass = connectionImplClass;
+ this.transactionSupport = transactionSupport;
+ this.authenticationMechanism = authenticationMechanism;
+ this.configProperty = configProperty;
+ this.reauthenticationSupport = reauthenticationSupport;
+ this.securityPermission = securityPermission;
+ this.id = id;
+ }
+
+ /**
+ * Get the managedConnectionFactoryClass.
+ *
+ * @return the managedConnectionFactoryClass.
+ */
+ @Override
+ public XsdString getManagedConnectionFactoryClass()
+ {
+ return managedConnectionFactoryClass;
+ }
+
+ /**
+ * Get the connectionFactoryInterface.
+ *
+ * @return the connectionFactoryInterface.
+ */
+ @Override
+ public XsdString getConnectionFactoryInterface()
+ {
+ return connectionFactoryInterface;
+ }
+
+ /**
+ * Get the connectionFactoryImplClass.
+ *
+ * @return the connectionFactoryImplClass.
+ */
+ @Override
+ public XsdString getConnectionFactoryImplClass()
+ {
+ return connectionFactoryImplClass;
+ }
+
+ /**
+ * Get the connectionInterface.
+ *
+ * @return the connectionInterface.
+ */
+ @Override
+ public XsdString getConnectionInterface()
+ {
+ return connectionInterface;
+ }
+
+ /**
+ * Get the connectionImplClass.
+ *
+ * @return the connectionImplClass.
+ */
+ @Override
+ public XsdString getConnectionImplClass()
+ {
+ return connectionImplClass;
+ }
+
+ /**
+ * Get the transactionSupport.
+ *
+ * @return the transactionSupport.
+ */
+ @Override
+ public TransactionSupportEnum getTransactionSupport()
+ {
+ return transactionSupport;
+ }
+
+ /**
+ * Get the authenticationMechanism.
+ *
+ * @return the authenticationMechanism.
+ */
+ @Override
+ public List<AuthenticationMechanism> getAuthenticationMechanisms()
+ {
+ return authenticationMechanism == null ? null : Collections.unmodifiableList(authenticationMechanism);
+ }
+
+ /**
+ * Get the configProperties.
+ *
+ * @return the configProperties.
+ */
+ @Override
+ public List<ConfigProperty> getConfigProperties()
+ {
+ return configProperty;
+ }
+
+ /**
+ * Get the reauthenticationSupport.
+ *
+ * @return the reauthenticationSupport.
+ */
+ @Override
+ public Boolean getReauthenticationSupport()
+ {
+ return reauthenticationSupport;
+ }
+
+ /**
+ * Get the securityPermission.
+ *
+ * @return the securityPermission.
+ */
+ @Override
+ public List<SecurityPermission> getSecurityPermissions()
+ {
+ return securityPermission == null ? null : Collections.unmodifiableList(securityPermission);
+ }
+
+ /**
+ * Get the id.
+ *
+ * @return the id.
+ */
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((authenticationMechanism == null) ? 0 : authenticationMechanism.hashCode());
+ result = prime * result + ((configProperty == null) ? 0 : configProperty.hashCode());
+ result = prime * result + ((connectionFactoryImplClass == null) ? 0 : connectionFactoryImplClass.hashCode());
+ result = prime * result + ((connectionFactoryInterface == null) ? 0 : connectionFactoryInterface.hashCode());
+ result = prime * result + ((connectionImplClass == null) ? 0 : connectionImplClass.hashCode());
+ result = prime * result + ((connectionInterface == null) ? 0 : connectionInterface.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result
+ + ((managedConnectionFactoryClass == null) ? 0 : managedConnectionFactoryClass.hashCode());
+ result = prime * result + ((reauthenticationSupport == null) ? 0 : reauthenticationSupport.hashCode());
+ result = prime * result + ((securityPermission == null) ? 0 : securityPermission.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 ResourceAdapter10Impl))
+ return false;
+ ResourceAdapter10Impl other = (ResourceAdapter10Impl) obj;
+ if (authenticationMechanism == null)
+ {
+ if (other.authenticationMechanism != null)
+ return false;
+ }
+ else if (!authenticationMechanism.equals(other.authenticationMechanism))
+ return false;
+ if (configProperty == null)
+ {
+ if (other.configProperty != null)
+ return false;
+ }
+ else if (!configProperty.equals(other.configProperty))
+ return false;
+ if (connectionFactoryImplClass == null)
+ {
+ if (other.connectionFactoryImplClass != null)
+ return false;
+ }
+ else if (!connectionFactoryImplClass.equals(other.connectionFactoryImplClass))
+ return false;
+ if (connectionFactoryInterface == null)
+ {
+ if (other.connectionFactoryInterface != null)
+ return false;
+ }
+ else if (!connectionFactoryInterface.equals(other.connectionFactoryInterface))
+ return false;
+ if (connectionImplClass == null)
+ {
+ if (other.connectionImplClass != null)
+ return false;
+ }
+ else if (!connectionImplClass.equals(other.connectionImplClass))
+ return false;
+ if (connectionInterface == null)
+ {
+ if (other.connectionInterface != null)
+ return false;
+ }
+ else if (!connectionInterface.equals(other.connectionInterface))
+ return false;
+ if (id == null)
+ {
+ if (other.id != null)
+ return false;
+ }
+ else if (!id.equals(other.id))
+ return false;
+ if (managedConnectionFactoryClass == null)
+ {
+ if (other.managedConnectionFactoryClass != null)
+ return false;
+ }
+ else if (!managedConnectionFactoryClass.equals(other.managedConnectionFactoryClass))
+ return false;
+ if (reauthenticationSupport == null)
+ {
+ if (other.reauthenticationSupport != null)
+ return false;
+ }
+ else if (!reauthenticationSupport.equals(other.reauthenticationSupport))
+ return false;
+ if (securityPermission == null)
+ {
+ if (other.securityPermission != null)
+ return false;
+ }
+ else if (!securityPermission.equals(other.securityPermission))
+ return false;
+ if (transactionSupport != other.transactionSupport)
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "ResourceAdapter10 [managedConnectionFactoryClass=" + managedConnectionFactoryClass
+ + ", connectionFactoryInterface=" + connectionFactoryInterface + ", connectionFactoryImplClass="
+ + connectionFactoryImplClass + ", connectionInterface=" + connectionInterface + ", connectionImplClass="
+ + connectionImplClass + ", transactionSupport=" + transactionSupport + ", authenticationMechanism="
+ + authenticationMechanism + ", configProperties=" + configProperty + ", reauthenticationSupport="
+ + reauthenticationSupport + ", securityPermission=" + securityPermission + ", id=" + id + "]";
+ }
+
+ @Override
+ public void validate() throws ValidateException
+ {
+ if (this.getManagedConnectionFactoryClass() == null || this.getManagedConnectionFactoryClass().getValue() == null
+ || this.getManagedConnectionFactoryClass().getValue().trim().equals(""))
+ {
+
+ throw new ValidateException("ManagedConnectionFactoryClass should be defined");
+ }
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra10/package.html)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/package.html (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/package.html 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains metadatas for connector-1.0.dtd
+</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Activationspec15Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra15/Activationspec15Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Activationspec15Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Activationspec15Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,166 @@
+/*
+ * 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.ra.ra15;
+
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.RequiredConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra15.Activationspec15;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ *
+ * A Activationspec15.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class Activationspec15Impl implements Activationspec15
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -342663654303158977L;
+
+ /**
+ * activationspec class name
+ */
+ protected final XsdString activationspecClass;
+
+ /**
+ * list of required properties
+ */
+ protected final List<RequiredConfigProperty> requiredConfigProperty;
+
+ /**
+ * id attribute in xml file
+ */
+ protected final String id;
+
+ /**
+ *
+ * Create a new Activationspec15.
+ *
+ * @param activationspecClass activation spec class name
+ * @param requiredConfigProperty list of required property
+ * @param id id attribute of xml file
+ */
+ public Activationspec15Impl(XsdString activationspecClass, List<RequiredConfigProperty> requiredConfigProperty,
+ String id)
+ {
+ super();
+ this.activationspecClass = activationspecClass;
+ this.requiredConfigProperty = requiredConfigProperty;
+ this.id = id;
+ }
+
+ /**
+ * @return activationspecClass
+ */
+ @Override
+ public XsdString getActivationspecClass()
+ {
+ return activationspecClass;
+ }
+
+ /**
+ * @return requiredConfigProperty
+ */
+ @Override
+ public List<RequiredConfigProperty> getRequiredConfigProperties()
+ {
+ return requiredConfigProperty == null ? null : Collections.unmodifiableList(requiredConfigProperty);
+ }
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((activationspecClass == null) ? 0 : activationspecClass.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((requiredConfigProperty == null) ? 0 : requiredConfigProperty.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (!(obj instanceof Activationspec15Impl))
+ return false;
+ Activationspec15Impl other = (Activationspec15Impl) obj;
+ if (activationspecClass == null)
+ {
+ if (other.activationspecClass != null)
+ return false;
+ }
+ else if (!activationspecClass.equals(other.activationspecClass))
+ return false;
+ if (id == null)
+ {
+ if (other.id != null)
+ return false;
+ }
+ else if (!id.equals(other.id))
+ return false;
+ if (requiredConfigProperty == null)
+ {
+ if (other.requiredConfigProperty != null)
+ return false;
+ }
+ else if (!requiredConfigProperty.equals(other.requiredConfigProperty))
+ return false;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "Activationspec [activationspecClass=" + activationspecClass + ", requiredConfigProperty="
+ + requiredConfigProperty + ", id=" + id + "]";
+ }
+
+ @Override
+ public List<? extends ConfigProperty> getConfigProperties()
+ {
+ return null;
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra15/Connector15Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,125 @@
+/*
+ * 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.ra.ra15;
+
+import org.jboss.jca.common.api.metadata.ra.LicenseType;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra15.Connector15;
+import org.jboss.jca.common.metadata.ra.common.ConnectorAbstractmpl;
+
+/**
+ *
+ * A Connector15.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class Connector15Impl extends ConnectorAbstractmpl implements Connector15
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 531372312218060928L;
+
+ /**
+ * the resource adapter version
+ */
+ protected final XsdString resourceadapterVersion;
+
+
+ /**
+ * @param vendorName vendor name
+ * @param eisType eis type
+ * @param resourceadapterVersion version number for the RA
+ * @param license license information
+ * @param resourceadapter full qualified name of the resource adapter
+ * @param id XML ID
+ */
+ public Connector15Impl(XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
+ LicenseType license, ResourceAdapter1516 resourceadapter, String id)
+ {
+ super(vendorName, eisType, license, resourceadapter, id);
+ this.resourceadapterVersion = resourceadapterVersion;
+ }
+
+ /**
+ * @return resourceadapterVersion
+ */
+ @Override
+ public XsdString getResourceadapterVersion()
+ {
+ return resourceadapterVersion;
+ }
+
+ /**
+ * Get the version.
+ *
+ * @return the version.
+ */
+ @Override
+ public Version getVersion()
+ {
+ return Version.V_15;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((resourceadapterVersion == null) ? 0 : resourceadapterVersion.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (!(obj instanceof Connector15Impl))
+ return false;
+ Connector15Impl other = (Connector15Impl) obj;
+ if (resourceadapterVersion == null)
+ {
+ if (other.resourceadapterVersion != null)
+ return false;
+ }
+ else if (!resourceadapterVersion.equals(other.resourceadapterVersion))
+ return false;
+
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Connector15 [version=" + Version.V_15 + ", resourceadapterVersion=" + resourceadapterVersion
+ + ", vendorName="
+ + vendorName + ", eisType=" + eisType + ", license=" + license + ", resourceadapter=" + resourceadapter
+ + ", id=" + id + "]";
+ }
+
+
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra15/package.html)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/package.html (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/package.html 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains metadatas for connector-1.5.xsd
+</body>
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Activationspec16Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra16/Activationspec16Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Activationspec16Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Activationspec16Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,105 @@
+/*
+ * 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.ra.ra16;
+
+import org.jboss.jca.common.api.metadata.ra.ConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.RequiredConfigProperty;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra16.Activationspec16;
+import org.jboss.jca.common.metadata.ra.ra15.Activationspec15Impl;
+
+import java.util.List;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class Activationspec16Impl extends Activationspec15Impl implements Activationspec16
+{
+ /**
+ */
+ private static final long serialVersionUID = -6951903183562100136L;
+
+ private final List<? extends ConfigProperty> configProperty;
+
+ /**
+ * @param activationspecClass full qualified name of the class
+ * @param requiredConfigProperty a List of required config properties
+ * @param configProperty a list of (optional) config property
+ * @param id xmlID
+ */
+ public Activationspec16Impl(XsdString activationspecClass, List<RequiredConfigProperty> requiredConfigProperty,
+ List<? extends ConfigProperty> configProperty, String id)
+ {
+ super(activationspecClass, requiredConfigProperty, id);
+ this.configProperty = configProperty;
+ }
+
+ /**
+ * @return configProperty
+ */
+ @Override
+ public List<? extends ConfigProperty> getConfigProperties()
+ {
+ return configProperty == null ? null : Collections.unmodifiableList(configProperty);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((configProperty == null) ? 0 : configProperty.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (!(obj instanceof Activationspec16Impl))
+ return false;
+ Activationspec16Impl other = (Activationspec16Impl) obj;
+ if (configProperty == null)
+ {
+ if (other.configProperty != null)
+ return false;
+ }
+ else if (!configProperty.equals(other.configProperty))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Activationspec [configProperty=" + configProperty + ", activationspecClass=" + activationspecClass
+ + ", requiredConfigProperty=" + requiredConfigProperty + ", id=" + id + "]";
+ }
+
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/ConfigProperty16Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra16/ConfigProperty16Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/ConfigProperty16Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/ConfigProperty16Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,312 @@
+/*
+ * 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.ra.ra16;
+
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra16.ConfigProperty16;
+import org.jboss.jca.common.metadata.ra.common.ConfigPropertyImpl;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class ConfigProperty16Impl extends ConfigPropertyImpl implements ConfigProperty16
+{
+ /**
+ */
+ private static final long serialVersionUID = -2025203811838727421L;
+
+ private final Boolean configPropertyIgnore;
+
+ private final Boolean configPropertySupportsDynamicUpdates;
+
+ private final Boolean configPropertyConfidential;
+
+ private final String attachedClassName;
+
+ /**
+ * @param description list of descriptions
+ * @param configPropertyName name of the property
+ * @param configPropertyType full qualified name of the type of the property
+ * @param configPropertyValue value
+ * @param configPropertyIgnore not mandatory boolean value The element config-property-ignore is used to specify
+ * whether the configuration tools must ignore considering the
+ * configuration property during auto-discovery of
+ * Configuration properties. See the Connector specification for
+ * more details. If unspecified, the container must not ignore
+ * the configuration property during auto-discovery.
+ * @param configPropertySupportsDynamicUpdates not mandatory The element
+ * config-property-supports-dynamic-updates is used to specify
+ * whether the configuration property allows its value to be updated, by
+ * application server's configuration tools, during the lifetime of
+ * the JavaBean instance. See the Connector specification for
+ * more details. If unspecified, the container must not dynamically
+ * reconfigure the property.
+ * @param configPropertyConfidential The element config-property-confidential is used to specify
+ * whether the configuration property is confidential and
+ * recommends application server's configuration tools to use special
+ * visual aids for editing them. See the Connector specification for
+ * more details. If unspecified, the container must not treat the
+ * property as confidential.
+ * @param id XML ID
+ */
+ public ConfigProperty16Impl(List<LocalizedXsdString> description, XsdString configPropertyName,
+ XsdString configPropertyType, XsdString configPropertyValue, Boolean configPropertyIgnore,
+ Boolean configPropertySupportsDynamicUpdates, Boolean configPropertyConfidential, String id)
+ {
+ super(description, configPropertyName, configPropertyType, configPropertyValue, id);
+ this.configPropertyIgnore = configPropertyIgnore;
+ this.configPropertySupportsDynamicUpdates = configPropertySupportsDynamicUpdates;
+ this.configPropertyConfidential = configPropertyConfidential;
+ this.attachedClassName = null;
+ }
+
+ /**
+ * @param description list of descriptions
+ * @param configPropertyName name of the property
+ * @param configPropertyType full qualified name of the type of the property
+ * @param configPropertyValue value
+ * @param configPropertyIgnore not mandatory boolean value The element config-property-ignore is used to specify
+ * whether the configuration tools must ignore considering the
+ * configuration property during auto-discovery of
+ * Configuration properties. See the Connector specification for
+ * more details. If unspecified, the container must not ignore
+ * the configuration property during auto-discovery.
+ * @param configPropertySupportsDynamicUpdates not mandatory The element
+ * config-property-supports-dynamic-updates is used to specify
+ * whether the configuration property allows its value to be updated, by
+ * application server's configuration tools, during the lifetime of
+ * the JavaBean instance. See the Connector specification for
+ * more details. If unspecified, the container must not dynamically
+ * reconfigure the property.
+ * @param configPropertyConfidential The element config-property-confidential is used to specify
+ * whether the configuration property is confidential and
+ * recommends application server's configuration tools to use special
+ * visual aids for editing them. See the Connector specification for
+ * more details. If unspecified, the container must not treat the
+ * property as confidential.
+ * @param id XML ID
+ * @param attachedClassName className of the class where the property is defined by annoptation
+ */
+ public ConfigProperty16Impl(List<LocalizedXsdString> description, XsdString configPropertyName,
+ XsdString configPropertyType, XsdString configPropertyValue, Boolean configPropertyIgnore,
+ Boolean configPropertySupportsDynamicUpdates, Boolean configPropertyConfidential, String id,
+ String attachedClassName)
+ {
+ super(description, configPropertyName, configPropertyType, configPropertyValue, id);
+ this.configPropertyIgnore = configPropertyIgnore;
+ this.configPropertySupportsDynamicUpdates = configPropertySupportsDynamicUpdates;
+ this.configPropertyConfidential = configPropertyConfidential;
+ this.attachedClassName = attachedClassName;
+ }
+
+ /**
+ * Get the attachedClassName.
+ *
+ * @return the attachedClassName.
+ */
+ public final String getAttachedClassName()
+ {
+ return attachedClassName;
+ }
+
+ /**
+ * @return configPropertyIgnore
+ */
+ @Override
+ public Boolean getConfigPropertyIgnore()
+ {
+ return configPropertyIgnore;
+ }
+
+ /**
+ * @return configPropertySupportsDynamicUpdates
+ */
+ @Override
+ public Boolean getConfigPropertySupportsDynamicUpdates()
+ {
+ return configPropertySupportsDynamicUpdates;
+ }
+
+ /**
+ * @return configPropertyConfidential
+ */
+ @Override
+ public Boolean getConfigPropertyConfidential()
+ {
+ return configPropertyConfidential;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((configPropertyConfidential == null) ? 0 : configPropertyConfidential.hashCode());
+ result = prime * result + ((configPropertyIgnore == null) ? 0 : configPropertyIgnore.hashCode());
+ result = prime * result + ((configPropertyName == null) ? 0 : configPropertyName.hashCode());
+ result = prime * result
+ + ((configPropertySupportsDynamicUpdates == null) ? 0 : configPropertySupportsDynamicUpdates.hashCode());
+ result = prime * result + ((configPropertyType == null) ? 0 : configPropertyType.hashCode());
+ result = prime * result + ((configPropertyValue == null) ? 0 : configPropertyValue.hashCode());
+ result = prime * result + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.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 ConfigProperty16Impl))
+ {
+ return false;
+ }
+ ConfigProperty16Impl other = (ConfigProperty16Impl) obj;
+ if (configPropertyConfidential == null)
+ {
+ if (other.configPropertyConfidential != null)
+ {
+ return false;
+ }
+ }
+ else if (!configPropertyConfidential.equals(other.configPropertyConfidential))
+ {
+ return false;
+ }
+ if (configPropertyIgnore == null)
+ {
+ if (other.configPropertyIgnore != null)
+ {
+ return false;
+ }
+ }
+ else if (!configPropertyIgnore.equals(other.configPropertyIgnore))
+ {
+ return false;
+ }
+ if (configPropertyName == null)
+ {
+ if (other.configPropertyName != null)
+ {
+ return false;
+ }
+ }
+ else if (!configPropertyName.equals(other.configPropertyName))
+ {
+ return false;
+ }
+ if (configPropertySupportsDynamicUpdates == null)
+ {
+ if (other.configPropertySupportsDynamicUpdates != null)
+ {
+ return false;
+ }
+ }
+ else if (!configPropertySupportsDynamicUpdates.equals(other.configPropertySupportsDynamicUpdates))
+ {
+ return false;
+ }
+ if (configPropertyType == null)
+ {
+ if (other.configPropertyType != null)
+ {
+ return false;
+ }
+ }
+ else if (!configPropertyType.equals(other.configPropertyType))
+ {
+ return false;
+ }
+ if (configPropertyValue == null)
+ {
+ if (other.configPropertyValue != null)
+ {
+ return false;
+ }
+ }
+ else if (!configPropertyValue.equals(other.configPropertyValue))
+ {
+ return false;
+ }
+ if (description == null)
+ {
+ if (other.description != null)
+ {
+ return false;
+ }
+ }
+ else if (!description.equals(other.description))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "ConfigProperty [description=" + description + ", configPropertyName=" + configPropertyName
+ + ", configPropertyType=" + configPropertyType + ", configPropertyValue=" + configPropertyValue
+ + ", configPropertyIgnore=" + configPropertyIgnore + ", configPropertySupportsDynamicUpdates="
+ + configPropertySupportsDynamicUpdates + ", configPropertyConfidential=" + configPropertyConfidential
+ + ", id=" + id + "]";
+ }
+
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16Impl.java (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra16/Connector16Impl.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16Impl.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16Impl.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,384 @@
+/*
+ * 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.ra.ra16;
+
+import org.jboss.jca.common.api.metadata.jbossra.JbossRa;
+import org.jboss.jca.common.api.metadata.ra.Connector;
+import org.jboss.jca.common.api.metadata.ra.Icon;
+import org.jboss.jca.common.api.metadata.ra.LicenseType;
+import org.jboss.jca.common.api.metadata.ra.LocalizedXsdString;
+import org.jboss.jca.common.api.metadata.ra.MergeableMetadata;
+import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
+import org.jboss.jca.common.api.metadata.ra.XsdString;
+import org.jboss.jca.common.api.metadata.ra.ra16.Connector16;
+import org.jboss.jca.common.metadata.MergeUtil;
+import org.jboss.jca.common.metadata.ra.ra15.Connector15Impl;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public final class Connector16Impl extends Connector15Impl implements Connector16
+{
+
+ /**
+ */
+ private static final long serialVersionUID = -6095735191032372517L;
+
+ private final String moduleName;
+
+ private final List<Icon> icons;
+
+ private final List<String> requiredWorkContexts;
+
+ private final List<LocalizedXsdString> descriptions;
+
+ private final List<LocalizedXsdString> displayNames;
+
+ private final boolean metadataComplete;
+
+
+
+ /**
+ * @param moduleName name of the module
+ * @param descriptions descriptions of this connector
+ * @param displayNames name to display for this connecotro
+ * @param icons icon representing this connectore
+ * @param vendorName vendor name
+ * @param eisType eis type
+ * @param resourceadapterVersion version number for the RA
+ * @param license license information
+ * @param resourceadapter full qualified name of the resource adapter
+ * @param requiredWorkContexts list od work context required
+ * @param metadataComplete not mandatory boolean value
+ * @param id XML ID
+ */
+ public Connector16Impl(String moduleName, List<LocalizedXsdString> descriptions,
+ List<LocalizedXsdString> displayNames,
+ List<Icon> icons, XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
+ LicenseType license, ResourceAdapter1516 resourceadapter, List<String> requiredWorkContexts,
+ boolean metadataComplete, String id)
+ {
+ super(vendorName, eisType, resourceadapterVersion, license, resourceadapter, id);
+ this.moduleName = moduleName;
+ this.descriptions = descriptions;
+ this.displayNames = displayNames;
+ this.icons = icons;
+ this.requiredWorkContexts = requiredWorkContexts;
+ this.metadataComplete = metadataComplete;
+ }
+
+ /**
+ * @return requiredWorkContext
+ */
+ @Override
+ public List<String> getRequiredWorkContexts()
+ {
+ return requiredWorkContexts == null ? null : Collections.unmodifiableList(requiredWorkContexts);
+ }
+
+ /**
+ * @return moduleName
+ */
+ @Override
+ public String getModuleName()
+ {
+ return moduleName;
+ }
+
+ /**
+ * @return description
+ */
+ @Override
+ public List<LocalizedXsdString> getDescriptions()
+ {
+ return descriptions == null ? null : Collections.unmodifiableList(descriptions);
+ }
+
+ /**
+ * @return displayName
+ */
+ @Override
+ public List<LocalizedXsdString> getDisplayNames()
+ {
+ return displayNames == null ? null : Collections.unmodifiableList(displayNames);
+ }
+
+ /**
+ * @return icon
+ */
+ @Override
+ public List<Icon> getIcons()
+ {
+ return icons == null ? null : Collections.unmodifiableList(icons);
+ }
+
+ /**
+ * @return metadataComplete
+ */
+ @Override
+ public boolean isMetadataComplete()
+ {
+ return metadataComplete;
+ }
+
+ /**
+ * Get the version.
+ *
+ * @return the version.
+ */
+ @Override
+ public Version getVersion()
+ {
+ return Version.V_16;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((descriptions == null) ? 0 : descriptions.hashCode());
+ result = prime * result + ((displayNames == null) ? 0 : displayNames.hashCode());
+ result = prime * result + ((eisType == null) ? 0 : eisType.hashCode());
+ result = prime * result + ((icons == null) ? 0 : icons.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((license == null) ? 0 : license.hashCode());
+ result = prime * result + ((moduleName == null) ? 0 : moduleName.hashCode());
+ result = prime * result + ((requiredWorkContexts == null) ? 0 : requiredWorkContexts.hashCode());
+ result = prime * result + ((resourceadapter == null) ? 0 : resourceadapter.hashCode());
+ result = prime * result + ((resourceadapterVersion == null) ? 0 : resourceadapterVersion.hashCode());
+ result = prime * result + ((vendorName == null) ? 0 : vendorName.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 Connector16Impl))
+ {
+ return false;
+ }
+ Connector16Impl other = (Connector16Impl) obj;
+ if (descriptions == null)
+ {
+ if (other.descriptions != null)
+ {
+ return false;
+ }
+ }
+ else if (!descriptions.equals(other.descriptions))
+ {
+ return false;
+ }
+ if (displayNames == null)
+ {
+ if (other.displayNames != null)
+ {
+ return false;
+ }
+ }
+ else if (!displayNames.equals(other.displayNames))
+ {
+ return false;
+ }
+ if (eisType == null)
+ {
+ if (other.eisType != null)
+ {
+ return false;
+ }
+ }
+ else if (!eisType.equals(other.eisType))
+ {
+ return false;
+ }
+ if (icons == null)
+ {
+ if (other.icons != null)
+ {
+ return false;
+ }
+ }
+ else if (!icons.equals(other.icons))
+ {
+ return false;
+ }
+ if (id == null)
+ {
+ if (other.id != null)
+ {
+ return false;
+ }
+ }
+ else if (!id.equals(other.id))
+ {
+ return false;
+ }
+ if (license == null)
+ {
+ if (other.license != null)
+ {
+ return false;
+ }
+ }
+ else if (!license.equals(other.license))
+ {
+ return false;
+ }
+ if (metadataComplete != other.metadataComplete)
+ {
+ return false;
+ }
+ if (moduleName == null)
+ {
+ if (other.moduleName != null)
+ {
+ return false;
+ }
+ }
+ else if (!moduleName.equals(other.moduleName))
+ {
+ return false;
+ }
+ if (requiredWorkContexts == null)
+ {
+ if (other.requiredWorkContexts != null)
+ {
+ return false;
+ }
+ }
+ else if (!requiredWorkContexts.equals(other.requiredWorkContexts))
+ {
+ return false;
+ }
+ if (resourceadapter == null)
+ {
+ if (other.resourceadapter != null)
+ {
+ return false;
+ }
+ }
+ else if (!resourceadapter.equals(other.resourceadapter))
+ {
+ return false;
+ }
+ if (resourceadapterVersion == null)
+ {
+ if (other.resourceadapterVersion != null)
+ {
+ return false;
+ }
+ }
+ else if (!resourceadapterVersion.equals(other.resourceadapterVersion))
+ {
+ return false;
+ }
+ if (vendorName == null)
+ {
+ if (other.vendorName != null)
+ {
+ return false;
+ }
+ }
+ else if (!vendorName.equals(other.vendorName))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "Connector16 [moduleName=" + moduleName + ", descriptions=" + descriptions + ", displayNames="
+ + displayNames
+ + ", icons=" + icons + ", vendorName=" + vendorName + ", eisType=" + eisType + ", resourceadapterVersion="
+ + resourceadapterVersion + ", license=" + license + ", resourceadapter=" + resourceadapter
+ + ", requiredWorkContexts=" + requiredWorkContexts + ", version=" + Version.V_15 + ", metadataComplete="
+ + metadataComplete + ", id=" + id + "]";
+ }
+
+ @Override
+ public Connector merge(MergeableMetadata<?> inputMd) throws Exception
+ {
+ if (inputMd instanceof JbossRa)
+ {
+ mergeJbossMetaData((JbossRa) inputMd);
+ return this;
+ }
+
+ if (inputMd instanceof Connector16Impl)
+ {
+ Connector16Impl input16 = (Connector16Impl) inputMd;
+ XsdString newResourceadapterVersion = XsdString.isNull(this.resourceadapterVersion)
+ ? input16.resourceadapterVersion : this.resourceadapterVersion;
+ XsdString newEisType = XsdString.isNull(this.eisType) ? input16.eisType : this.eisType;
+ List<String> newRequiredWorkContexts = MergeUtil.mergeList(this.requiredWorkContexts,
+ input16.requiredWorkContexts);
+ String newModuleName = this.moduleName == null ? input16.moduleName : this.moduleName;
+ List<Icon> newIcons = MergeUtil.mergeList(this.icons, input16.icons);
+ boolean newMetadataComplete = this.metadataComplete || input16.metadataComplete;
+ LicenseType newLicense = this.license == null ? input16.license : this.license.merge(input16.license);
+ List<LocalizedXsdString> newDescriptions = MergeUtil.mergeList(this.descriptions,
+ input16.descriptions);
+ List<LocalizedXsdString> newDisplayNames = MergeUtil.mergeList(this.displayNames,
+ input16.displayNames);
+ XsdString newVendorName = XsdString.isNull(this.vendorName)
+ ? input16.vendorName : this.vendorName;;
+ ResourceAdapter1516 newResourceadapter = this.resourceadapter == null
+ ? (ResourceAdapter1516) input16.resourceadapter
+ : ((ResourceAdapter1516) this.resourceadapter)
+ .merge((ResourceAdapter1516) input16.resourceadapter);
+ return new Connector16Impl(newModuleName, newDescriptions, newDisplayNames, newIcons,
+ newVendorName, newEisType, newResourceadapterVersion, newLicense, newResourceadapter,
+ newRequiredWorkContexts, newMetadataComplete, newModuleName);
+ }
+ return this;
+
+
+ }
+
+}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/package.html (from rev 107373, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadataimpl/ra/ra16/package.html)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/package.html (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/package.html 2010-08-04 12:58:46 UTC (rev 107383)
@@ -0,0 +1,3 @@
+<body>
+This package contains metadatas for connector-1.6.xsd
+</body>
Modified: projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/JbossRaParserTestCase.java
===================================================================
--- projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/JbossRaParserTestCase.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/JbossRaParserTestCase.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -23,10 +23,10 @@
import org.jboss.jca.common.api.metadata.jbossra.JbossRa;
import org.jboss.jca.common.api.metadata.jbossra.jbossra20.JbossRa20;
-import org.jboss.jca.common.metadataimpl.jbossra.JbossRaParser;
-import org.jboss.jca.common.metadataimpl.jbossra.jbossra10.JbossRa10Impl;
-import org.jboss.jca.common.metadataimpl.jbossra.jbossra20.JbossRa20Impl;
-import org.jboss.jca.common.metadataimpl.ra.common.RaConfigPropertyImpl;
+import org.jboss.jca.common.metadata.jbossra.JbossRaParser;
+import org.jboss.jca.common.metadata.jbossra.jbossra10.JbossRa10Impl;
+import org.jboss.jca.common.metadata.jbossra.jbossra20.JbossRa20Impl;
+import org.jboss.jca.common.metadata.ra.common.RaConfigPropertyImpl;
import java.io.File;
import java.io.FileInputStream;
Modified: projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/RaParserTestCase.java
===================================================================
--- projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/RaParserTestCase.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/RaParserTestCase.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -23,11 +23,9 @@
import org.jboss.jca.common.api.metadata.ra.Connector;
import org.jboss.jca.common.api.metadata.ra.Connector.Version;
-import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
import org.jboss.jca.common.api.metadata.ra.ra10.Connector10;
import org.jboss.jca.common.api.metadata.ra.ra15.Connector15;
import org.jboss.jca.common.api.metadata.ra.ra16.Connector16;
-import org.jboss.jca.common.metadataimpl.ra.RaParser;
import java.io.File;
import java.io.FileInputStream;
@@ -97,9 +95,8 @@
//then
assertThat(connector, instanceOf(Connector15.class));
assertThat(connector.getVersion(), is(Version.V_16));
- ResourceAdapter1516 ra = (ResourceAdapter1516) connector.getResourceadapter();
- assertThat(ra.getOutboundResourceadapter().getConnectionDefinitions().get(0)
- .getManagedconnectionfactoryClass().getValue(), is("aa"));
+
+
}
finally
{
Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployer.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -35,7 +35,7 @@
import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
import org.jboss.jca.common.api.metadata.ra.TransactionSupportEnum;
import org.jboss.jca.common.api.metadata.ra.ra10.ResourceAdapter10;
-import org.jboss.jca.common.metadataimpl.MetadataFactory;
+import org.jboss.jca.common.metadata.MetadataFactory;
import org.jboss.jca.core.api.CloneableBootstrapContext;
import org.jboss.jca.core.connectionmanager.ConnectionManager;
import org.jboss.jca.core.connectionmanager.ConnectionManagerFactory;
Modified: projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validation.java
===================================================================
--- projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validation.java 2010-08-04 12:56:07 UTC (rev 107382)
+++ projects/jboss-jca/trunk/validator/src/main/java/org/jboss/jca/validator/Validation.java 2010-08-04 12:58:46 UTC (rev 107383)
@@ -31,7 +31,7 @@
import org.jboss.jca.common.api.metadata.ra.ResourceAdapter1516;
import org.jboss.jca.common.api.metadata.ra.XsdString;
import org.jboss.jca.common.api.metadata.ra.ra10.Connector10;
-import org.jboss.jca.common.metadataimpl.MetadataFactory;
+import org.jboss.jca.common.metadata.MetadataFactory;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
More information about the jboss-cvs-commits
mailing list