[jboss-cvs] JBossAS SVN: r107034 - in projects/jboss-jca/trunk/common/src: main/java/org/jboss/jca/common/metadata/jbossra/jbossra10 and 8 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jul 22 12:56:10 EDT 2010
Author: maeste
Date: 2010-07-22 12:56:08 -0400 (Thu, 22 Jul 2010)
New Revision: 107034
Added:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516.java
projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/RaParserTestCase.java
projects/jboss-jca/trunk/common/src/test/resources/connector-1.0-sample.xml
projects/jboss-jca/trunk/common/src/test/resources/connector-1.5-sample.xml
projects/jboss-jca/trunk/common/src/test/resources/connector-1.6-sample.xml
Modified:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRa.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/BeanValidationGroup.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/Adminobject.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AuthenticationMechanism.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConfigProperty.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectionDefinition.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/CredentialInterfaceEnum.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/InboundResourceAdapter.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/LicenseType.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageAdapter.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageListener.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/OutboundResourceAdapter.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/SecurityPermission.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/ResourceAdapter10.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Activationspec15.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Activationspec16.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/ConfigProperty16.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Icon.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Path.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/RequiredConfigProperty.java
projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/JbossRaParserTestCase.java
Log:
JBJCA-385: issue almost complete, some more test cases needed and then integration
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRa.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRa.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRa.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -25,6 +25,7 @@
import org.jboss.jca.common.metadata.JCAMetadata;
import org.jboss.jca.common.metadata.jbossra.jbossra20.RaConfigProperty;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -41,7 +42,7 @@
/** The serialVersionUID */
private static final long serialVersionUID = 1L;
- private final List<RaConfigProperty<?>> raConfigProperties;
+ private final ArrayList<RaConfigProperty<?>> raConfigProperties;
/**
*
@@ -49,7 +50,7 @@
*
* @param raConfigProperties properties list
*/
- protected JbossRa(List<RaConfigProperty<?>> raConfigProperties)
+ protected JbossRa(ArrayList<RaConfigProperty<?>> raConfigProperties)
{
this.raConfigProperties = raConfigProperties;
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/JbossRaParser.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -93,7 +93,7 @@
switch (Tag.forName(reader.getLocalName()))
{
case JBOSSRA : {
- jbossRa = parseJbossRa20(reader, jbossRa);
+ jbossRa = parseJbossRa20(reader);
break;
}
default :
@@ -125,7 +125,7 @@
}
- private JbossRa20 parseJbossRa20(XMLStreamReader reader, JbossRa jbossRa) throws XMLStreamException, ParserException
+ private JbossRa20 parseJbossRa20(XMLStreamReader reader) throws XMLStreamException, ParserException
{
ArrayList<RaConfigProperty<?>> raConfigProperties = new ArrayList<RaConfigProperty<?>>();
ArrayList<BeanValidationGroup> beanValidationGroups = new ArrayList<BeanValidationGroup>();
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra10/JbossRa10.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -24,8 +24,8 @@
import org.jboss.jca.common.metadata.jbossra.JbossRa;
import org.jboss.jca.common.metadata.jbossra.jbossra20.RaConfigProperty;
+import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
/**
@@ -47,10 +47,10 @@
private static final long serialVersionUID = 1L;
/**
- * @param raConfigProperties List of properties for configuration
+ * @param raConfigProperties ArrayList of properties for configuration
*
*/
- public JbossRa10(List<RaConfigProperty<?>> raConfigProperties)
+ public JbossRa10(ArrayList<RaConfigProperty<?>> raConfigProperties)
{
super(raConfigProperties);
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/BeanValidationGroup.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/BeanValidationGroup.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/BeanValidationGroup.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -23,6 +23,7 @@
import org.jboss.jca.common.metadata.JCAMetadata;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -39,12 +40,12 @@
*/
private static final long serialVersionUID = 6856138720550993874L;
- private final List<String> beanValidationGroup;
+ private final ArrayList<String> beanValidationGroup;
/**
- * @param beanValidationGroup List of bean validation group
+ * @param beanValidationGroup ArrayList of bean validation group
*/
- public BeanValidationGroup(List<String> beanValidationGroup)
+ public BeanValidationGroup(ArrayList<String> beanValidationGroup)
{
super();
this.beanValidationGroup = beanValidationGroup;
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/jbossra/jbossra20/JbossRa20.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -23,6 +23,7 @@
import org.jboss.jca.common.metadata.jbossra.JbossRa;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -43,15 +44,15 @@
private final String bootstrapContext;
- private final List<BeanValidationGroup> beanValidationGroups;
+ private final ArrayList<BeanValidationGroup> beanValidationGroups;
/**
- * @param raConfigProperties List of properties for configuration
+ * @param raConfigProperties ArrayList of properties for configuration
* @param bootstrapContext String representing the bootstrap context name
* @param beanValidationGroups for validations
*/
- public JbossRa20(List<RaConfigProperty<?>> raConfigProperties, String bootstrapContext,
- List<BeanValidationGroup> beanValidationGroups)
+ public JbossRa20(ArrayList<RaConfigProperty<?>> raConfigProperties, String bootstrapContext,
+ ArrayList<BeanValidationGroup> beanValidationGroups)
{
super(raConfigProperties);
this.bootstrapContext = bootstrapContext;
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/RaParser.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,10 +22,46 @@
package org.jboss.jca.common.metadata.ra;
import org.jboss.jca.common.metadata.MetadataParser;
+import org.jboss.jca.common.metadata.ParserException;
+import org.jboss.jca.common.metadata.ra.common.Adminobject;
+import org.jboss.jca.common.metadata.ra.common.AuthenticationMechanism;
+import org.jboss.jca.common.metadata.ra.common.ConfigProperty;
+import org.jboss.jca.common.metadata.ra.common.ConnectionDefinition;
import org.jboss.jca.common.metadata.ra.common.Connector;
+import org.jboss.jca.common.metadata.ra.common.CredentialInterfaceEnum;
+import org.jboss.jca.common.metadata.ra.common.InboundResourceAdapter;
+import org.jboss.jca.common.metadata.ra.common.LicenseType;
+import org.jboss.jca.common.metadata.ra.common.LocalizedXsdString;
+import org.jboss.jca.common.metadata.ra.common.MessageAdapter;
+import org.jboss.jca.common.metadata.ra.common.MessageListener;
+import org.jboss.jca.common.metadata.ra.common.OutboundResourceAdapter;
+import org.jboss.jca.common.metadata.ra.common.ResourceAdapter1516;
+import org.jboss.jca.common.metadata.ra.common.SecurityPermission;
+import org.jboss.jca.common.metadata.ra.common.TransactionSupportEnum;
+import org.jboss.jca.common.metadata.ra.common.XsdString;
+import org.jboss.jca.common.metadata.ra.ra10.Connector10;
+import org.jboss.jca.common.metadata.ra.ra10.ResourceAdapter10;
+import org.jboss.jca.common.metadata.ra.ra15.Activationspec15;
+import org.jboss.jca.common.metadata.ra.ra15.Connector15;
+import org.jboss.jca.common.metadata.ra.ra16.Activationspec16;
+import org.jboss.jca.common.metadata.ra.ra16.ConfigProperty16;
+import org.jboss.jca.common.metadata.ra.ra16.Connector16;
+import org.jboss.jca.common.metadata.ra.ra16.Icon;
+import org.jboss.jca.common.metadata.ra.ra16.Path;
+import org.jboss.jca.common.metadata.ra.ra16.RequiredConfigProperty;
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.
@@ -39,7 +75,1369 @@
@Override
public Connector parse(InputStream xmlInputStream) throws Exception
{
- return null;
+ XMLStreamReader reader = null;
+ Connector connector = 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 (Connector16.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.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();
+ }
+ }
+ catch (XMLStreamException e)
+ {
+ //ignore it. It is just saying that it isn't a tag
+ }
+ finally
+ {
+ if (reader != null)
+ reader.close();
+ }
+ return connector;
+
}
+ private Connector parseConnector10(XMLStreamReader reader) throws XMLStreamException, ParserException
+ {
+ LicenseType license = null;
+ String id = null;
+ ArrayList<Icon> icon = new ArrayList<Icon>();
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+ XsdString eisType = null;
+ ResourceAdapter10 resourceadapter = null;
+ XsdString vendorName = null;
+ String moduleName = null;
+ XsdString displayName = null;
+ XsdString resourceadapterVersion = null;
+ 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 Connector10(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 : {
+ if (Tag.forName(reader.getLocalName()) == Tag.CONNECTOR)
+ {
+ //getting attributes
+ id = reader.getAttributeValue(null, Connector16.Attribute.ID.getLocalName());
+ }
+ switch (Connector10.Tag.forName(reader.getLocalName()))
+ {
+ case MODULENAME : {
+ moduleName = reader.getElementText();
+ 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
+ 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 = null;
+ XsdString eisType = null;
+ ResourceAdapter1516 resourceadapter = null;
+ XsdString vendorName = null;
+ XsdString resourceadapterVersion = null;
+ while (reader.hasNext())
+ {
+ switch (reader.nextTag())
+ {
+ case END_ELEMENT : {
+ if (Tag.forName(reader.getLocalName()) == Tag.CONNECTOR)
+ {
+
+ //building and returning object
+ return new Connector15(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 : {
+ if (Tag.forName(reader.getLocalName()) == Tag.CONNECTOR)
+ {
+ //getting attributes
+ id = reader.getAttributeValue(null, Connector16.Attribute.ID.getLocalName());
+ }
+ 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;
+ }
+ 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 = null;
+ LicenseType license = null;
+ String id = null;
+ ArrayList<Icon> icon = new ArrayList<Icon>();
+ ArrayList<LocalizedXsdString> description = new ArrayList<LocalizedXsdString>();
+ XsdString eisType = null;
+ ResourceAdapter1516 resourceadapter = null;
+ XsdString vendorName = null;
+ String moduleName = null;
+ ArrayList<LocalizedXsdString> displayName = new ArrayList<LocalizedXsdString>();
+ ArrayList<String> requiredWorkContext = new ArrayList<String>();
+ XsdString resourceadapterVersion = null;
+ 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 Connector16(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 : {
+ if (Tag.forName(reader.getLocalName()) == Tag.CONNECTOR)
+ {
+ //getting attributes
+ metadataComplete = Boolean.valueOf(reader.getAttributeValue(null,
+ Connector16.Attribute.METADATA_COMPLETE.getLocalName()));
+ id = reader.getAttributeValue(null, Connector16.Attribute.ID.getLocalName());
+ }
+ switch (Connector16.Tag.forName(reader.getLocalName()))
+ {
+ case MODULENAME : {
+ moduleName = reader.getElementText();
+ 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());
+ 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());
+ break;
+ }
+ case LARGE_ICON : {
+ largeIcon = Path.valueOf(reader.getElementText());
+ 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 ResourceAdapter1516(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();
+ 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 connectionFactoryInterface = null;
+ XsdString connectionFactoryImplClass = null;
+ XsdString connectionInterface = null;
+ XsdString connectionImplClass = null;
+ 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 ResourceAdapter10(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());
+ 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 InboundResourceAdapter(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 MessageAdapter(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;
+ //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 MessageListener(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;
+ 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 Activationspec16(activationspecClass, requiredConfigProperty, configProperty, id);
+ }
+ else
+ {
+ return new Activationspec15(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;
+ 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 OutboundResourceAdapter(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());
+ 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;
+ ArrayList<ConfigProperty> configProperty = new ArrayList<ConfigProperty>();
+ XsdString connectionImplClass = null;
+ XsdString connectionInterface = null;
+ XsdString connectionfactoryImplClass = null;
+ XsdString connectionfactoryInterface = null;
+ //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 ConnectionDefinition(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;
+ 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 AuthenticationMechanism(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());
+ 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 adminobjectClass = null;
+
+ //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 Adminobject(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 configPropertyValue = null;
+ Boolean configPropertyIgnore = null;
+ XsdString configPropertyName = null;
+ 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 ConfigProperty16(description, configPropertyName, configPropertyType,
+ configPropertyValue,
+ configPropertyIgnore, configPropertySupportsDynamicUpdates, configPropertyConfidential, id);
+ }
+ else
+ {
+ return new ConfigProperty(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;
+
+ //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 SecurityPermission(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(), 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(), id, lang);
+ }
+
+ private boolean elementAsBoolean(XMLStreamReader reader) throws XMLStreamException
+ {
+ return Boolean.valueOf(reader.getElementText());
+ }
+
+ /**
+ *
+ * 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;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/Adminobject.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/Adminobject.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/Adminobject.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,8 +22,11 @@
package org.jboss.jca.common.metadata.ra.common;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -35,22 +38,22 @@
*/
private static final long serialVersionUID = -7653991400977178783L;
- private final String adminobjectInterface;
+ private final XsdString adminobjectInterface;
- private final String adminobjectClass;
+ private final XsdString adminobjectClass;
- private final List<? extends ConfigProperty> configProperty;
+ private final ArrayList<? 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 configProperty ArrayList of config propeties
* @param id xmlid
*/
- public Adminobject(final String adminobjectInterface, final String adminobjectClass,
- final List<? extends ConfigProperty> configProperty, final String id)
+ public Adminobject(final XsdString adminobjectInterface, final XsdString adminobjectClass,
+ final ArrayList<? extends ConfigProperty> configProperty, final String id)
{
super();
this.adminobjectInterface = adminobjectInterface;
@@ -62,7 +65,7 @@
/**
* @return adminobjectInterface
*/
- public String getAdminobjectInterface()
+ public XsdString getAdminobjectInterface()
{
return adminobjectInterface;
}
@@ -70,7 +73,7 @@
/**
* @return adminobjectClass
*/
- public String getAdminobjectClass()
+ public XsdString getAdminobjectClass()
{
return adminobjectClass;
}
@@ -191,4 +194,125 @@
+ ", configProperty=" + configProperty + ", id=" + id + "]";
}
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * adminobject-interface TAG
+ */
+ ADMINOBJECT_INTERFACE("adminobject-interface"),
+
+ /**
+ * adminobject-class TAG
+ */
+ ADMINOBJECT_CLASS("adminobject-class"),
+
+ /**
+ * config-property TAG
+ */
+ CONFIG_PROPERTY("config-property");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AuthenticationMechanism.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AuthenticationMechanism.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/AuthenticationMechanism.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,8 +22,11 @@
package org.jboss.jca.common.metadata.ra.common;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -35,7 +38,7 @@
*/
private static final long serialVersionUID = -1448136517857827148L;
- private final List<LocalizedXsdString> description;
+ private final ArrayList<LocalizedXsdString> description;
private final XsdString authenticationMechanismType;
@@ -59,7 +62,7 @@
* @param credentialInterface enumeration representing credentialInterface.
* @param id xml ID
*/
- public AuthenticationMechanism(List<LocalizedXsdString> description, XsdString authenticationMechanismType,
+ public AuthenticationMechanism(ArrayList<LocalizedXsdString> description, XsdString authenticationMechanismType,
CredentialInterfaceEnum credentialInterface, String id)
{
super();
@@ -193,4 +196,126 @@
return "AuthenticationMechanism [description=" + description + ", authenticationMechanismType="
+ authenticationMechanismType + ", credentialInterface=" + credentialInterface + ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * description TAG
+ */
+ DESCRIPTION("description"),
+
+ /**
+ * authentication-mechanism-type TAG
+ */
+ AUTHENTICATION_MECHANISM_TYPE("authentication-mechanism-type"),
+
+ /**
+ * credential-interface TAG
+ */
+ CREDENTIAL_INTERFACE("credential-interface");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConfigProperty.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConfigProperty.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConfigProperty.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,6 +22,7 @@
package org.jboss.jca.common.metadata.ra.common;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -41,7 +42,7 @@
/**
* description
*/
- protected final List<LocalizedXsdString> description;
+ protected final ArrayList<LocalizedXsdString> description;
/**
* configPropertyName
@@ -72,7 +73,7 @@
* @param configPropertyValue value of config-property
* @param id id attribute in xml file
*/
- public ConfigProperty(List<LocalizedXsdString> description, XsdString configPropertyName,
+ public ConfigProperty(ArrayList<LocalizedXsdString> description, XsdString configPropertyName,
XsdString configPropertyType, XsdString configPropertyValue, String id)
{
super();
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectionDefinition.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectionDefinition.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ConnectionDefinition.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,8 +22,11 @@
package org.jboss.jca.common.metadata.ra.common;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -35,32 +38,32 @@
*/
private static final long serialVersionUID = 197264648585424765L;
- private final String managedconnectionfactoryClass;
+ private final XsdString managedconnectionfactoryClass;
- private final List<? extends ConfigProperty> configProperty;
+ private final ArrayList<? extends ConfigProperty> configProperty;
- private final String connectionfactoryInterface;
+ private final XsdString connectionfactoryInterface;
- private final String connectionfactoryImplClass;
+ private final XsdString connectionfactoryImplClass;
- private final String connectionInterface;
+ private final XsdString connectionInterface;
- private final String connectionImplClass;
+ private final XsdString connectionImplClass;
private final String id;
/**
* @param managedconnectionfactoryClass full qualified name of the class
- * @param configProperty List of configproperties
+ * @param configProperty ArrayList 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 ConnectionDefinition(String managedconnectionfactoryClass, List<? extends ConfigProperty> configProperty,
- String connectionfactoryInterface, String connectionfactoryImplClass, String connectionInterface,
- String connectionImplClass, String id)
+ public ConnectionDefinition(XsdString managedconnectionfactoryClass, ArrayList<? extends ConfigProperty> configProperty,
+ XsdString connectionfactoryInterface, XsdString connectionfactoryImplClass, XsdString connectionInterface,
+ XsdString connectionImplClass, String id)
{
super();
this.managedconnectionfactoryClass = managedconnectionfactoryClass;
@@ -75,7 +78,7 @@
/**
* @return managedconnectionfactoryClass
*/
- public String getManagedconnectionfactoryClass()
+ public XsdString getManagedconnectionfactoryClass()
{
return managedconnectionfactoryClass;
}
@@ -91,7 +94,7 @@
/**
* @return connectionfactoryInterface
*/
- public String getConnectionfactoryInterface()
+ public XsdString getConnectionfactoryInterface()
{
return connectionfactoryInterface;
}
@@ -99,7 +102,7 @@
/**
* @return connectionfactoryImplClass
*/
- public String getConnectionfactoryImplClass()
+ public XsdString getConnectionfactoryImplClass()
{
return connectionfactoryImplClass;
}
@@ -107,7 +110,7 @@
/**
* @return connectionInterface
*/
- public String getConnectionInterface()
+ public XsdString getConnectionInterface()
{
return connectionInterface;
}
@@ -115,7 +118,7 @@
/**
* @return connectionImplClass
*/
- public String getConnectionImplClass()
+ public XsdString getConnectionImplClass()
{
return connectionImplClass;
}
@@ -266,4 +269,141 @@
+ ", connectionfactoryImplClass=" + connectionfactoryImplClass + ", connectionInterface="
+ connectionInterface + ", connectionImplClass=" + connectionImplClass + ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * managedconnectionfactory-class TAG
+ */
+ MANAGED_CONNECTIONFACTORY_CLASS("managedconnectionfactory-class"),
+
+ /**
+ * config-property TAG
+ */
+ CONFIG_PROPERTY("config-property"),
+
+ /**
+ * connectionfactory-interface TAG
+ */
+ CONNECTIONFACTORY_INTERFACE("connectionfactory-interface"),
+
+ /**
+ * connectionfactory-impl-class TAG
+ */
+ CONNECTIONFACTORY_IMPL_CLASS("connectionfactory-impl-class"),
+
+ /**
+ * connection-interface TAG
+ */
+ CONNECTION_INTERFACE("connection-interface"),
+
+ /**
+ * connection-impl-class TAG
+ */
+ CONNECTION_IMPL_CLASS("connection-impl-class");
+
+ 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 XsdString
+ *
+ * @param localName a XsdString 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/CredentialInterfaceEnum.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/CredentialInterfaceEnum.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/CredentialInterfaceEnum.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -70,7 +70,7 @@
* org.ietf.jgss.GSSCredential
* javax.resource.spi.security.GenericCredential
*/
- public static CredentialInterfaceEnum build(String fullQualifiedName) throws IllegalArgumentException
+ public static CredentialInterfaceEnum forName(String fullQualifiedName) throws IllegalArgumentException
{
if ("javax.resource.spi.security.PasswordCredential".equals(fullQualifiedName))
{
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/InboundResourceAdapter.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/InboundResourceAdapter.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/InboundResourceAdapter.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -21,6 +21,8 @@
*/
package org.jboss.jca.common.metadata.ra.common;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -141,4 +143,116 @@
{
return "InboundResourceAdapter [messageadapter=" + messageadapter + ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * messageadapter TAG
+ */
+ MESSAGEADAPTER("messageadapter");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/LicenseType.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/LicenseType.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/LicenseType.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,8 +22,11 @@
package org.jboss.jca.common.metadata.ra.common;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -36,7 +39,7 @@
*/
private static final long serialVersionUID = 1590514246054447090L;
- private final List<LocalizedXsdString> description;
+ private final ArrayList<LocalizedXsdString> description;
private final boolean licenseRequired;
@@ -47,7 +50,7 @@
* @param licenseRequired mandatory boolena value
* @param id XML ID
*/
- public LicenseType(List<LocalizedXsdString> description, boolean licenseRequired, String id)
+ public LicenseType(ArrayList<LocalizedXsdString> description, boolean licenseRequired, String id)
{
super();
this.description = description;
@@ -158,5 +161,120 @@
{
return "LicenseType [description=" + description + ", licenseRequired=" + licenseRequired + ", id=" + id + "]";
}
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+ /**
+ * description tag
+ */
+ DESCRIPTION("description"),
+
+ /**
+ * vendor-name tag
+ */
+ LICENSE_REQUIRED("license-required");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageAdapter.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageAdapter.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageAdapter.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,8 +22,11 @@
package org.jboss.jca.common.metadata.ra.common;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -35,7 +38,7 @@
*/
private static final long serialVersionUID = 1731250340667920811L;
- private final List<MessageListener> messagelistener;
+ private final ArrayList<MessageListener> messagelistener;
private final String id;
@@ -47,7 +50,7 @@
* specification.
* @param id XML ID
*/
- public MessageAdapter(List<MessageListener> messagelistener, String id)
+ public MessageAdapter(ArrayList<MessageListener> messagelistener, String id)
{
super();
this.messagelistener = messagelistener;
@@ -144,4 +147,116 @@
{
return "MessageAdapter [messagelistener=" + messagelistener + ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * messagelistener TAG
+ */
+ MESSAGELISTENER("messagelistener");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageListener.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageListener.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/MessageListener.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -23,6 +23,9 @@
import org.jboss.jca.common.metadata.ra.ra15.Activationspec15;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
*
@@ -33,7 +36,7 @@
*/
private static final long serialVersionUID = 6417807206318228618L;
- private final String messagelistenerType;
+ private final XsdString messagelistenerType;
private final Activationspec15 activationspec;
@@ -47,7 +50,7 @@
* required configuration property names.
* @param id XML ID
*/
- public MessageListener(String messagelistenerType, Activationspec15 activationspec, String id)
+ public MessageListener(XsdString messagelistenerType, Activationspec15 activationspec, String id)
{
super();
this.messagelistenerType = messagelistenerType;
@@ -58,7 +61,7 @@
/**
* @return messagelistenerType
*/
- public String getMessagelistenerType()
+ public XsdString getMessagelistenerType()
{
return messagelistenerType;
}
@@ -166,4 +169,121 @@
return "MessageListener [messagelistenerType=" + messagelistenerType + ", activationspec=" + activationspec
+ ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * messagelistener-type TAG
+ */
+ MESSAGELISTENER_TYPE("messagelistener-type"),
+
+ /**
+ * activationspec TAG
+ */
+ ACTIVATIONSPEC("activationspec");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/OutboundResourceAdapter.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/OutboundResourceAdapter.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/OutboundResourceAdapter.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,8 +22,11 @@
package org.jboss.jca.common.metadata.ra.common;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -35,11 +38,11 @@
*/
private static final long serialVersionUID = 421345307326415666L;
- private final List<ConnectionDefinition> connectionDefinition;
+ private final ArrayList<ConnectionDefinition> connectionDefinition;
private final TransactionSupportEnum transactionSupport;
- private final List<AuthenticationMechanism> authenticationMechanism;
+ private final ArrayList<AuthenticationMechanism> authenticationMechanism;
private final Boolean reauthenticationSupport;
@@ -52,8 +55,8 @@
* @param reauthenticationSupport not mandatary boolean value
* @param id XML ID
*/
- public OutboundResourceAdapter(List<ConnectionDefinition> connectionDefinition,
- TransactionSupportEnum transactionSupport, List<AuthenticationMechanism> authenticationMechanism,
+ public OutboundResourceAdapter(ArrayList<ConnectionDefinition> connectionDefinition,
+ TransactionSupportEnum transactionSupport, ArrayList<AuthenticationMechanism> authenticationMechanism,
Boolean reauthenticationSupport, String id)
{
super();
@@ -209,4 +212,131 @@
+ transactionSupport + ", authenticationMechanism=" + authenticationMechanism
+ ", reauthenticationSupport=" + reauthenticationSupport + ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * connection-definition TAG
+ */
+ CONNECTION_DEFINITION("connection-definition"),
+
+ /**
+ * transaction-support TAG
+ */
+ TRANSACTION_SUPPORT("transaction-support"),
+
+ /**
+ * authentication-mechanism TAG
+ */
+ AUTHENTICATION_MECHANISM("authentication-mechanism"),
+
+ /**
+ * reauthentication-support TAG
+ */
+ REAUTHENTICATION_SUPPORT("reauthentication-support");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -21,248 +21,14 @@
*/
package org.jboss.jca.common.metadata.ra.common;
-
-import java.util.Collections;
-import java.util.List;
-
/**
- * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
*
+ * A ResourceAdapter.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
*/
-public class ResourceAdapter implements IdDecoratedMetadata
+public interface ResourceAdapter extends IdDecoratedMetadata
{
- /**
- */
- private static final long serialVersionUID = 4841095296099713549L;
- private final String resourceadapterClass;
-
- private final List<? extends ConfigProperty> configProperty;
-
- private final OutboundResourceAdapter outboundResourceadapter;
-
- private final InboundResourceAdapter inboundResourceadapter;
-
- private final List<Adminobject> adminobject;
-
- private final List<SecurityPermission> securityPermission;
-
- private final String id;
-
- /**
- * @param resourceadapterClass full qualified name of the class
- * @param configProperty confi properties for this RA
- * @param outboundResourceadapter outbound RA
- * @param inboundResourceadapter inbound RA
- * @param adminobject list of admin objects of this RA
- * @param securityPermission supported security permissions
- * @param id XML ID
- */
- public ResourceAdapter(String resourceadapterClass, List<? extends ConfigProperty> configProperty,
- OutboundResourceAdapter outboundResourceadapter, InboundResourceAdapter inboundResourceadapter,
- List<Adminobject> adminobject, List<SecurityPermission> securityPermission, String id)
- {
- super();
- this.resourceadapterClass = resourceadapterClass;
- this.configProperty = configProperty;
- this.outboundResourceadapter = outboundResourceadapter;
- this.inboundResourceadapter = inboundResourceadapter;
- this.adminobject = adminobject;
- this.securityPermission = securityPermission;
- this.id = id;
- }
-
- /**
- * @return resourceadapterClass
- */
- public String getResourceadapterClass()
- {
- return resourceadapterClass;
- }
-
- /**
- * @return configProperty
- */
- public List<? extends ConfigProperty> getConfigProperty()
- {
- return Collections.unmodifiableList(configProperty);
- }
-
- /**
- * @return outboundResourceadapter
- */
- public OutboundResourceAdapter getOutboundResourceadapter()
- {
- return outboundResourceadapter;
- }
-
- /**
- * @return inboundResourceadapter
- */
- public InboundResourceAdapter getInboundResourceadapter()
- {
- return inboundResourceadapter;
- }
-
- /**
- * @return adminobject
- */
- public List<Adminobject> getAdminobject()
- {
- return Collections.unmodifiableList(adminobject);
- }
-
- /**
- * @return securityPermission
- */
- public List<SecurityPermission> getSecurityPermission()
- {
- return Collections.unmodifiableList(securityPermission);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see IdDecoratedMetadata#getId()
- */
- @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 + ((adminobject == null) ? 0 : adminobject.hashCode());
- result = prime * result + ((configProperty == null) ? 0 : configProperty.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 + ((securityPermission == null) ? 0 : securityPermission.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 ResourceAdapter))
- {
- return false;
- }
- ResourceAdapter other = (ResourceAdapter) obj;
- if (adminobject == null)
- {
- if (other.adminobject != null)
- {
- return false;
- }
- }
- else if (!adminobject.equals(other.adminobject))
- {
- 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;
- }
- 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 (securityPermission == null)
- {
- if (other.securityPermission != null)
- {
- return false;
- }
- }
- else if (!securityPermission.equals(other.securityPermission))
- {
- return false;
- }
- return true;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- return "ResourceAdapter [resourceadapterClass=" + resourceadapterClass + ", configProperty=" + configProperty
- + ", outboundResourceadapter=" + outboundResourceadapter + ", inboundResourceadapter="
- + inboundResourceadapter + ", adminobject=" + adminobject + ", securityPermission=" + securityPermission
- + ", id=" + id + "]";
- }
}
Copied: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516.java (from rev 106918, projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter.java)
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516.java (rev 0)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/ResourceAdapter1516.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -0,0 +1,407 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
+ *
+ */
+public class ResourceAdapter1516 implements ResourceAdapter
+{
+ /**
+ */
+ private static final long serialVersionUID = 4841095296099713549L;
+
+ private final String resourceadapterClass;
+
+ private final ArrayList<? extends ConfigProperty> configProperty;
+
+ private final OutboundResourceAdapter outboundResourceadapter;
+
+ private final InboundResourceAdapter inboundResourceadapter;
+
+ private final ArrayList<Adminobject> adminobject;
+
+ private final ArrayList<SecurityPermission> securityPermission;
+
+ private final String id;
+
+ /**
+ * @param resourceadapterClass full qualified name of the class
+ * @param configProperty confi properties for this RA
+ * @param outboundResourceadapter outbound RA
+ * @param inboundResourceadapter inbound RA
+ * @param adminobject list of admin objects of this RA
+ * @param securityPermission supported security permissions
+ * @param id XML ID
+ */
+ public ResourceAdapter1516(String resourceadapterClass, ArrayList<? extends ConfigProperty> configProperty,
+ OutboundResourceAdapter outboundResourceadapter, InboundResourceAdapter inboundResourceadapter,
+ ArrayList<Adminobject> adminobject, ArrayList<SecurityPermission> securityPermission, String id)
+ {
+ super();
+ this.resourceadapterClass = resourceadapterClass;
+ this.configProperty = configProperty;
+ this.outboundResourceadapter = outboundResourceadapter;
+ this.inboundResourceadapter = inboundResourceadapter;
+ this.adminobject = adminobject;
+ this.securityPermission = securityPermission;
+ this.id = id;
+ }
+
+ /**
+ * @return resourceadapterClass
+ */
+ public String getResourceadapterClass()
+ {
+ return resourceadapterClass;
+ }
+
+ /**
+ * @return configProperty
+ */
+ public List<? extends ConfigProperty> getConfigProperty()
+ {
+ return Collections.unmodifiableList(configProperty);
+ }
+
+ /**
+ * @return outboundResourceadapter
+ */
+ public OutboundResourceAdapter getOutboundResourceadapter()
+ {
+ return outboundResourceadapter;
+ }
+
+ /**
+ * @return inboundResourceadapter
+ */
+ public InboundResourceAdapter getInboundResourceadapter()
+ {
+ return inboundResourceadapter;
+ }
+
+ /**
+ * @return adminobject
+ */
+ public List<Adminobject> getAdminobject()
+ {
+ return Collections.unmodifiableList(adminobject);
+ }
+
+ /**
+ * @return securityPermission
+ */
+ public List<SecurityPermission> getSecurityPermission()
+ {
+ return Collections.unmodifiableList(securityPermission);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see IdDecoratedMetadata#getId()
+ */
+ @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 + ((adminobject == null) ? 0 : adminobject.hashCode());
+ result = prime * result + ((configProperty == null) ? 0 : configProperty.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 + ((securityPermission == null) ? 0 : securityPermission.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 ResourceAdapter1516))
+ {
+ return false;
+ }
+ ResourceAdapter1516 other = (ResourceAdapter1516) obj;
+ if (adminobject == null)
+ {
+ if (other.adminobject != null)
+ {
+ return false;
+ }
+ }
+ else if (!adminobject.equals(other.adminobject))
+ {
+ 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;
+ }
+ 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 (securityPermission == null)
+ {
+ if (other.securityPermission != null)
+ {
+ return false;
+ }
+ }
+ else if (!securityPermission.equals(other.securityPermission))
+ {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "ResourceAdapter [resourceadapterClass=" + resourceadapterClass + ", configProperty=" + configProperty
+ + ", outboundResourceadapter=" + outboundResourceadapter + ", inboundResourceadapter="
+ + inboundResourceadapter + ", adminobject=" + adminobject + ", securityPermission=" + securityPermission
+ + ", id=" + id + "]";
+ }
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * resourceadapter-class tag
+ */
+ RESOURCEADAPTER_CLASS("resourceadapter-class"),
+
+ /**
+ * config-property tag
+ */
+ CONFIG_PROPERTY("config-property"),
+
+ /**
+ * outbound-resourceadapte TAG
+ */
+ OUTBOUND_RESOURCEADAPTER("outbound-resourceadapter"),
+
+ /**
+ * inbound-resourceadapter TAG
+ */
+ INBOUND_RESOURCEADAPTER("inbound-resourceadapter"),
+
+ /**
+ * adminobject TAG
+ */
+ ADMINOBJECT("adminobject"),
+
+ /**
+ * security-permission TAG
+ */
+ SECURITY_PERMISSION("security-permission");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/SecurityPermission.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/SecurityPermission.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/common/SecurityPermission.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,8 +22,11 @@
package org.jboss.jca.common.metadata.ra.common;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -35,7 +38,7 @@
*/
private static final long serialVersionUID = -7931009018498254330L;
- private final List<LocalizedXsdString> description;
+ private final ArrayList<LocalizedXsdString> description;
private final XsdString securityPermissionSpec;
@@ -46,7 +49,7 @@
* @param securityPermissionSpec the security permission spec as defined in the xml
* @param id XML ID
*/
- public SecurityPermission(List<LocalizedXsdString> description, XsdString securityPermissionSpec, String id)
+ public SecurityPermission(ArrayList<LocalizedXsdString> description, XsdString securityPermissionSpec, String id)
{
super();
this.description = description;
@@ -165,4 +168,120 @@
return "SecurityPermission [description=" + description + ", securityPermissionSpec=" + securityPermissionSpec
+ ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * description-class tag
+ */
+ DESCRIPTION("description"),
+
+ /**
+ * security-permission-spec tag
+ */
+ SECURITY_PERMISSION_SPEC("security-permission-spec");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/Connector10.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -28,8 +28,11 @@
import org.jboss.jca.common.metadata.ra.common.XsdString;
import org.jboss.jca.common.metadata.ra.ra16.Icon;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -44,16 +47,18 @@
private final String moduleName;
- private final List<LocalizedXsdString> description;
+ private final ArrayList<LocalizedXsdString> description;
private final XsdString displayName;
- private final String version = "1.0";
+ private static final String VERSION = "1.0";
- private final String specVersion = "1.0";
+ private final String version = Connector10.VERSION;
- private final List<Icon> icon;
+ private final String specVersion = VERSION;
+ private final ArrayList<Icon> icon;
+
/**
* @param moduleName name of the module
* @param description descriptions of this connector
@@ -66,7 +71,7 @@
* @param resourceadapter full qualified name of the resource adapter
* @param id XML ID
*/
- public Connector10(String moduleName, List<LocalizedXsdString> description, XsdString displayName, List<Icon> icon,
+ public Connector10(String moduleName, ArrayList<LocalizedXsdString> description, XsdString displayName, ArrayList<Icon> icon,
XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion, LicenseType license,
ResourceAdapter resourceadapter, String id)
{
@@ -207,4 +212,169 @@
+ ", eisType=" + eisType + ", license=" + license + ", resourceadapter=" + resourceadapter + ", id=" + id
+ "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * module-name tag
+ */
+ MODULENAME("module-name"),
+
+ /**
+ * vendor-name tag
+ */
+ VENDORNAME("vendor-name"),
+
+ /**
+ * eis-type tag
+ */
+ EIS_TYPE("eis-type"),
+
+ /**
+ * resourceadapter-version tag
+ */
+ RESOURCEADPTER_VERSION("resourceadapter-version"),
+
+ /**
+ * license tag
+ */
+ LICENSE("license"),
+
+ /**
+ * resourceadapter tag
+ */
+ RESOURCEADAPTER("resourceadapter"),
+
+ /**
+ * description tag
+ */
+ DESCRIPTION("description"),
+
+ /**
+ * icon tag
+ */
+ ICON("icon"),
+
+ /**
+ * spec-version TAG
+ */
+ SPEC_VERSION("spec-version"),
+
+ /**
+ * version TAG
+ */
+ VERSION("version"),
+
+ /**
+ * display-name tag
+ */
+ DISPLAY_NAME("display-name");
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id"),
+
+ /**
+ * version attribute
+ */
+ VERSION("version");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/ResourceAdapter10.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/ResourceAdapter10.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra10/ResourceAdapter10.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -23,21 +23,24 @@
import org.jboss.jca.common.metadata.ra.common.AuthenticationMechanism;
import org.jboss.jca.common.metadata.ra.common.ConfigProperty;
-import org.jboss.jca.common.metadata.ra.common.IdDecoratedMetadata;
+import org.jboss.jca.common.metadata.ra.common.ResourceAdapter;
import org.jboss.jca.common.metadata.ra.common.SecurityPermission;
import org.jboss.jca.common.metadata.ra.common.TransactionSupportEnum;
import org.jboss.jca.common.metadata.ra.common.XsdString;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
*
*/
-public class ResourceAdapter10 implements IdDecoratedMetadata
+public class ResourceAdapter10 implements ResourceAdapter
{
-
/** The serialVersionUID */
private static final long serialVersionUID = 6841574517370539456L;
@@ -53,13 +56,13 @@
private final TransactionSupportEnum transactionSupport;
- private final List<AuthenticationMechanism> authenticationMechanism;
+ private final ArrayList<AuthenticationMechanism> authenticationMechanism;
- private final List<ConfigProperty> configProperties;
+ private final ArrayList<ConfigProperty> configProperties;
private final Boolean reauthenticationSupport;
- private final List<SecurityPermission> securityPermission;
+ private final ArrayList<SecurityPermission> securityPermission;
private final String id;
@@ -81,9 +84,9 @@
*/
public ResourceAdapter10(XsdString managedConnectionFactoryClass, XsdString connectionFactoryInterface,
XsdString connectionFactoryImplClass, XsdString connectionInterface, XsdString connectionImplClass,
- TransactionSupportEnum transactionSupport, List<AuthenticationMechanism> authenticationMechanism,
- List<ConfigProperty> configProperties, Boolean reauthenticationSupport,
- List<SecurityPermission> securityPermission, String id)
+ TransactionSupportEnum transactionSupport, ArrayList<AuthenticationMechanism> authenticationMechanism,
+ ArrayList<ConfigProperty> configProperties, Boolean reauthenticationSupport,
+ ArrayList<SecurityPermission> securityPermission, String id)
{
super();
this.managedConnectionFactoryClass = managedConnectionFactoryClass;
@@ -166,7 +169,7 @@
*/
public List<AuthenticationMechanism> getAuthenticationMechanism()
{
- return authenticationMechanism;
+ return Collections.unmodifiableList(authenticationMechanism);
}
/**
@@ -176,7 +179,7 @@
*/
public List<ConfigProperty> getConfigProperties()
{
- return configProperties;
+ return Collections.unmodifiableList(configProperties);
}
/**
@@ -196,7 +199,7 @@
*/
public List<SecurityPermission> getSecurityPermission()
{
- return securityPermission;
+ return Collections.unmodifiableList(securityPermission);
}
/**
@@ -326,5 +329,158 @@
+ reauthenticationSupport + ", securityPermission=" + securityPermission + ", id=" + id + "]";
}
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+ /**
+ * managedconnectionfactory-class TAG
+ */
+ MANAGED_CONNECTIONFACTORY_CLASS("managedconnectionfactory-class"),
+
+ /**
+ * config-property TAG
+ */
+ CONFIG_PROPERTY("config-property"),
+
+ /**
+ * connectionfactory-interface TAG
+ */
+ CONNECTIONFACTORY_INTERFACE("connectionfactory-interface"),
+
+ /**
+ * connectionfactory-impl-class TAG
+ */
+ CONNECTIONFACTORY_IMPL_CLASS("connectionfactory-impl-class"),
+
+ /**
+ * connection-interface TAG
+ */
+ CONNECTION_INTERFACE("connection-interface"),
+
+ /**
+ * connection-impl-class TAG
+ */
+ CONNECTION_IMPL_CLASS("connection-impl-class"),
+
+ /**
+ * transaction-support TAG
+ */
+ TRANSACTION_SUPPORT("transaction-support"),
+
+ /**
+ * authentication-mechanism TAG
+ */
+ AUTHENTICATION_MECHANISM("authentication-mechanism"),
+ /**
+ * security-permission TAG
+ */
+ SECURITY_PERMISSION("security-permission"),
+ /**
+ * reauthentication-support TAG
+ */
+ REAUTHENTICATION_SUPPORT("reauthentication-support");
+
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Activationspec15.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Activationspec15.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Activationspec15.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -22,9 +22,10 @@
package org.jboss.jca.common.metadata.ra.ra15;
import org.jboss.jca.common.metadata.ra.common.IdDecoratedMetadata;
-import org.jboss.jca.common.metadata.ra.ra16.Activationspec16;
+import org.jboss.jca.common.metadata.ra.common.XsdString;
import org.jboss.jca.common.metadata.ra.ra16.RequiredConfigProperty;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -44,12 +45,12 @@
/**
* activationspec class name
*/
- protected final String activationspecClass;
+ protected final XsdString activationspecClass;
/**
* list of required properties
*/
- protected final List<RequiredConfigProperty> requiredConfigProperty;
+ protected final ArrayList<RequiredConfigProperty> requiredConfigProperty;
/**
* id attribute in xml file
@@ -64,7 +65,8 @@
* @param requiredConfigProperty list of required property
* @param id id attribute of xml file
*/
- public Activationspec15(String activationspecClass, List<RequiredConfigProperty> requiredConfigProperty, String id)
+ public Activationspec15(XsdString activationspecClass, ArrayList<RequiredConfigProperty> requiredConfigProperty,
+ String id)
{
super();
this.activationspecClass = activationspecClass;
@@ -75,7 +77,7 @@
/**
* @return activationspecClass
*/
- public String getActivationspecClass()
+ public XsdString getActivationspecClass()
{
return activationspecClass;
}
@@ -99,11 +101,7 @@
return id;
}
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Object#hashCode()
- */
+
@Override
public int hashCode()
{
@@ -115,61 +113,37 @@
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 Activationspec16))
- {
+ if (!(obj instanceof Activationspec15))
return false;
- }
- Activationspec16 other = (Activationspec16) obj;
+ Activationspec15 other = (Activationspec15) 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;
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra15/Connector15.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -23,9 +23,12 @@
import org.jboss.jca.common.metadata.ra.common.Connector;
import org.jboss.jca.common.metadata.ra.common.LicenseType;
-import org.jboss.jca.common.metadata.ra.common.ResourceAdapter;
+import org.jboss.jca.common.metadata.ra.common.ResourceAdapter1516;
import org.jboss.jca.common.metadata.ra.common.XsdString;
+import java.util.HashMap;
+import java.util.Map;
+
/**
*
* A Connector15.
@@ -39,8 +42,13 @@
/** The serialVersionUID */
private static final long serialVersionUID = 531372312218060928L;
- private final String version = "1.5";
+ /**
+ * VERSION constant
+ */
+ public static final String VERSION = "1.5";
+ private final String version = Connector15.VERSION;
+
/**
* the resource adapter version
*/
@@ -55,7 +63,7 @@
* @param id XML ID
*/
public Connector15(XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
- LicenseType license, ResourceAdapter resourceadapter, String id)
+ LicenseType license, ResourceAdapter1516 resourceadapter, String id)
{
super(vendorName, eisType, license, resourceadapter, id);
this.resourceadapterVersion = resourceadapterVersion;
@@ -124,4 +132,141 @@
+ vendorName + ", eisType=" + eisType + ", license=" + license + ", resourceadapter=" + resourceadapter
+ ", id=" + id + "]";
}
+
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * vendor-name tag
+ */
+ VENDORNAME("vendor-name"),
+
+ /**
+ * eis-type tag
+ */
+ EIS_TYPE("eis-type"),
+
+ /**
+ * resourceadapter-version tag
+ */
+ RESOURCEADPTER_VERSION("resourceadapter-version"),
+
+ /**
+ * license tag
+ */
+ LICENSE("license"),
+
+ /**
+ * resourceadapter tag
+ */
+ RESOURCEADAPTER("resourceadapter");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id"),
+
+ /**
+ * version attribute
+ */
+ VERSION("version");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Activationspec16.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Activationspec16.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Activationspec16.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -21,10 +21,15 @@
*/
package org.jboss.jca.common.metadata.ra.ra16;
+import org.jboss.jca.common.metadata.ra.common.ConfigProperty;
+import org.jboss.jca.common.metadata.ra.common.XsdString;
import org.jboss.jca.common.metadata.ra.ra15.Activationspec15;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -36,16 +41,16 @@
*/
private static final long serialVersionUID = -6951903183562100136L;
- private final List<ConfigProperty16> configProperty;
+ private final ArrayList<? extends ConfigProperty> configProperty;
/**
* @param activationspecClass full qualified name of the class
- * @param requiredConfigProperty a List of required config properties
+ * @param requiredConfigProperty a ArrayList of required config properties
* @param configProperty a list of (optional) config property
* @param id xmlID
*/
- public Activationspec16(String activationspecClass, List<RequiredConfigProperty> requiredConfigProperty,
- List<ConfigProperty16> configProperty, String id)
+ public Activationspec16(XsdString activationspecClass, ArrayList<RequiredConfigProperty> requiredConfigProperty,
+ ArrayList<? extends ConfigProperty> configProperty, String id)
{
super(activationspecClass, requiredConfigProperty, id);
this.configProperty = configProperty;
@@ -54,7 +59,7 @@
/**
* @return configProperty
*/
- public List<ConfigProperty16> getConfigProperty()
+ public List<? extends ConfigProperty> getConfigProperty()
{
return Collections.unmodifiableList(configProperty);
}
@@ -95,4 +100,125 @@
+ ", requiredConfigProperty=" + requiredConfigProperty + ", id=" + id + "]";
}
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * activationspec-class TAG
+ */
+ ACTIVATIONSPEC_CLASS("activationspec-class"),
+
+ /**
+ * required-config-property TAG
+ */
+ REQUIRED_CONFIG_PROPERTY("required-config-property"),
+
+ /**
+ * config-property TAG
+ */
+ CONFIG_PROPERTY("config-property");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/ConfigProperty16.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/ConfigProperty16.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/ConfigProperty16.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -25,7 +25,9 @@
import org.jboss.jca.common.metadata.ra.common.LocalizedXsdString;
import org.jboss.jca.common.metadata.ra.common.XsdString;
-import java.util.List;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -69,7 +71,7 @@
* property as confidential.
* @param id XML ID
*/
- public ConfigProperty16(List<LocalizedXsdString> description, XsdString configPropertyName,
+ public ConfigProperty16(ArrayList<LocalizedXsdString> description, XsdString configPropertyName,
XsdString configPropertyType, XsdString configPropertyValue, Boolean configPropertyIgnore,
Boolean configPropertySupportsDynamicUpdates, Boolean configPropertyConfidential, String id)
{
@@ -251,4 +253,145 @@
+ configPropertySupportsDynamicUpdates + ", configPropertyConfidential=" + configPropertyConfidential
+ ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * description-class tag
+ */
+ DESCRIPTION("description"),
+
+ /**
+ * config-property-name TAG
+ */
+ CONFIG_PROPERTY_NAME("config-property-name"),
+
+ /**
+ * config-property-type TAG
+ */
+ CONFIG_PROPERTY_TYPE("config-property-type"),
+
+ /**
+ * config-property-value TAG
+ */
+ CONFIG_PROPERTY_VALUE("config-property-value"),
+
+ /**
+ * config-property-ignore TAG
+ */
+ CONFIG_PROPERTY_IGNORE("config-property-ignore"),
+
+ /**
+ * config-property-supports-dynamic-updates TAG
+ */
+ CONFIG_PROPERTY_SUPPORT_DYNAMIC_UPDATE("config-property-supports-dynamic-updates"),
+
+ /**
+ * config-property-confidential TAG
+ */
+ CONFIG_PROPERTY_CONFIDENTIAL("config-property-confidential");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Connector16.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -23,12 +23,15 @@
import org.jboss.jca.common.metadata.ra.common.LicenseType;
import org.jboss.jca.common.metadata.ra.common.LocalizedXsdString;
-import org.jboss.jca.common.metadata.ra.common.ResourceAdapter;
+import org.jboss.jca.common.metadata.ra.common.ResourceAdapter1516;
import org.jboss.jca.common.metadata.ra.common.XsdString;
import org.jboss.jca.common.metadata.ra.ra15.Connector15;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -43,18 +46,23 @@
private final String moduleName;
- private final List<LocalizedXsdString> description;
+ private final ArrayList<Icon> icon;
- private final List<LocalizedXsdString> displayName;
+ private final ArrayList<String> requiredWorkContext;
- private final List<Icon> icon;
+ private final ArrayList<LocalizedXsdString> description;
- private final List<String> requiredWorkContext;
+ private final ArrayList<LocalizedXsdString> displayName;
private final Boolean metadataComplete;
- private final String version = "1.6";
+ /**
+ * VERSION constant
+ */
+ public static final String VERSION = "1.6";
+ private final String version = Connector16.VERSION;
+
/**
* @param moduleName name of the module
* @param description descriptions of this connector
@@ -69,9 +77,9 @@
* @param metadataComplete not mandatory boolean value
* @param id XML ID
*/
- public Connector16(String moduleName, List<LocalizedXsdString> description, List<LocalizedXsdString> displayName,
- List<Icon> icon, XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
- LicenseType license, ResourceAdapter resourceadapter, List<String> requiredWorkContext,
+ public Connector16(String moduleName, ArrayList<LocalizedXsdString> description, ArrayList<LocalizedXsdString> displayName,
+ ArrayList<Icon> icon, XsdString vendorName, XsdString eisType, XsdString resourceadapterVersion,
+ LicenseType license, ResourceAdapter1516 resourceadapter, ArrayList<String> requiredWorkContext,
Boolean metadataComplete, String id)
{
super(vendorName, eisType, resourceadapterVersion, license, resourceadapter, id);
@@ -132,6 +140,17 @@
}
/**
+ * Get the version.
+ *
+ * @return the version.
+ */
+ @Override
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /**
* {@inheritDoc}
*
* @see java.lang.Object#hashCode()
@@ -338,4 +357,169 @@
+ ", requiredWorkContext=" + requiredWorkContext + ", version=" + version + ", metadataComplete="
+ metadataComplete + ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * module-name tag
+ */
+ MODULENAME("module-name"),
+
+ /**
+ * vendor-name tag
+ */
+ VENDORNAME("vendor-name"),
+
+ /**
+ * eis-type tag
+ */
+ EIS_TYPE("eis-type"),
+
+ /**
+ * resourceadapter-version tag
+ */
+ RESOURCEADPTER_VERSION("resourceadapter-version"),
+
+ /**
+ * license tag
+ */
+ LICENSE("license"),
+
+ /**
+ * resourceadapter tag
+ */
+ RESOURCEADAPTER("resourceadapter"),
+
+ /**
+ * required-work-context tag
+ */
+ REQUIRED_WORK_CONTEXT("required-work-context"),
+
+ /**
+ * description tag
+ */
+ DESCRIPTION("description"),
+
+ /**
+ * icon tag
+ */
+ ICON("icon"),
+
+ /**
+ * display-name tag
+ */
+ DISPLAY_NAME("display-name");
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id"),
+
+ /**
+ * metadata-complete attribute
+ */
+ METADATA_COMPLETE("metadata-complete"),
+
+ /**
+ * version attribute
+ */
+ VERSION("version");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Icon.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Icon.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Icon.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -24,6 +24,9 @@
import org.jboss.jca.common.metadata.ra.common.IdDecoratedMetadata;
import org.jboss.jca.common.metadata.ra.common.LocalizedMetadata;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
*
@@ -196,4 +199,125 @@
{
return "Icon [smallIcon=" + smallIcon + ", largeIcon=" + largeIcon + ", lang=" + lang + ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * small-icon tag
+ */
+ SMALL_ICON("small-icon"),
+
+ /**
+ * large-icon tag
+ */
+ LARGE_ICON("large-icon");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id"),
+
+ /**
+ * lang atttribute
+ */
+ LANG("lang");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
}
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Path.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Path.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/Path.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -70,7 +70,7 @@
private static boolean isValid(String path)
{
- return false;
+ return true;
}
/**
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/RequiredConfigProperty.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/RequiredConfigProperty.java 2010-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ra/ra16/RequiredConfigProperty.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -23,9 +23,13 @@
import org.jboss.jca.common.metadata.ra.common.IdDecoratedMetadata;
import org.jboss.jca.common.metadata.ra.common.LocalizedXsdString;
+import org.jboss.jca.common.metadata.ra.common.XsdString;
+import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
/**
* @author <a href="mailto:stefano.maestri at jboss.org">Stefano Maestri</a>
@@ -37,9 +41,9 @@
*/
private static final long serialVersionUID = 4299927051352998447L;
- private final List<LocalizedXsdString> description;
+ private final ArrayList<LocalizedXsdString> description;
- private final String configPropertyName;
+ private final XsdString configPropertyName;
private final String id;
@@ -48,7 +52,7 @@
* @param configPropertyName name of the property
* @param id XML ID
*/
- public RequiredConfigProperty(List<LocalizedXsdString> description, String configPropertyName, String id)
+ public RequiredConfigProperty(ArrayList<LocalizedXsdString> description, XsdString configPropertyName, String id)
{
super();
this.description = description;
@@ -67,7 +71,7 @@
/**
* @return configPropertyName
*/
- public String getConfigPropertyName()
+ public XsdString getConfigPropertyName()
{
return configPropertyName;
}
@@ -167,4 +171,121 @@
return "RequiredConfigProperty [description=" + description + ", configPropertyName=" + configPropertyName
+ ", id=" + id + "]";
}
+
+ /**
+ *
+ * A Tag.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Tag
+ {
+ /** always first
+ *
+ */
+ UNKNOWN(null),
+
+ /**
+ * description TAG
+ */
+ DESCRIPTION("description"),
+
+ /**
+ * config-property-name TAG
+ */
+ CONFIG_PROPERTY_NAME("config-property-name");
+
+ 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;
+ }
+
+ }
+
+ /**
+ *
+ * A Attribute.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+ public enum Attribute
+ {
+
+ /** id attribute
+ *
+ */
+ ID("id");
+
+ private final String name;
+
+ /**
+ *
+ * Create a new Tag.
+ *
+ * @param name a name
+ */
+ Attribute(final String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ * Get the local name of this element.
+ *
+ * @return the local name
+ */
+ public String getLocalName()
+ {
+ return name;
+ }
+
+ }
+
}
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-07-22 16:48:01 UTC (rev 107033)
+++ projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/JbossRaParserTestCase.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -52,23 +52,34 @@
@Test
public void shouldParseJbossRa10WithSingleProperty() throws Exception
{
- //given
- File xmlFile = new File(Thread.currentThread().getContextClassLoader()
- .getResource("jboss-ra-1.0-single-attribute.xml").toURI());
- JbossRaParser parser = new JbossRaParser();
- //when
- JbossRa jbossRa = parser.parse(new FileInputStream(xmlFile));
- //then
- assertThat(jbossRa, instanceOf(JbossRa10.class));
- assertThat(jbossRa.getRaConfigProperties().size(), is(1));
- assertThat(
- jbossRa
- .getRaConfigProperties()
- .get(0)
- .equals(
- RaConfigProperty.buildRaConfigProperty("ra-config-property-name0", "ra-config-property-value0",
- "ra-config-property-type0", null)), is(true));
+ FileInputStream is = null;
+ try
+ {
+ //given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("jboss-ra-1.0-single-attribute.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ JbossRaParser parser = new JbossRaParser();
+ //when
+ JbossRa jbossRa = parser.parse(is);
+ //then
+ assertThat(jbossRa, instanceOf(JbossRa10.class));
+ assertThat(jbossRa.getRaConfigProperties().size(), is(1));
+ assertThat(
+ jbossRa
+ .getRaConfigProperties()
+ .get(0)
+ .equals(
+ RaConfigProperty.buildRaConfigProperty("ra-config-property-name0",
+ "ra-config-property-value0",
+ "ra-config-property-type0", null)), is(true));
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
}
/**
@@ -80,16 +91,27 @@
@Test
public void shouldParseJbossRa10WithOutProperties() throws Exception
{
- //given
- File xmlFile = new File(Thread.currentThread().getContextClassLoader()
- .getResource("jboss-ra-1.0-no-attributes.xml").toURI());
- JbossRaParser parser = new JbossRaParser();
- //when
- JbossRa jbossRa = parser.parse(new FileInputStream(xmlFile));
- //then
- assertThat(jbossRa, instanceOf(JbossRa10.class));
- assertThat(jbossRa.getRaConfigProperties().size(), is(0));
+ FileInputStream is = null;
+ try
+ {
+ //given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("jboss-ra-1.0-no-attributes.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ JbossRaParser parser = new JbossRaParser();
+ //when
+ JbossRa jbossRa = parser.parse(is);
+ //then
+ assertThat(jbossRa, instanceOf(JbossRa10.class));
+ assertThat(jbossRa.getRaConfigProperties().size(), is(0));
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
}
/**
@@ -101,29 +123,41 @@
@Test
public void shouldParseJbossRa10WithMultipleProperties() throws Exception
{
- //given
- File xmlFile = new File(Thread.currentThread().getContextClassLoader()
- .getResource("jboss-ra-1.0-multiple-attributes.xml").toURI());
- JbossRaParser parser = new JbossRaParser();
- //when
- JbossRa jbossRa = parser.parse(new FileInputStream(xmlFile));
- //then
- assertThat(jbossRa, instanceOf(JbossRa10.class));
- assertThat(jbossRa.getRaConfigProperties().size(), is(2));
- assertThat(
- jbossRa
- .getRaConfigProperties()
- .get(0)
- .equals(
- RaConfigProperty.buildRaConfigProperty("ra-config-property-name0", "ra-config-property-value0",
- "ra-config-property-type0", null)), is(true));
- assertThat(
- jbossRa
- .getRaConfigProperties()
- .get(1)
- .equals(
- RaConfigProperty.buildRaConfigProperty("ra-config-property-name1", "ra-config-property-value1",
- "ra-config-property-type1", null)), is(true));
+ FileInputStream is = null;
+ try
+ {
+ //given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("jboss-ra-1.0-multiple-attributes.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ JbossRaParser parser = new JbossRaParser();
+ //when
+ JbossRa jbossRa = parser.parse(is);
+ //then
+ assertThat(jbossRa, instanceOf(JbossRa10.class));
+ assertThat(jbossRa.getRaConfigProperties().size(), is(2));
+ assertThat(
+ jbossRa
+ .getRaConfigProperties()
+ .get(0)
+ .equals(
+ RaConfigProperty.buildRaConfigProperty("ra-config-property-name0",
+ "ra-config-property-value0",
+ "ra-config-property-type0", null)), is(true));
+ assertThat(
+ jbossRa
+ .getRaConfigProperties()
+ .get(1)
+ .equals(
+ RaConfigProperty.buildRaConfigProperty("ra-config-property-name1",
+ "ra-config-property-value1",
+ "ra-config-property-type1", null)), is(true));
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
}
/**
@@ -133,25 +167,36 @@
@Test
public void shouldParseJbossRa20WithSingleProperty() throws Exception
{
- //given
- File xmlFile = new File(Thread.currentThread().getContextClassLoader()
- .getResource("jboss-ra-2.0-single-attribute.xml").toURI());
- JbossRaParser parser = new JbossRaParser();
- //when
- JbossRa jbossRa = parser.parse(new FileInputStream(xmlFile));
- //then
- assertThat(jbossRa, instanceOf(JbossRa20.class));
- assertThat(jbossRa.getRaConfigProperties().size(), is(1));
- assertThat(
- jbossRa
- .getRaConfigProperties()
- .get(0)
- .equals(
- RaConfigProperty.buildRaConfigProperty("ra-config-property-name0", "ra-config-property-value0",
- "java.lang.Boolean", null)), is(true));
- assertThat(((JbossRa20) jbossRa).getBeanValidationGroups().size(), is(1));
- assertThat(((JbossRa20) jbossRa).getBootstrapContext(), is("bootstrap-context0"));
+ FileInputStream is = null;
+ try
+ {
+ //given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("jboss-ra-2.0-single-attribute.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ JbossRaParser parser = new JbossRaParser();
+ //when
+ JbossRa jbossRa = parser.parse(is);
+ //then
+ assertThat(jbossRa, instanceOf(JbossRa20.class));
+ assertThat(jbossRa.getRaConfigProperties().size(), is(1));
+ assertThat(
+ jbossRa
+ .getRaConfigProperties()
+ .get(0)
+ .equals(
+ RaConfigProperty.buildRaConfigProperty("ra-config-property-name0",
+ "ra-config-property-value0",
+ "java.lang.Boolean", null)), is(true));
+ assertThat(((JbossRa20) jbossRa).getBeanValidationGroups().size(), is(1));
+ assertThat(((JbossRa20) jbossRa).getBootstrapContext(), is("bootstrap-context0"));
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
}
/**
@@ -163,17 +208,27 @@
@Test
public void shouldParseJbossRa20WithOutProperties() throws Exception
{
- //given
- File xmlFile = new File(Thread.currentThread().getContextClassLoader()
- .getResource("jboss-ra-2.0-no-attributes.xml").toURI());
- JbossRaParser parser = new JbossRaParser();
- //when
- JbossRa jbossRa = parser.parse(new FileInputStream(xmlFile));
- //then
- assertThat(jbossRa, instanceOf(JbossRa20.class));
- assertThat(jbossRa.getRaConfigProperties().size(), is(0));
- assertThat(((JbossRa20) jbossRa).getBeanValidationGroups().size(), is(0));
+ FileInputStream is = null;
+ try
+ {
+ //given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("jboss-ra-2.0-no-attributes.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ JbossRaParser parser = new JbossRaParser();
+ //when
+ JbossRa jbossRa = parser.parse(is);
+ //then
+ assertThat(jbossRa, instanceOf(JbossRa20.class));
+ assertThat(jbossRa.getRaConfigProperties().size(), is(0));
+ assertThat(((JbossRa20) jbossRa).getBeanValidationGroups().size(), is(0));
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
}
/**
@@ -185,32 +240,44 @@
@Test
public void shouldParseJbossRa20WithMultipleProperties() throws Exception
{
- //given
- File xmlFile = new File(Thread.currentThread().getContextClassLoader()
- .getResource("jboss-ra-2.0-multiple-attributes.xml").toURI());
- JbossRaParser parser = new JbossRaParser();
- //when
- JbossRa jbossRa = parser.parse(new FileInputStream(xmlFile));
- //then
- assertThat(jbossRa, instanceOf(JbossRa20.class));
- assertThat(jbossRa.getRaConfigProperties().size(), is(2));
- assertThat(
- jbossRa
- .getRaConfigProperties()
- .get(0)
- .equals(
- RaConfigProperty.buildRaConfigProperty("ra-config-property-name0", "ra-config-property-value0",
- "java.lang.Boolean", null)), is(true));
- assertThat(
- jbossRa
- .getRaConfigProperties()
- .get(1)
- .equals(
- RaConfigProperty.buildRaConfigProperty("ra-config-property-name1", "ra-config-property-value1",
- "java.lang.Boolean", null)), is(true));
- assertThat(((JbossRa20) jbossRa).getBeanValidationGroups().size(), is(2));
- assertThat(((JbossRa20) jbossRa).getBootstrapContext(), is("bootstrap-context0"));
+ FileInputStream is = null;
+ try
+ {//given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("jboss-ra-2.0-multiple-attributes.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ JbossRaParser parser = new JbossRaParser();
+ //when
+ JbossRa jbossRa = parser.parse(is);
+ //then
+ assertThat(jbossRa, instanceOf(JbossRa20.class));
+ assertThat(jbossRa.getRaConfigProperties().size(), is(2));
+ assertThat(
+ jbossRa
+ .getRaConfigProperties()
+ .get(0)
+ .equals(
+ RaConfigProperty.buildRaConfigProperty("ra-config-property-name0",
+ "ra-config-property-value0",
+ "java.lang.Boolean", null)), is(true));
+ assertThat(
+ jbossRa
+ .getRaConfigProperties()
+ .get(1)
+ .equals(
+ RaConfigProperty.buildRaConfigProperty("ra-config-property-name1",
+ "ra-config-property-value1",
+ "java.lang.Boolean", null)), is(true));
+ assertThat(((JbossRa20) jbossRa).getBeanValidationGroups().size(), is(2));
+ assertThat(((JbossRa20) jbossRa).getBootstrapContext(), is("bootstrap-context0"));
+
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
}
// @Test
Added: 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 (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ra/RaParserTestCase.java 2010-07-22 16:56:08 UTC (rev 107034)
@@ -0,0 +1,135 @@
+/*
+ * 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.metadata.ra.common.Connector;
+import org.jboss.jca.common.metadata.ra.ra10.Connector10;
+import org.jboss.jca.common.metadata.ra.ra15.Connector15;
+import org.jboss.jca.common.metadata.ra.ra16.Connector16;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import org.junit.Test;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+import static org.junit.Assert.assertThat;
+
+/**
+ *
+ * A RaParserTestCase.
+ *
+ * @author <a href="stefano.maestri at jboss.com">Stefano Maestri</a>
+ *
+ */
+public class RaParserTestCase
+{
+ /**
+ * shouldParseConnector16
+ * @throws Exception in case of error
+ */
+ @Test
+ public void shouldParseConnector16() throws Exception
+ {
+
+ FileInputStream is = null;
+ try
+ {
+ //given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("connector-1.6-sample.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ RaParser parser = new RaParser();
+ //when
+ Connector connector = parser.parse(is);
+ //then
+ assertThat(connector, instanceOf(Connector16.class));
+ assertThat(connector.getVersion(), is("1.6"));
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+
+ }
+
+ /**
+ * shouldParseConnector15
+ * @throws Exception in case of error
+ */
+ @Test
+ public void shouldParseConnector15() throws Exception
+ {
+ FileInputStream is = null;
+ try
+ {
+ //given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("connector-1.5-sample.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ RaParser parser = new RaParser();
+ //when
+ Connector connector = parser.parse(is);
+ //then
+ assertThat(connector, instanceOf(Connector15.class));
+ assertThat(connector.getVersion(), is("1.5"));
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+
+ }
+
+ /**
+ * shouldParseConnector10
+ * @throws Exception in case of error
+ */
+ @Test
+ public void shouldParseConnector10() throws Exception
+ {
+ FileInputStream is = null;
+ try
+ {
+ //given
+ File xmlFile = new File(Thread.currentThread().getContextClassLoader()
+ .getResource("connector-1.0-sample.xml").toURI());
+ is = new FileInputStream(xmlFile);
+ RaParser parser = new RaParser();
+ //when
+ Connector connector = parser.parse(is);
+ //then
+ assertThat(connector, instanceOf(Connector10.class));
+ assertThat(connector.getVersion(), is("1.0"));
+ }
+ finally
+ {
+ if (is != null)
+ is.close();
+ }
+
+ }
+
+}
Added: projects/jboss-jca/trunk/common/src/test/resources/connector-1.0-sample.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/connector-1.0-sample.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/connector-1.0-sample.xml 2010-07-22 16:56:08 UTC (rev 107034)
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<connector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="file:/dati/project/RH/jboss-jca/common/src/main/resources/schema/connector_1_0.xsd" id="ID000">
+ <display-name id="ID001">
+ </display-name>
+ <description id="ID002">
+ </description>
+ <icon id="ID003">
+ <small-icon id="ID004">
+ </small-icon>
+ <large-icon id="ID005">
+ </large-icon>
+ </icon>
+ <vendor-name id="ID006">
+ </vendor-name>
+ <spec-version id="ID007">
+ </spec-version>
+ <eis-type id="ID008">
+ </eis-type>
+ <version id="ID009">
+ </version>
+ <license id="ID010">
+ <description id="ID011">
+ </description>
+ <license-required id="ID012">
+ </license-required>
+ </license>
+ <resourceadapter id="ID013">
+ <managedconnectionfactory-class id="ID014">
+ </managedconnectionfactory-class>
+ <connectionfactory-interface id="ID015">
+ </connectionfactory-interface>
+ <connectionfactory-impl-class id="ID016">
+ </connectionfactory-impl-class>
+ <connection-interface id="ID017">
+ </connection-interface>
+ <connection-impl-class id="ID018">
+ </connection-impl-class>
+ <transaction-support id="ID019">NoTransaction</transaction-support>
+ <config-property id="ID020">
+ <description id="ID021">
+ </description>
+ <config-property-name id="ID022">
+ </config-property-name>
+ <config-property-type id="ID023">
+ </config-property-type>
+ <config-property-value id="ID024">
+ </config-property-value>
+ </config-property>
+ <config-property id="ID025">
+ <description id="ID026">
+ </description>
+ <config-property-name id="ID027">
+ </config-property-name>
+ <config-property-type id="ID028">
+ </config-property-type>
+ <config-property-value id="ID029">
+ </config-property-value>
+ </config-property>
+ <authentication-mechanism id="ID030">
+ <description id="ID031">
+ </description>
+ <authentication-mechanism-type id="ID032">
+ </authentication-mechanism-type>
+ <credential-interface id="ID033">javax.resource.spi.security.PasswordCredential</credential-interface>
+ </authentication-mechanism>
+ <authentication-mechanism id="ID034">
+ <description id="ID035">
+ </description>
+ <authentication-mechanism-type id="ID036">
+ </authentication-mechanism-type>
+ <credential-interface id="ID037">javax.resource.spi.security.PasswordCredential</credential-interface>
+ </authentication-mechanism>
+ <reauthentication-support id="ID038">
+ </reauthentication-support>
+ <security-permission id="ID039">
+ <description id="ID040">
+ </description>
+ <security-permission-spec id="ID041">
+ </security-permission-spec>
+ </security-permission>
+ <security-permission id="ID042">
+ <description id="ID043">
+ </description>
+ <security-permission-spec id="ID044">
+ </security-permission-spec>
+ </security-permission>
+ </resourceadapter>
+</connector>
Added: projects/jboss-jca/trunk/common/src/test/resources/connector-1.5-sample.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/connector-1.5-sample.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/connector-1.5-sample.xml 2010-07-22 16:56:08 UTC (rev 107034)
@@ -0,0 +1,238 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee file:/home/oracle/connector_1_5.xsd" version="1.5" id="ID001">
+ <vendor-name>
+ </vendor-name>
+ <eis-type>
+ </eis-type>
+ <resourceadapter-version>
+ </resourceadapter-version>
+ <license id="ID003">
+ <description>
+ </description>
+ <description>
+ </description>
+ <license-required>
+ </license-required>
+ </license>
+ <resourceadapter id="ID005">
+ <resourceadapter-class>
+ </resourceadapter-class>
+ <config-property id="ID007">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ <config-property id="ID009">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ <outbound-resourceadapter id="ID011">
+ <connection-definition id="ID013">
+ <managedconnectionfactory-class>
+ </managedconnectionfactory-class>
+ <config-property id="ID015">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ <config-property id="ID017">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ <connectionfactory-interface>
+ </connectionfactory-interface>
+ <connectionfactory-impl-class>
+ </connectionfactory-impl-class>
+ <connection-interface>
+ </connection-interface>
+ <connection-impl-class>
+ </connection-impl-class>
+ </connection-definition>
+ <connection-definition id="ID019">
+ <managedconnectionfactory-class>
+ </managedconnectionfactory-class>
+ <config-property id="ID021">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ <config-property id="ID023">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ <connectionfactory-interface>
+ </connectionfactory-interface>
+ <connectionfactory-impl-class>
+ </connectionfactory-impl-class>
+ <connection-interface>
+ </connection-interface>
+ <connection-impl-class>
+ </connection-impl-class>
+ </connection-definition>
+ <transaction-support>NoTransaction</transaction-support>
+ <authentication-mechanism id="ID025">
+ <description>
+ </description>
+ <description>
+ </description>
+ <authentication-mechanism-type>
+ </authentication-mechanism-type>
+ <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+ </authentication-mechanism>
+ <authentication-mechanism id="ID027">
+ <description>
+ </description>
+ <description>
+ </description>
+ <authentication-mechanism-type>
+ </authentication-mechanism-type>
+ <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+ </authentication-mechanism>
+ <reauthentication-support>
+ </reauthentication-support>
+ </outbound-resourceadapter>
+ <inbound-resourceadapter id="ID029">
+ <messageadapter id="ID031">
+ <messagelistener id="ID033">
+ <messagelistener-type>
+ </messagelistener-type>
+ <activationspec id="ID035">
+ <activationspec-class>
+ </activationspec-class>
+ </activationspec>
+ </messagelistener>
+ <messagelistener id="ID037">
+ <messagelistener-type>
+ </messagelistener-type>
+ <activationspec id="ID039">
+ <activationspec-class>
+ </activationspec-class>
+ </activationspec>
+ </messagelistener>
+ </messageadapter>
+ </inbound-resourceadapter>
+ <adminobject id="ID041">
+ <adminobject-interface>
+ </adminobject-interface>
+ <adminobject-class>
+ </adminobject-class>
+ <config-property id="ID043">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ <config-property id="ID045">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ </adminobject>
+ <adminobject id="ID047">
+ <adminobject-interface>
+ </adminobject-interface>
+ <adminobject-class>
+ </adminobject-class>
+ <config-property id="ID049">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ <config-property id="ID051">
+ <description>
+ </description>
+ <description>
+ </description>
+ <config-property-name>
+ </config-property-name>
+ <config-property-type>
+ </config-property-type>
+ <config-property-value>
+ </config-property-value>
+ </config-property>
+ </adminobject>
+ <security-permission id="ID053">
+ <description>
+ </description>
+ <description>
+ </description>
+ <security-permission-spec>
+ </security-permission-spec>
+ </security-permission>
+ <security-permission id="ID055">
+ <description>
+ </description>
+ <description>
+ </description>
+ <security-permission-spec>
+ </security-permission-spec>
+ </security-permission>
+ </resourceadapter>
+</connector>
Added: projects/jboss-jca/trunk/common/src/test/resources/connector-1.6-sample.xml
===================================================================
--- projects/jboss-jca/trunk/common/src/test/resources/connector-1.6-sample.xml (rev 0)
+++ projects/jboss-jca/trunk/common/src/test/resources/connector-1.6-sample.xml 2010-07-22 16:56:08 UTC (rev 107034)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<connector xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee file:/home/oracle/connector_1_6.xsd" version="1.6" metadata-complete="false" id="ID001">
+ <module-name id="ID003">module-name0</module-name>
+ <description xml:lang="en-US" id="ID005">description0</description>
+ <description xml:lang="en-US" id="ID007">description1</description>
+ <display-name xml:lang="en-US" id="ID009">display-name0</display-name>
+ <display-name xml:lang="en-US" id="ID011">display-name1</display-name>
+ <icon xml:lang="en-US" id="ID013">
+ <small-icon id="ID015">small-icon0</small-icon>
+ <large-icon id="ID017">large-icon0</large-icon>
+ </icon>
+ <icon xml:lang="en-US" id="ID019">
+ <small-icon id="ID021">small-icon1</small-icon>
+ <large-icon id="ID023">large-icon1</large-icon>
+ </icon>
+ <vendor-name id="ID025">vendor-name0</vendor-name>
+ <eis-type id="ID027">eis-type0</eis-type>
+ <resourceadapter-version id="ID029">resourceadapter-version0</resourceadapter-version>
+ <license id="ID031">
+ <description xml:lang="en-US" id="ID033">description2</description>
+ <description xml:lang="en-US" id="ID035">description3</description>
+ <license-required id="ID037">false</license-required>
+ </license>
+ <resourceadapter id="ID039">
+ <resourceadapter-class id="ID041">resourceadapter-class0</resourceadapter-class>
+ <config-property id="ID043">
+ <description xml:lang="en-US" id="ID045">description4</description>
+ <description xml:lang="en-US" id="ID047">description5</description>
+ <config-property-name id="ID049">config-property-name0</config-property-name>
+ <config-property-type id="ID051">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID053">config-property-value0</config-property-value>
+ <config-property-ignore id="ID055">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID057">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID059">false</config-property-confidential>
+ </config-property>
+ <config-property id="ID061">
+ <description xml:lang="en-US" id="ID063">description6</description>
+ <description xml:lang="en-US" id="ID065">description7</description>
+ <config-property-name id="ID067">config-property-name1</config-property-name>
+ <config-property-type id="ID069">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID071">config-property-value1</config-property-value>
+ <config-property-ignore id="ID073">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID075">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID077">false</config-property-confidential>
+ </config-property>
+ <outbound-resourceadapter id="ID079">
+ <connection-definition id="ID081">
+ <managedconnectionfactory-class id="ID083">managedconnectionfactory-class0</managedconnectionfactory-class>
+ <config-property id="ID085">
+ <description xml:lang="en-US" id="ID087">description8</description>
+ <description xml:lang="en-US" id="ID089">description9</description>
+ <config-property-name id="ID091">config-property-name2</config-property-name>
+ <config-property-type id="ID093">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID095">config-property-value2</config-property-value>
+ <config-property-ignore id="ID097">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID099">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID101">false</config-property-confidential>
+ </config-property>
+ <config-property id="ID103">
+ <description xml:lang="en-US" id="ID105">description10</description>
+ <description xml:lang="en-US" id="ID107">description11</description>
+ <config-property-name id="ID109">config-property-name3</config-property-name>
+ <config-property-type id="ID111">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID113">config-property-value3</config-property-value>
+ <config-property-ignore id="ID115">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID117">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID119">false</config-property-confidential>
+ </config-property>
+ <connectionfactory-interface id="ID121">connectionfactory-interface0</connectionfactory-interface>
+ <connectionfactory-impl-class id="ID123">connectionfactory-impl-class0</connectionfactory-impl-class>
+ <connection-interface id="ID125">connection-interface0</connection-interface>
+ <connection-impl-class id="ID127">connection-impl-class0</connection-impl-class>
+ </connection-definition>
+ <connection-definition id="ID129">
+ <managedconnectionfactory-class id="ID131">managedconnectionfactory-class1</managedconnectionfactory-class>
+ <config-property id="ID133">
+ <description xml:lang="en-US" id="ID135">description12</description>
+ <description xml:lang="en-US" id="ID137">description13</description>
+ <config-property-name id="ID139">config-property-name4</config-property-name>
+ <config-property-type id="ID141">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID143">config-property-value4</config-property-value>
+ <config-property-ignore id="ID145">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID147">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID149">false</config-property-confidential>
+ </config-property>
+ <config-property id="ID151">
+ <description xml:lang="en-US" id="ID153">description14</description>
+ <description xml:lang="en-US" id="ID155">description15</description>
+ <config-property-name id="ID157">config-property-name5</config-property-name>
+ <config-property-type id="ID159">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID161">config-property-value5</config-property-value>
+ <config-property-ignore id="ID163">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID165">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID167">false</config-property-confidential>
+ </config-property>
+ <connectionfactory-interface id="ID169">connectionfactory-interface1</connectionfactory-interface>
+ <connectionfactory-impl-class id="ID171">connectionfactory-impl-class1</connectionfactory-impl-class>
+ <connection-interface id="ID173">connection-interface1</connection-interface>
+ <connection-impl-class id="ID175">connection-impl-class1</connection-impl-class>
+ </connection-definition>
+ <transaction-support id="ID177">NoTransaction</transaction-support>
+ <authentication-mechanism id="ID179">
+ <description xml:lang="en-US" id="ID181">description16</description>
+ <description xml:lang="en-US" id="ID183">description17</description>
+ <authentication-mechanism-type id="ID185">authentication-mechanism-type0</authentication-mechanism-type>
+ <credential-interface id="ID187">javax.resource.spi.security.PasswordCredential</credential-interface>
+ </authentication-mechanism>
+ <authentication-mechanism id="ID189">
+ <description xml:lang="en-US" id="ID191">description18</description>
+ <description xml:lang="en-US" id="ID193">description19</description>
+ <authentication-mechanism-type id="ID195">authentication-mechanism-type1</authentication-mechanism-type>
+ <credential-interface id="ID197">javax.resource.spi.security.PasswordCredential</credential-interface>
+ </authentication-mechanism>
+ <reauthentication-support id="ID199">false</reauthentication-support>
+ </outbound-resourceadapter>
+ <inbound-resourceadapter id="ID201">
+ <messageadapter id="ID203">
+ <messagelistener id="ID205">
+ <messagelistener-type id="ID207">messagelistener-type0</messagelistener-type>
+ <activationspec id="ID209">
+ <activationspec-class id="ID211">activationspec-class0</activationspec-class>
+ </activationspec>
+ </messagelistener>
+ <messagelistener id="ID213">
+ <messagelistener-type id="ID215">messagelistener-type1</messagelistener-type>
+ <activationspec id="ID217">
+ <activationspec-class id="ID219">activationspec-class1</activationspec-class>
+ </activationspec>
+ </messagelistener>
+ </messageadapter>
+ </inbound-resourceadapter>
+ <adminobject id="ID221">
+ <adminobject-interface id="ID223">adminobject-interface0</adminobject-interface>
+ <adminobject-class id="ID225">adminobject-class0</adminobject-class>
+ <config-property id="ID227">
+ <description xml:lang="en-US" id="ID229">description20</description>
+ <description xml:lang="en-US" id="ID231">description21</description>
+ <config-property-name id="ID233">config-property-name6</config-property-name>
+ <config-property-type id="ID235">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID237">config-property-value6</config-property-value>
+ <config-property-ignore id="ID239">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID241">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID243">false</config-property-confidential>
+ </config-property>
+ <config-property id="ID245">
+ <description xml:lang="en-US" id="ID247">description22</description>
+ <description xml:lang="en-US" id="ID249">description23</description>
+ <config-property-name id="ID251">config-property-name7</config-property-name>
+ <config-property-type id="ID253">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID255">config-property-value7</config-property-value>
+ <config-property-ignore id="ID257">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID259">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID261">false</config-property-confidential>
+ </config-property>
+ </adminobject>
+ <adminobject id="ID263">
+ <adminobject-interface id="ID265">adminobject-interface1</adminobject-interface>
+ <adminobject-class id="ID267">adminobject-class1</adminobject-class>
+ <config-property id="ID269">
+ <description xml:lang="en-US" id="ID271">description24</description>
+ <description xml:lang="en-US" id="ID273">description25</description>
+ <config-property-name id="ID275">config-property-name8</config-property-name>
+ <config-property-type id="ID277">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID279">config-property-value8</config-property-value>
+ <config-property-ignore id="ID281">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID283">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID285">false</config-property-confidential>
+ </config-property>
+ <config-property id="ID287">
+ <description xml:lang="en-US" id="ID289">description26</description>
+ <description xml:lang="en-US" id="ID291">description27</description>
+ <config-property-name id="ID293">config-property-name9</config-property-name>
+ <config-property-type id="ID295">java.lang.Boolean</config-property-type>
+ <config-property-value id="ID297">config-property-value9</config-property-value>
+ <config-property-ignore id="ID299">false</config-property-ignore>
+ <config-property-supports-dynamic-updates id="ID301">false</config-property-supports-dynamic-updates>
+ <config-property-confidential id="ID303">false</config-property-confidential>
+ </config-property>
+ </adminobject>
+ <security-permission id="ID305">
+ <description xml:lang="en-US" id="ID307">description28</description>
+ <description xml:lang="en-US" id="ID309">description29</description>
+ <security-permission-spec id="ID311">security-permission-spec0</security-permission-spec>
+ </security-permission>
+ <security-permission id="ID313">
+ <description xml:lang="en-US" id="ID315">description30</description>
+ <description xml:lang="en-US" id="ID317">description31</description>
+ <security-permission-spec id="ID319">security-permission-spec1</security-permission-spec>
+ </security-permission>
+ </resourceadapter>
+ <required-work-context id="ID321">required-work-context0</required-work-context>
+ <required-work-context id="ID323">required-work-context1</required-work-context>
+</connector>
More information about the jboss-cvs-commits
mailing list