[jboss-cvs] JBossAS SVN: r110827 - in projects/jboss-jca/trunk/rhq: src/main/java/org/jboss/jca/rhq/ra and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 3 07:59:00 EST 2011


Author: gaol
Date: 2011-03-03 07:59:00 -0500 (Thu, 03 Mar 2011)
New Revision: 110827

Added:
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/PluginDescriptorTestCase.java
Modified:
   projects/jboss-jca/trunk/rhq/
   projects/jboss-jca/trunk/rhq/.classpath
   projects/jboss-jca/trunk/rhq/build.xml
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java
   projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAResourceAdapter.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/XATestCase.java
   projects/jboss-jca/trunk/rhq/src/test/resources/xa.rar/META-INF/ironjacamar.xml
Log:
1. Added 2 extra config-property in XAResourceAdapter, one is password for confidential, one is score for dynamic update.

2. Changed ResourceAdapterResourcecomponent to implement ContentFacet interface so that it can deploy the RAR resource by uploading new .rar file. Change META-INF/rhq-plugin.xml to using <content> tag to indicate the ContentFacet.

3. Wrote PluginDescriptorTestCase to check META-INF/rhq-plugin.xml for syntax and structure.


Property changes on: projects/jboss-jca/trunk/rhq
___________________________________________________________________
Added: svn:ignore
   + ${build.dir}
${test.dir}


Modified: projects/jboss-jca/trunk/rhq/.classpath
===================================================================
--- projects/jboss-jca/trunk/rhq/.classpath	2011-03-03 12:34:32 UTC (rev 110826)
+++ projects/jboss-jca/trunk/rhq/.classpath	2011-03-03 12:59:00 UTC (rev 110827)
@@ -16,8 +16,14 @@
 	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/persistence-api.jar"/>
 	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/hibernate-annotations.jar"/>
 	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/rhq-core-native-system.jar"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/embedded/shrinkwrap-spi.jar"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/embedded/shrinkwrap-api.jar"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/rhq-core-plugin-container.jar"/>
 	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/rhq-core-client-api.jar"/>
-	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/rhq-core-plugin-container.jar"/>
-	<classpathentry kind="lib" path="/ironjacamar-parent/lib/embedded/shrinkwrap-api.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/ironjacamar-adapters"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/ironjacamar-deployer"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/ironjacamar-validator"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/rhq-core-comm-api.jar"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/rhq-core-util.jar"/>
 	<classpathentry kind="output" path="eclipse-target/classes"/>
 </classpath>

Modified: projects/jboss-jca/trunk/rhq/build.xml
===================================================================
--- projects/jboss-jca/trunk/rhq/build.xml	2011-03-03 12:34:32 UTC (rev 110826)
+++ projects/jboss-jca/trunk/rhq/build.xml	2011-03-03 12:59:00 UTC (rev 110827)
@@ -107,6 +107,7 @@
       
       <jvmarg line="${junit.jvm.options}"/>
       <sysproperty key="archives.dir" value="${build.rhq.dir}"/>
+      <sysproperty key="target.dir" value="${target.dir}"/>
       <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
       <sysproperty key="log4j.defaultInitOverride" value="true"/>
       <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>

Modified: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java	2011-03-03 12:34:32 UTC (rev 110826)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java	2011-03-03 12:59:00 UTC (rev 110827)
@@ -29,10 +29,20 @@
 import org.jboss.jca.rhq.core.ManagementRepositoryManager;
 import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
 
+import java.io.InputStream;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.rhq.core.domain.configuration.Configuration;
 import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.content.PackageType;
+import org.rhq.core.domain.content.transfer.DeployPackageStep;
+import org.rhq.core.domain.content.transfer.DeployPackagesResponse;
+import org.rhq.core.domain.content.transfer.RemovePackagesResponse;
+import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
+import org.rhq.core.pluginapi.content.ContentFacet;
+import org.rhq.core.pluginapi.content.ContentServices;
 
 /**
  * ResourceAdapterResourceComponent
@@ -40,7 +50,7 @@
  * @author <a href="mailto:yyang at gmail.com">Young Yang</a>
  * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
  */
