[jboss-cvs] JBossAS SVN: r97877 - in projects/metadata/rar/trunk: src/main/java/org/jboss/metadata/rar/spec and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 16 06:07:58 EST 2009
Author: jeff.zhang
Date: 2009-12-16 06:07:57 -0500 (Wed, 16 Dec 2009)
New Revision: 97877
Added:
projects/metadata/rar/trunk/src/main/java/org/jboss/metadata/rar/spec/JCA10DTDMetaData.java
projects/metadata/rar/trunk/src/main/java/org/jboss/metadata/rar/spec/RA10MetaData.java
projects/metadata/rar/trunk/src/test/java/org/jboss/test/metadata/rar/RA10DTDUnitTestCase.java
projects/metadata/rar/trunk/src/test/resources/org/jboss/test/metadata/rar/RA10DTD_testEverything.xml
Modified:
projects/metadata/rar/trunk/pom.xml
projects/metadata/rar/trunk/src/test/resources/schema2class.properties
Log:
[JBMETA-234] connector DTD 1.0 metadata
Modified: projects/metadata/rar/trunk/pom.xml
===================================================================
--- projects/metadata/rar/trunk/pom.xml 2009-12-16 06:54:21 UTC (rev 97876)
+++ projects/metadata/rar/trunk/pom.xml 2009-12-16 11:07:57 UTC (rev 97877)
@@ -94,13 +94,13 @@
<dependency>
<groupId>org.jboss.metadata</groupId>
<artifactId>jboss-metadata-common</artifactId>
- <version>2.0.0.Alpha2</version>
+ <version>2.0.0.Alpha8</version>
</dependency>
<dependency>
<groupId>org.jboss.metadata</groupId>
<artifactId>jboss-metadata-common</artifactId>
- <version>2.0.0.Alpha2</version>
+ <version>2.0.0.Alpha8</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
Added: projects/metadata/rar/trunk/src/main/java/org/jboss/metadata/rar/spec/JCA10DTDMetaData.java
===================================================================
--- projects/metadata/rar/trunk/src/main/java/org/jboss/metadata/rar/spec/JCA10DTDMetaData.java (rev 0)
+++ projects/metadata/rar/trunk/src/main/java/org/jboss/metadata/rar/spec/JCA10DTDMetaData.java 2009-12-16 11:07:57 UTC (rev 97877)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.rar.spec;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.metadata.javaee.spec.JavaEEMetaDataConstants;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * Connector default namespace meta data
+ *
+ * @author Jeff Zhang
+ * @version $Revision:$
+ */
+ at XmlRootElement(name="connector")
+ at JBossXmlSchema(
+ ignoreUnresolvedFieldOrClass=false,
+ elementFormDefault=XmlNsForm.QUALIFIED,
+ normalizeSpace=true,
+ strict=false)
+ at XmlType(name="connectorType", propOrder={"descriptionGroup", "vendorName", "specVersion", "EISType", "oldVersion", "license", "ra10"})
+public class JCA10DTDMetaData extends ConnectorMetaData
+{
+ private static final long serialVersionUID = 7047138842348140262L;
+
+ /** The spec version */
+ private String specVersion;
+
+ /** The version */
+ private String oldVersion;
+
+ private RA10MetaData ra10;
+
+ /**
+ * @return the specVersion
+ */
+ public String getSpecVersion()
+ {
+ return specVersion;
+ }
+
+ /**
+ * @param specVersion the specVersion to set
+ */
+ @XmlElement(name="spec-version")
+ public void setSpecVersion(String specVersion)
+ {
+ this.specVersion = specVersion;
+ }
+
+ /**
+ * @return the oldVersion
+ */
+ public String getOldVersion()
+ {
+ return oldVersion;
+ }
+
+ /**
+ * @param oldVersion the oldVersion to set
+ */
+ @XmlElement(name="version")
+ public void setOldVersion(String oldVersion)
+ {
+ this.oldVersion = oldVersion;
+ }
+
+
+ @XmlElement(name="resourceadapter", required=true)
+ public void setRa10(RA10MetaData ra) throws Exception{
+ this.ra10 = ra;
+ }
+ public RA10MetaData getRa10() {
+ return ra10;
+ }
+
+}
+
+
Added: projects/metadata/rar/trunk/src/main/java/org/jboss/metadata/rar/spec/RA10MetaData.java
===================================================================
--- projects/metadata/rar/trunk/src/main/java/org/jboss/metadata/rar/spec/RA10MetaData.java (rev 0)
+++ projects/metadata/rar/trunk/src/main/java/org/jboss/metadata/rar/spec/RA10MetaData.java 2009-12-16 11:07:57 UTC (rev 97877)
@@ -0,0 +1,232 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.rar.spec;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import org.jboss.metadata.javaee.support.IdMetaDataImpl;
+
+/**
+ * Resource Adapter 1.0 meta data
+ *
+ * @author Jeff Zhang
+ * @version $Revision: $
+ */
+ at XmlType(name="connection-definitionType",
+ propOrder={"managedConnectionFactoryClass","connectionFactoryInterfaceClass",
+ "connectionFactoryImplementationClass", "connectionInterfaceClass", "connectionImplementationClass",
+ "transSupport", "configProps", "authMechanisms",
+ "reAuthSupport", "securityPermissions"})
+public class RA10MetaData extends IdMetaDataImpl
+{
+ private static final long serialVersionUID = -138227135002730221L;
+
+ /** The managed connection factory class */
+ private String managedConnectionFactoryClass;
+
+ /** The connector metadata */
+ private List<ConfigPropertyMetaData> configProps;
+
+ /** The connection factory interface class */
+ private String connectionFactoryInterfaceClass;
+
+ /** The connection factory implementation class */
+ private String connectionFactoryImplementationClass;
+
+ /** The connection interface class */
+ private String connectionInterfaceClass;
+
+ /** The connection implementation class */
+ private String connectionImplementationClass;
+
+ private TransactionSupportMetaData transSupport;
+ private List<AuthenticationMechanismMetaData> authMechanisms;
+ private boolean reAuthSupport;
+ private List<SecurityPermissionMetaData> securityPermissions;
+
+
+ /**
+ * Get the managed connection factory class
+ *
+ * @return the managed connection factory class
+ */
+ public String getManagedConnectionFactoryClass()
+ {
+ return managedConnectionFactoryClass;
+ }
+
+ /**
+ * Set the managed connection factory class
+ *
+ * @param managedConnectionFactoryClass the class name
+ */
+ @XmlElement(name="managedconnectionfactory-class", required=true)
+ public void setManagedConnectionFactoryClass(String managedConnectionFactoryClass)
+ {
+ this.managedConnectionFactoryClass = managedConnectionFactoryClass;
+ }
+
+ @XmlElement(name="config-property")
+ public void setConfigProps(List<ConfigPropertyMetaData> configProps) {
+ this.configProps = configProps;
+ }
+
+ public List<ConfigPropertyMetaData> getConfigProps() {
+ return configProps;
+ }
+ /**
+ * Get the connection factory interface class
+ *
+ * @return the connection factory interface class
+ */
+ public String getConnectionFactoryInterfaceClass()
+ {
+ return connectionFactoryInterfaceClass;
+ }
+
+ /**
+ * Set the connection factory interface class
+ *
+ * @param connectionFactoryInterfaceClass the class name
+ */
+ @XmlElement(name="connectionfactory-interface", required=true)
+ public void setConnectionFactoryInterfaceClass(String connectionFactoryInterfaceClass)
+ {
+ this.connectionFactoryInterfaceClass = connectionFactoryInterfaceClass;
+ }
+
+ /**
+ * Get the connection factory implementation class
+ *
+ * @return the connection factory implementation class
+ */
+ public String getConnectionFactoryImplementationClass()
+ {
+ return connectionFactoryImplementationClass;
+ }
+
+ /**
+ * Set the connection factory implementation class
+ *
+ * @param connectionFactoryImplementationClass the class name
+ */
+ @XmlElement(name="connectionfactory-impl-class", required=true)
+ public void setConnectionFactoryImplementationClass(String connectionFactoryImplementationClass)
+ {
+ this.connectionFactoryImplementationClass = connectionFactoryImplementationClass;
+ }
+
+ /**
+ * Get the connection interface class
+ *
+ * @return the connection interface class
+ */
+ public String getConnectionInterfaceClass()
+ {
+ return connectionInterfaceClass;
+ }
+
+ /**
+ * Set the connection interface class
+ *
+ * @param connectionInterfaceClass the class name
+ */
+ @XmlElement(name="connection-interface", required=true)
+ public void setConnectionInterfaceClass(String connectionInterfaceClass)
+ {
+ this.connectionInterfaceClass = connectionInterfaceClass;
+ }
+
+ /**
+ * Get the connection implementation class
+ *
+ * @return the connection implementation class
+ */
+ public String getConnectionImplementationClass()
+ {
+ return connectionImplementationClass;
+ }
+
+ /**
+ * Set the connection implementation class
+ *
+ * @param connectionImplementationClass the class name
+ */
+ @XmlElement(name="connection-impl-class", required=true)
+ public void setConnectionImplementationClass(String connectionImplementationClass)
+ {
+ this.connectionImplementationClass = connectionImplementationClass;
+ }
+
+ @XmlElement(name="transaction-support")
+ public void setTransSupport(TransactionSupportMetaData transSupport) {
+ this.transSupport = transSupport;
+ }
+
+ public TransactionSupportMetaData getTransSupport() {
+ return transSupport;
+ }
+
+ @XmlElement(name="authentication-mechanism")
+ public void setAuthMechanisms(List<AuthenticationMechanismMetaData> authMechanisms) {
+ this.authMechanisms = authMechanisms;
+ }
+
+ public List<AuthenticationMechanismMetaData> getAuthMechanisms() {
+ return authMechanisms;
+ }
+
+ @XmlElement(name="reauthentication-support")
+ public void setReAuthSupport(boolean reAuthSupport) {
+ this.reAuthSupport = reAuthSupport;
+ }
+
+ public boolean isReAuthSupport() {
+ return reAuthSupport;
+ }
+
+ @XmlElement(name="security-permission")
+ public void setSecurityPermissions(List<SecurityPermissionMetaData> securityPermissions) {
+ this.securityPermissions = securityPermissions;
+ }
+
+ public List<SecurityPermissionMetaData> getSecurityPermissions() {
+ return securityPermissions;
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("ConnectionDefinitionMetaData").append('@');
+ buffer.append(Integer.toHexString(System.identityHashCode(this)));
+ buffer.append("[managedConnectionFactoryClass=").append(managedConnectionFactoryClass);
+ buffer.append(" connectionFactoryInterfaceClass=").append(connectionFactoryInterfaceClass);
+ buffer.append(" connectionFactoryImplementationClass=").append(connectionFactoryImplementationClass);
+ buffer.append(" connectionInterfaceClass=").append(connectionInterfaceClass);
+ buffer.append(" connectionImplementationClass=").append(connectionImplementationClass);
+ buffer.append(" properties=").append(configProps);
+ buffer.append(']');
+ return buffer.toString();
+ }
+}
+
Added: projects/metadata/rar/trunk/src/test/java/org/jboss/test/metadata/rar/RA10DTDUnitTestCase.java
===================================================================
--- projects/metadata/rar/trunk/src/test/java/org/jboss/test/metadata/rar/RA10DTDUnitTestCase.java (rev 0)
+++ projects/metadata/rar/trunk/src/test/java/org/jboss/test/metadata/rar/RA10DTDUnitTestCase.java 2009-12-16 11:07:57 UTC (rev 97877)
@@ -0,0 +1,90 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.test.metadata.rar;
+
+
+import org.jboss.metadata.rar.spec.ActivationspecMetaData;
+import org.jboss.metadata.rar.spec.RA10MetaData;
+import org.jboss.metadata.rar.spec.ConnectorMetaData;
+import org.jboss.metadata.rar.spec.JCA10DTDMetaData;
+import org.jboss.metadata.rar.spec.TransactionSupportMetaData;
+import org.jboss.test.metadata.common.MetaDataSchemaResolverFactory;
+import org.jboss.test.metadata.javaee.AbstractJavaEEEverythingTest;
+import org.jboss.xb.binding.resolver.MutableSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+/**
+ * Test ResourceAdapter ra.xml metadata.
+ *
+ * @author Jeff Zhang
+ * @version $Revision:$
+ */
+public class RA10DTDUnitTestCase extends AbstractJavaEEEverythingTest
+{
+
+ public RA10DTDUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testEverything() throws Exception
+ {
+ JCA10DTDMetaData connector = (JCA10DTDMetaData)unmarshal();
+ assertNotNull(connector);
+ assertEverything(connector);
+ }
+
+ protected ConnectorMetaData unmarshal() throws Exception
+ {
+ return unmarshal(ConnectorMetaData.class);
+ }
+
+ protected void assertEverything(JCA10DTDMetaData connector) throws Exception
+ {
+ assertTrue(connector.getVendorName().startsWith("Red"));
+ assertTrue(connector.getEISType().startsWith("JMS"));
+ assertEquals(connector.getOldVersion(), "6.0");
+ assertEquals(connector.getSpecVersion(), "1.0");
+ assertNotNull(connector.getLicense());
+ assertTrue(connector.getLicense().getRequired());
+
+ assertNotNull(connector.getRa10());
+ RA10MetaData ra10 = connector.getRa10();
+ assertTrue(ra10.getManagedConnectionFactoryClass().endsWith("JmsManagedConnectionFactory"));
+ assertEquals(ra10.getConfigProps().size(), 7);
+ assertEquals(ra10.getConfigProps().get(6).getName(), "UseTryLock");
+ assertTrue(ra10.getConnectionFactoryInterfaceClass().endsWith("JmsConnectionFactory"));
+ assertTrue(ra10.getConnectionFactoryImplementationClass().endsWith("JmsConnectionFactoryImpl"));
+ assertTrue(ra10.getConnectionInterfaceClass().endsWith("Session"));
+ assertTrue(ra10.getConnectionImplementationClass().endsWith("JmsSession"));
+
+ assertEquals(ra10.getTransSupport(), TransactionSupportMetaData.XATransaction);
+ assertNotNull(ra10.getAuthMechanisms().get(0));
+ assertEquals(ra10.getAuthMechanisms().get(0).getAuthenticationMechanismType(), "BasicPassword");
+ assertTrue(ra10.getAuthMechanisms().get(0).getCredentialInterfaceClass().endsWith("PasswordCredential"));
+ assertFalse(ra10.isReAuthSupport());
+ assertNotNull(ra10.getSecurityPermissions());
+ assertEquals(ra10.getSecurityPermissions().get(0).getSecurityPermissionSpec(), "sa");
+ }
+
+}
+
Added: projects/metadata/rar/trunk/src/test/resources/org/jboss/test/metadata/rar/RA10DTD_testEverything.xml
===================================================================
--- projects/metadata/rar/trunk/src/test/resources/org/jboss/test/metadata/rar/RA10DTD_testEverything.xml (rev 0)
+++ projects/metadata/rar/trunk/src/test/resources/org/jboss/test/metadata/rar/RA10DTD_testEverything.xml 2009-12-16 11:07:57 UTC (rev 97877)
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Id:$ -->
+
+<!DOCTYPE connector PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Connector 1.0//EN"
+ "http://java.sun.com/dtd/connector_1_0.dtd">
+
+<connector>
+
+ <!-- description group -->
+ <display-name>en-connector-disp</display-name>
+ <description>en-connector-desc</description>
+
+ <icon id="en-connector-icon-id">
+ <small-icon>en-connector-small-icon</small-icon>
+ <large-icon>en-connector-large-icon</large-icon>
+ </icon>
+
+ <vendor-name>Red Hat Middleware LLC</vendor-name>
+ <spec-version>1.0</spec-version>
+ <eis-type>JMS 1.1 Server</eis-type>
+ <version>6.0</version>
+
+ <license>
+ <description>
+ JBoss, Home of Professional Open Source.
+ Copyright 2006, 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.
+ </description>
+ <license-required>true</license-required>
+ </license>
+
+ <resourceadapter>
+
+ <managedconnectionfactory-class>org.jboss.resource.adapter.jms.JmsManagedConnectionFactory</managedconnectionfactory-class>
+ <connectionfactory-interface>org.jboss.resource.adapter.jms.JmsConnectionFactory</connectionfactory-interface>
+ <connectionfactory-impl-class>org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl</connectionfactory-impl-class>
+ <connection-interface>javax.jms.Session</connection-interface>
+ <connection-impl-class>org.jboss.resource.adapter.jms.JmsSession</connection-impl-class>
+ <transaction-support>XATransaction</transaction-support>
+ <config-property>
+ <description>The jndi name of the provider of connection factories</description>
+ <config-property-name>JmsProviderAdapterJNDI</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>java:DefaultJMSProvider</config-property-value>
+ </config-property>
+ <config-property>
+ <description>The default session type</description>
+ <config-property-name>SessionDefaultType</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>javax.jms.Topic</config-property-value>
+ </config-property>
+ <config-property>
+ <description>The user name used to login to the jms server</description>
+ <config-property-name>UserName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <description>The password used to login to the jms server</description>
+ <config-property-name>Password</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <description>The client id for this connection factory</description>
+ <config-property-name>ClientID</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>Strict</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ <config-property-value>true</config-property-value>
+ </config-property>
+ <config-property>
+ <description>Maximum wait for a lock</description>
+ <config-property-name>UseTryLock</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ </config-property>
+
+
+ <authentication-mechanism id="amid">
+ <description>authentication-mechanism</description>
+ <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
+ <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
+ </authentication-mechanism>
+ <reauthentication-support>false</reauthentication-support>
+ <security-permission>
+ <description></description>
+ <security-permission-spec>sa</security-permission-spec>
+ </security-permission>
+
+
+ </resourceadapter>
+</connector>
Modified: projects/metadata/rar/trunk/src/test/resources/schema2class.properties
===================================================================
--- projects/metadata/rar/trunk/src/test/resources/schema2class.properties 2009-12-16 06:54:21 UTC (rev 97876)
+++ projects/metadata/rar/trunk/src/test/resources/schema2class.properties 2009-12-16 11:07:57 UTC (rev 97877)
@@ -1,4 +1,5 @@
# RA
+connector_1_0.dtd org.jboss.metadata.rar.spec.JCA10DTDMetaData
connector_1_5.xsd org.jboss.metadata.rar.spec.JCA15MetaData
connector_1_5.dtd org.jboss.metadata.rar.spec.JCA15DTDMetaData
connector_1_6.xsd org.jboss.metadata.rar.spec.JCA16MetaData
More information about the jboss-cvs-commits
mailing list