-public class ResourceAdapterResourceComponent extends AbstractResourceComponent
+public class ResourceAdapterResourceComponent extends AbstractResourceComponent implements ContentFacet
 {
    /**
     * loadResourceConfiguration
@@ -62,4 +72,40 @@
       config.put(configList);
       return config;
    }
+
+   @Override
+   public DeployPackagesResponse deployPackages(Set<ResourcePackageDetails> arg0, ContentServices arg1)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   @Override
+   public Set<ResourcePackageDetails> discoverDeployedPackages(PackageType arg0)
+   {
+      Set<ResourcePackageDetails> details = new HashSet<ResourcePackageDetails>();
+      // TODO Auto-generated method stub
+      return details;
+   }
+
+   @Override
+   public List<DeployPackageStep> generateInstallationSteps(ResourcePackageDetails arg0)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   @Override
+   public RemovePackagesResponse removePackages(Set<ResourcePackageDetails> arg0)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   @Override
+   public InputStream retrievePackageBits(ResourcePackageDetails arg0)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
 }

Modified: projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml	2011-03-03 12:34:32 UTC (rev 110826)
+++ projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml	2011-03-03 12:59:00 UTC (rev 110827)
@@ -27,11 +27,300 @@
     </c:list-property>
 '>
 
+<!ENTITY datasourceAndConnectionFactoryConnectionResourceConfigProps '
+    <c:simple-property name="min-pool-size"
+                       displayName="Minimum Pool Size"
+                       type="integer"
+                       required="false"
+                       defaultValue="0">
+        <c:description>
+            The minimum number of connections the pool should hold. The default is 0.
+        </c:description>
+        <c:constraint>
+            <c:integer-constraint minimum="0"/>
+        </c:constraint>
+    </c:simple-property>
+
+    <c:simple-property name="max-pool-size"
+                       displayName="Maximum Pool Size"
+                       type="integer"
+                       required="false"
+                       defaultValue="10">
+        <c:description>
+            The maximum number of connections the pool should hold. The default is 10.
+        </c:description>
+        <c:constraint>
+            <c:integer-constraint minimum="0"/>
+        </c:constraint>
+    </c:simple-property>
+'>
+
+
+<!ENTITY datasourceAndConnectionFactoryAdvancedResourceConfigProps '
+    <c:simple-property name="allocation-retry" type="integer" required="false"
+                       defaultValue="0">
+        <c:description>
+            The number of times that allocating a connection should be tried before throwing an exception. The default
+            is 0.
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="allocation-retry-wait-millis" type="long" required="false"  units="milliseconds"
+                       defaultValue="5000">
+        <c:description>
+            The time in milliseconds to wait between retrying to allocate a connection. The default is 5000 (5 seconds).
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="background-validation" type="boolean" required="false" defaultValue="false">
+        <c:description>
+            Specify if connections should be validated on a background thread versus being validated
+            prior to use. Background validation is meant to reduce the overall load on the RDBMS system when validating
+            a connection. The default is No.
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="background-validation-millis" type="long" required="false" units="milliseconds"
+                       defaultValue="0">
+        <c:description>
+            The interval, in milliseconds, at which the ConnectionValidator will run.  Set to 0 to disable background
+            validation. The default is 0.
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="blocking-timeout-millis" displayName="Blocking Timeout in Milliseconds"
+                       units="milliseconds" defaultValue="30000"
+                       type="integer" required="false">
+        <c:description>
+            Indicates the maximum time in milliseconds to block while waiting for a connection before throwing
+            an exception. Note that this blocks only while waiting for a permit for a connection, and will never
+            throw an exception if creating a new connection takes an inordinately long time. The default is 30000
+            (30 seconds).
+        </c:description>
+        <c:constraint>
+            <c:integer-constraint minimum="0"/>
+        </c:constraint>
+    </c:simple-property>
+
+    <c:simple-property name="idle-timeout-minutes" type="integer" activationPolicy="immediate"
+                       displayName="Idle Timeout" units="minutes" required="false" defaultValue="30">
+        <c:description>
+            The maximum time, in minutes, a connection may be idle before being closed. The default is 30.
+        </c:description>
+        <c:constraint>
+            <c:integer-constraint minimum="0"/>
+        </c:constraint>
+    </c:simple-property>
+
+    <c:simple-property name="isSameRM-override-value" type="boolean" required="false">
+        <c:description>
+            If set, unconditionally sets the boolean return value of javax.transaction.xa.XAResource.isSameRM(XAResource).
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="jmx-invoker-name" required="false">
+        <c:description>
+            The ObjectName of the JMX Invoker MBean associated with this datasource.
+        </c:description>
+    </c:simple-property>
+
+    <c:map-property name="metadata" required="false" description="Metadata properties.">
+        <c:simple-property required="false" name="typeMapping">
+            <c:description>
+                The name of the corresponding type-mapping in conf/standardjbosscmp-jdbc.xml.
+            </c:description>
+            <c:property-options>
+                <c:option name="Cloudscape" value="Cloudscape"/>
+                <c:option name="DB2" value="DB2"/>
+                <c:option name="DB2/400" value="DB2/400"/>
+                <c:option name="Derby" value="Derby"/>
+                <c:option name="Firebird" value="Firebird"/>
+                <c:option name="FirstSQL/J" value="FirstSQL/J"/>
+                <c:option name="Hypersonic SQL" value="Hypersonic SQL"/>
+                <c:option name="InformixDB" value="InformixDB"/>
+                <c:option name="Ingres" value="Ingres"/>
+                <c:option name="InterBase" value="InterBase"/>
+                <c:option name="MaxDB" value="MaxDB"/>
+                <c:option name="McKoi" value="McKoi"/>
+                <c:option name="Mimer SQL" value="Mimer SQL"/>
+                <c:option name="MS SQLSERVER" value="MS SQLSERVER"/>
+                <c:option name="MS SQLSERVER2000" value="MS SQLSERVER2000"/>
+                <c:option name="Oracle7" value="Oracle7"/>
+                <c:option name="Oracle8" value="Oracle8"/>
+                <c:option name="Oracle9i" value="Oracle9i"/>
+                <c:option name="PointBase" value="PointBase"/>
+                <c:option name="PostgreSQL" value="PostgreSQL"/>
+                <c:option name="PostgreSQL 7.2" value="PostgreSQL 7.2"/>
+                <c:option name="PostgreSQL 8.0" value="PostgreSQL 8.0"/>
+                <c:option name="SapDB" value="SapDB"/>
+                <c:option name="SOLID" value="SOLID"/>
+                <c:option name="Sybase" value="Sybase"/>
+            </c:property-options>
+        </c:simple-property>
+    </c:map-property>
+
+    <c:simple-property name="no-tx-separate-pools" type="boolean"
+                       displayName="No Tx Separate Pools" required="false">
+        <c:description>
+            If true, the datasource cannot reuse a connection outside a transaction once enlisted in a global transaction
+            and vice-versa. The default is Yes.
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="prefill" type="boolean" required="false">
+        <c:description>
+            Whether to attempt to prefill the connection pool to the minimum number of connections. NOTE: Only
+            supporting pools (OnePool) support this feature. A warning can be found in the logs if the pool does not
+            support this. The default is No.
+        </c:description>
+    </c:simple-property>
+
+    <c:map-property name="security-domain" displayName="Security Settings" required="false">
+        <c:description>
+            Security settings for connections in the pool.
+        </c:description>
+
+        <c:simple-property name="securityDeploymentType" type="string"
+                           required="false" defaultValue="NONE">
+            <c:description>
+                Indicates whether Subject (from security domain), application-supplied parameters
+                (such as from getConnection(user, pw)), both Subject and app-supplied parameters,
+                or neither Subject nor app-supplied parameters are used to distinguish connections
+                in the pool. The default is "NONE".
+            </c:description>
+            <c:property-options>
+                <c:option name="None" value="NONE"/>
+                <c:option name="Application" value="APPLICATION"/>
+                <c:option name="Domain" value="DOMAIN"/>
+                <c:option name="Domain and Application" value="DOMAIN_AND_APPLICATION"/>
+            </c:property-options>
+        </c:simple-property>
+
+        <c:simple-property name="domain" type="string"
+                           required="false">
+            <c:description>
+                The name of the JAAS security manager that will handle authentication (only required if security
+                deployment type is DOMAIN or DOMAIN_AND_APPLICATION). This name correlates to the JAAS login-config.xml
+                descriptor application-policy/name attribute.
+            </c:description>
+        </c:simple-property>
+    </c:map-property>
+
+    <c:simple-property name="statistics-formatter" required="false">
+        <c:description>
+             The fully qualified class name of the class to use for formatting managed connection pool statistics for
+             this datasource. The class must implement the org.jboss.resource.statistic.formatter.StatisticsFormatter.
+             interface. The default is "org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="type-mapping" displayName="Type Mapping" required="false">
+        <c:description>
+            The name of the corresponding type-mapping in conf/standardjbosscmp-jdbc.xml.
+        </c:description>
+        <c:property-options>
+            <c:option name="Cloudscape" value="Cloudscape"/>
+            <c:option name="DB2" value="DB2"/>
+            <c:option name="DB2/400" value="DB2/400"/>
+            <c:option name="Derby" value="Derby"/>
+            <c:option name="Firebird" value="Firebird"/>
+            <c:option name="FirstSQL/J" value="FirstSQL/J"/>
+            <c:option name="Hypersonic SQL" value="Hypersonic SQL"/>
+            <c:option name="InformixDB" value="InformixDB"/>
+            <c:option name="Ingres" value="Ingres"/>
+            <c:option name="InterBase" value="InterBase"/>
+            <c:option name="MaxDB" value="MaxDB"/>
+            <c:option name="McKoi" value="McKoi"/>
+            <c:option name="Mimer SQL" value="Mimer SQL"/>
+            <c:option name="MS SQLSERVER" value="MS SQLSERVER"/>
+            <c:option name="MS SQLSERVER2000" value="MS SQLSERVER2000"/>
+            <c:option name="Oracle7" value="Oracle7"/>
+            <c:option name="Oracle8" value="Oracle8"/>
+            <c:option name="Oracle9i" value="Oracle9i"/>
+            <c:option name="PointBase" value="PointBase"/>
+            <c:option name="PostgreSQL" value="PostgreSQL"/>
+            <c:option name="PostgreSQL 7.2" value="PostgreSQL 7.2"/>
+            <c:option name="PostgreSQL 8.0" value="PostgreSQL 8.0"/>
+            <c:option name="SapDB" value="SapDB"/>
+            <c:option name="SOLID" value="SOLID"/>
+            <c:option name="Sybase" value="Sybase"/>
+        </c:property-options>
+    </c:simple-property>
+
+    <c:simple-property name="use-java-context"
+                       displayName="Use Java Context"
+                       type="boolean" defaultValue="true"
+                       required="false">
+        <c:description>
+            Indicates whether the JNDI name should be bound under the "java" context,
+            which causes the DataSource to only be accessible from within the JBossAS VM.
+            The default is Yes.
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="use-strict-min" type="boolean" required="false">
+        <c:description>
+             Whether idle connections below the min-pool-size should be closed. The default is No.
+        </c:description>
+    </c:simple-property>
+
+    <c:simple-property name="validate-on-match" type="boolean" required="false" defaultValue="true">
+        <c:description>
+            The validate-on-match element indicates whether or not connection level validation should be done when a
+            connection factory attempts to match a managed connection for a given set. This is typically exclusive to
+            the use of background validation. The default is Yes.
+        </c:description>
+    </c:simple-property>
+'>
+
+
+
 <!-- Metrics -->
 
 
 <!-- Operations  -->
 
+<!ENTITY datasourceAndConnectionFactoryOperations '
+    <operation name="flush" displayName="Flush"
+               description="Flush the connections in the pool"/>
+
+    <operation name="listFormattedSubPoolStatistics" displayName="List Formatted Sub Pool Statistics"
+               description="Obtain a formatted sub pool statistics report">
+        <parameters>
+            <c:simple-property required="false" name="formatClassName"
+                               defaultValue="org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter">
+                <c:description>
+                    The fully qualified name of the Java class to use to format the the sub pool statistics. The default
+                    is "org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter".
+                </c:description>
+            </c:simple-property>
+        </parameters>
+        <results>
+            <c:simple-property name="result" type="longString">
+                <c:description>
+                    A formatted sub pool statistics report.
+                </c:description>
+            </c:simple-property>
+        </results>
+    </operation>
+
+    <operation name="listStatistics" displayName="List Statistics" description="Obtain a statistics report">
+        <results>
+            <c:map-property name="result"/>
+        </results>
+    </operation>
+
+    <operation name="testConnection" displayName="Test Connection" description="Test if a connection can be obtained">
+        <results>
+            <c:notes>Test if a connection can be obtained</c:notes>
+            <c:simple-property type="boolean" name="result" description="Was a connection obtained?"/>
+        </results>
+    </operation>
+    
+    <operation name="resetConnectionPool" displayName="Reset connection pool" description="Rest connection pool" />
+'>
+
+
 ]>
 
 <plugin name="IronJacamar" displayName="IronJacamar Plugin"
@@ -50,44 +339,96 @@
 
 		<!-- Resource Adapter Archive (RAR) --> 
 		<service name="Resource Adapter Archive (RAR)" discovery="org.jboss.jca.rhq.ra.ResourceAdapterResourceDiscoveryComponent" 
-		    class="org.jboss.jca.rhq.ra.ResourceAdapterResourceComponent" supportsManualAdd="true">
+		    class="org.jboss.jca.rhq.ra.ResourceAdapterResourceComponent" createDeletePolicy="both" creationDataType="content">
 			
 			<plugin-configuration>
                 <c:group name="general" displayName="General">
                     <c:simple-property name="deploymentName" description="the name of this RAR" readOnly="true"/>
                     <c:simple-property name="filename" readOnly="true"/>
                 </c:group>
-                <c:group name="advanced" displayName="Advanced" hiddenByDefault="true">
-                    <c:simple-property name="extension" default="rar" readOnly="true"/>
-                    <c:simple-property name="descriptionTemplate" default="a standalone resource adapter" readOnly="true"/>
-                    <c:simple-property name="deploymentTypeName" default="JavaEEResourceAdaptor" readOnly="true">
-                        <c:description>
-                            The name of the item from the org.jboss.deployers.spi.management.KnownDeploymentTypes enum
-                            corresponding to this deployment's type.
-                        </c:description>
-                    </c:simple-property>
-                </c:group>
             </plugin-configuration>
+
+			<operation name="start"
+                       description="starts this RAR"/>
+
+            <operation name="stop"
+                       description="stops this RAR"/>
+
+            <operation name="restart"
+                       description="stops and then restarts this RAR"/>
+                       
+            <operation name="suspend"
+                       description="suspends this RAR"/>
+				
+			<content name="file" displayName="RAR File" category="deployable" isCreationType="true">
+            	
+            </content>
             
             <resource-configuration>
+                 <c:group name="general" displayName="General">
+                    <c:simple-property name="jndi_name" displayName="JNDI Name"/>
+                    <c:simple-property name="deploy_name" displayName="Name" readOnly="true"/>
+                    <c:simple-property name="class_name" displayName="Class Name" description="Class name of ResourceAdapter" />
+                    <c:simple-property name="use_ra_association" displayName="Use ResourceAdapterAssociation" type="boolean" readOnly="true"/>
+                    <c:simple-property name="source_path" displayName="Source Path" description="RAR file path" readOnly="true"/>
+                    <c:simple-property name="native_lig_dir" displayName="Native Lib Dir" description="native library directory" />
+                    <c:simple-property name="access_out_app" displayName="Access outside of App Enabled" description="Can this resource adapter be accessed from outside of the application?" type="boolean" />
+                    <c:simple-property name="access_to_class" displayName="Global Access To Classes Enabled" description="Is access to resource adapter classes enabled?" type="boolean" />
+                    
+                </c:group>
+                
 	             <c:group name="ConfigProperties" displayName="All Config Properties">
 					&advancedResourceConfigProps;						
                 </c:group>
 			</resource-configuration>
-				
-            
+			
+
             <!-- here are some resource configurations on the connector -->
 			
 			<!-- Managed Connection Factories. Includes No Tx / Tx connection factories  -->
 			<service name="Managed Connection Factories" discovery="org.jboss.jca.rhq.ra.ManagedConnectionFactoryResourceDiscoveryComponent"
 				class="org.jboss.jca.rhq.ra.ManagedConnectionFactoryResourceComponent" supportsManualAdd="true">
             
+            	&datasourceAndConnectionFactoryOperations;
+            
 				<resource-configuration>
+					 <c:group name="general" displayName="General">
+					    <c:simple-property name="jndi_name" displayName="JNDI Name"/>
+	                    <c:simple-property name="interface_class_name" displayName="interface class name" description="the interface class name of the managed connection factory" />
+	                    <c:simple-property name="trans_support_type" displayName="Transaction support type" description="Transaction support type">
+	                    	<c:property-options>
+				                <c:option name="No Transaction" value="no"/>
+				                <c:option name="Local Transaction" value="local"/>
+				                <c:option name="XA Transaction" value="xa"/>
+				            </c:property-options>
+	                    </c:simple-property>
+					 </c:group>
+					 
+					 <c:group name="Authentication" displayName="Authentication">
+					 	<c:simple-property name="re_auth_support" displayName="Reauthentication Support" type="boolean" description="Does this outbound connection support reauthentication?"></c:simple-property>
+					 	<c:simple-property name="res_auth_src" displayName="Resource Authentication Source">
+					 		<c:description>
+					 		   Is reauthentication application-based or container-based?
+					 		</c:description>
+					 		<c:property-options>
+					 			<c:option name="Container" value="Container"></c:option>
+					 			<c:option name="Application" value="Application"></c:option>
+					 		</c:property-options>
+					 	</c:simple-property>
+					 </c:group>
+					 
+					 <c:group name="conn_pool" displayName="Connection Pool">
+					 	 &datasourceAndConnectionFactoryConnectionResourceConfigProps;
+					 	 &datasourceAndConnectionFactoryAdvancedResourceConfigProps;
+					 </c:group>
+					 
 		             <c:group name="ConfigProperties" displayName="All Config Properties">
 						&advancedResourceConfigProps;						
 	                </c:group>
 				</resource-configuration>
 				
+				
+				
 			</service>
 			
 			<!-- Admin Objects -->
@@ -95,6 +436,10 @@
 			    class="org.jboss.jca.rhq.ra.AdminObjectResourceComponent" supportsManualAdd="true">
 				
 				<resource-configuration>
+	                 <c:group name="general" displayName="General">
+	                    <c:simple-property name="jndi_name" displayName="JNDI Name"/>
+	                    <c:simple-property name="interface_class_name" displayName="interface class name" description="the interface class name of the admin object" />
+	                </c:group>
 		             <c:group name="ConfigProperties" displayName="All Config Properties">
 						&advancedResourceConfigProps;						
 	                </c:group>

Modified: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAResourceAdapter.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAResourceAdapter.java	2011-03-03 12:34:32 UTC (rev 110826)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAResourceAdapter.java	2011-03-03 12:59:00 UTC (rev 110827)
@@ -62,7 +62,14 @@
    /** name */
    @ConfigProperty(defaultValue = "Jeff")
    private String name;
+   
+   /** password */
+   @ConfigProperty(defaultValue = "Confidential", confidential = true)
+   private String password;
 
+   /** score */
+   @ConfigProperty(defaultValue = "100", supportsDynamicUpdates = true, type = Integer.class)
+   private Integer score;
    /**
     * Default constructor
     */
@@ -89,8 +96,46 @@
    {
       return name;
    }
+   
+   
 
    /**
+    * Get password
+    * @return The password
+    */
+   public String getPassword()
+   {
+      return password;
+   }
+
+   /**
+    * Set password
+    * @param password the value to set
+    */
+   public void setPassword(String password)
+   {
+      this.password = password;
+   }
+
+   /**
+    * Get score
+    * @return The score
+    */
+   public Integer getScore()
+   {
+      return score;
+   }
+
+   /**
+    * Set score
+    * @param score the value to set
+    */
+   public void setScore(Integer score)
+   {
+      this.score = score;
+   }
+
+   /**
     * This is called during the activation of a message endpoint.
     *
     * @param endpointFactory A message endpoint factory instance.

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/PluginDescriptorTestCase.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/PluginDescriptorTestCase.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/PluginDescriptorTestCase.java	2011-03-03 12:59:00 UTC (rev 110827)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, 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.rhq.test;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import org.junit.Test;
+
+import org.rhq.core.clientapi.descriptor.configuration.ConfigurationDescriptor;
+import org.rhq.core.clientapi.descriptor.plugin.OperationDescriptor;
+import org.rhq.core.clientapi.descriptor.plugin.PluginDescriptor;
+import org.rhq.core.clientapi.descriptor.plugin.ResourceCreateDeletePolicy;
+import org.rhq.core.clientapi.descriptor.plugin.ResourceCreationData;
+import org.rhq.core.clientapi.descriptor.plugin.ServerDescriptor;
+import org.rhq.core.clientapi.descriptor.plugin.ServiceDescriptor;
+import org.rhq.core.pc.plugin.PluginDescriptorLoader;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Test cases on RHQ plugin descriptor validation.
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ *
+ */
+public class PluginDescriptorTestCase
+{
+
+   
+   /**
+    * Check plugin descriptor of syntax and structure
+    * 
+    * @throws Throwable if there is an error on the plug-in descriptor, like syntax error.
+    */
+   @Test
+   public void testValidatePluginDescriptor() throws Throwable
+   {
+      File pluginDir = new File(System.getProperty("target.dir"));
+      File pluginFile = new File(pluginDir, "ironjacamar-rhq.jar");
+      URL pluginURL = pluginFile.toURI().toURL();
+      PluginDescriptorLoader pluginLoader = new PluginDescriptorLoader(pluginURL, getClass().getClassLoader());
+      
+      // check syntax 
+      PluginDescriptor pluginDesc = pluginLoader.loadPluginDescriptor();
+      assertNotNull(pluginDesc);
+      
+      // check name and displayName
+      assertEquals("IronJacamar Plugin", pluginDesc.getDisplayName());
+      assertEquals("IronJacamar", pluginDesc.getName());
+      
+      // check server/service structure
+      List<ServerDescriptor> servers = pluginDesc.getServers();
+      assertEquals(1, servers.size());
+      
+      ServerDescriptor serverDesc = servers.get(0);
+      assertEquals("IronJacamar_AS7", serverDesc.getName());
+      
+      List<ServiceDescriptor> services = serverDesc.getServices();
+      assertEquals(1, services.size());
+      
+      ServiceDescriptor rarServiceDesc = services.get(0);
+      assertEquals("Resource Adapter Archive (RAR)", rarServiceDesc.getName());
+      assertEquals("org.jboss.jca.rhq.ra.ResourceAdapterResourceDiscoveryComponent", rarServiceDesc.getDiscovery());
+      assertEquals("org.jboss.jca.rhq.ra.ResourceAdapterResourceComponent", rarServiceDesc.getClazz());
+      assertEquals(ResourceCreateDeletePolicy.BOTH, rarServiceDesc.getCreateDeletePolicy());
+      assertEquals(ResourceCreationData.CONTENT, rarServiceDesc.getCreationDataType());
+      
+      // RAR service has the plugin configuration
+      ConfigurationDescriptor pluginConfDesc = rarServiceDesc.getPluginConfiguration();
+      assertNotNull(pluginConfDesc);
+      
+      // 4 operations for 
+      List<OperationDescriptor> rarOperDescs = rarServiceDesc.getOperation();
+      assertEquals(4, rarOperDescs.size());
+      
+      // RAR service has resource configuration
+      ConfigurationDescriptor resConfDesc = rarServiceDesc.getResourceConfiguration();
+      assertNotNull(resConfDesc);
+      
+      // 3 sub services in RAR service
+      List<ServiceDescriptor> subServiceDesc = rarServiceDesc.getServices();
+      assertEquals(3, subServiceDesc.size());
+      
+   }
+   
+}

Modified: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/XATestCase.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/XATestCase.java	2011-03-03 12:34:32 UTC (rev 110826)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/XATestCase.java	2011-03-03 12:59:00 UTC (rev 110827)
@@ -70,13 +70,15 @@
          assertNotNull(manRepo.getConnectors());
          assertEquals(0, manRepo.getConnectors().size());
 
-         deployment = XATestCase.class.getClassLoader().getResource("xa.rar");
+         File pluginDir = new File(System.getProperty("archives.dir"));
+         
+         File rarFile = new File(pluginDir, "test/xa.rar");
+         deployment = rarFile.toURI().toURL();
          embedded.deploy(deployment);
 
          assertEquals(1, manRepo.getConnectors().size());
+         
 
-         File pluginDir = new File(System.getProperty("archives.dir"));
-
          PluginContainerConfiguration pcConfig = new PluginContainerConfiguration();
          pcConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
          pcConfig.setPluginDirectory(pluginDir);

Modified: projects/jboss-jca/trunk/rhq/src/test/resources/xa.rar/META-INF/ironjacamar.xml
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/resources/xa.rar/META-INF/ironjacamar.xml	2011-03-03 12:34:32 UTC (rev 110826)
+++ projects/jboss-jca/trunk/rhq/src/test/resources/xa.rar/META-INF/ironjacamar.xml	2011-03-03 12:59:00 UTC (rev 110827)
@@ -27,6 +27,12 @@
              xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema 
              http://www.jboss.org/ironjacamar/schema/ironjacamar_1_0.xsd">
   <config-property name="name">Jeff</config-property>
+  
+  <!-- This is Confidential type config property -->
+  <config-property name="password">Confidential</config-property>
+  
+  <!-- This config property supports dynamic update -->
+  <config-property name="score">100</config-property>
 
   <transaction-support>XATransaction</transaction-support>
   



More information about the jboss-cvs-commits mailing list