[jboss-cvs] JBossAS SVN: r110748 - in projects/jboss-jca/trunk: rhq and 27 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 22 20:42:06 EST 2011


Author: jeff.zhang
Date: 2011-02-22 20:42:05 -0500 (Tue, 22 Feb 2011)
New Revision: 110748

Added:
   projects/jboss-jca/trunk/rhq/
   projects/jboss-jca/trunk/rhq/.classpath
   projects/jboss-jca/trunk/rhq/.project
   projects/jboss-jca/trunk/rhq/build.xml
   projects/jboss-jca/trunk/rhq/src/
   projects/jboss-jca/trunk/rhq/src/main/
   projects/jboss-jca/trunk/rhq/src/main/java/
   projects/jboss-jca/trunk/rhq/src/main/java/org/
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/AbstractResourceComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/BaseResourceComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/Discover.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarPluginLifecyleListener.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarResourceComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarResourceDiscoveryComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/ManagementRepositoryManager.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/package.html
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/ConnectionFactoryResourceComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/ConnectionFactoryResourceDiscoveryComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/XADatasourceResourceComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/XADatasourceResourceDiscoveryComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/package.html
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java
   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/ResourceAdapterResourceDiscoveryComponent.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/package.html
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/ManagementRepositoryHelper.java
   projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/package.html
   projects/jboss-jca/trunk/rhq/src/main/resources/
   projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/
   projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml
   projects/jboss-jca/trunk/rhq/src/test/
   projects/jboss-jca/trunk/rhq/src/test/java/
   projects/jboss-jca/trunk/rhq/src/test/java/org/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/EmbeddedJcaDiscover.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/package.html
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAAdminObjectImpl.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAAdminObjectInterface.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnection.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionFactory.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionFactoryImpl.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionImpl.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnection.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnectionFactory.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnectionMetaData.java
   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/inflow/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAActivation.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAActivationSpec.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAMessageListener.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/package.html
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/package.html
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/EmbeddedJCAContainerTest.java
   projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/package.html
   projects/jboss-jca/trunk/rhq/src/test/resources/
   projects/jboss-jca/trunk/rhq/src/test/resources/jndi.properties
   projects/jboss-jca/trunk/rhq/src/test/resources/xa.rar/
   projects/jboss-jca/trunk/rhq/src/test/resources/xa.rar/META-INF/
   projects/jboss-jca/trunk/rhq/src/test/resources/xa.rar/META-INF/ironjacamar.xml
Modified:
   projects/jboss-jca/trunk/build.xml
   projects/jboss-jca/trunk/ivy.xml
Log:
[JBJCA-500] rhq code initial merge

Modified: projects/jboss-jca/trunk/build.xml
===================================================================
--- projects/jboss-jca/trunk/build.xml	2011-02-22 21:04:32 UTC (rev 110747)
+++ projects/jboss-jca/trunk/build.xml	2011-02-23 01:42:05 UTC (rev 110748)
@@ -88,6 +88,7 @@
        Versions              
        ================================= -->
   <property name="version.ant" value="1.8.1"/>
+  <property name="version.activation" value="1.1"/>
   <property name="version.apache-log4j" value="1.2.16"/>
   <property name="version.apache-logging" value="1.1.0.jboss"/>
   <property name="version.apiviz" value="1.3.1.GA"/>
@@ -97,6 +98,7 @@
   <property name="version.eclipse.ecj" value="3.5.1"/>
   <property name="version.fungal" value="0.9.0.RC3"/>
   <property name="version.h2" value="1.2.145"/>
+  <property name="version.hibernate-annotations" value="3.5.1-Final"/>
   <property name="version.hibernate-validator" value="4.1.0.Final"/>
   <property name="version.javassist" value="3.14.0-GA"/>
   <property name="version.jboss.common" value="2.2.17.GA"/>
@@ -119,9 +121,13 @@
   <property name="version.jetty.servlet" value="6.1.14"/>
   <property name="version.jetty.glassfish" value="2.1.v20100127"/>
   <property name="version.jasper" value="glassfish_2.1.0.v201004190952"/>
+  <property name="version.jpa" value="1.0"/>
   <property name="version.junit" value="4.8.2"/>
+  <property name="version.jaxb.api" value="2.0"/>
+  <property name="version.jaxb.impl" value="2.1"/>
   <property name="version.mail-api" value="1.4.4"/>
   <property name="version.maven" value="2.2.1"/>
+  <property name="version.rhq" value="4.0.0.B02"/>
   <property name="version.slf4j" value="1.5.8"/>
   <property name="version.transaction.api" value="1.0.1.GA"/>
   <property name="version.validation-api" value="1.0.0.GA"/>
@@ -156,6 +162,15 @@
     </fileset>
   </path>
 
+  <path id="rhq.lib.path.id">
+    <fileset dir="${lib.dir}/rhq">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${target.dir}">
+      <include name="**/*.jar"/>
+    </fileset>
+  </path>
+
   <path id="test.lib.path.id">
     <fileset dir="${lib.dir}/common">
       <include name="**/*.jar"/>
@@ -178,6 +193,9 @@
     <fileset dir="${lib.dir}/tools">
       <include name="**/*.jar"/>
     </fileset>
+    <fileset dir="${lib.dir}/rhq">
+      <include name="**/*.jar"/>
+    </fileset>
     <fileset dir="${target.dir}">
        <include name="**/*.jar"/>
     </fileset>
@@ -209,6 +227,9 @@
     <fileset dir="${lib.dir}/tools">
       <include name="**/*.jar"/>
     </fileset>
+    <fileset dir="${lib.dir}/rhq">
+      <include name="**/*.jar"/>
+    </fileset>
     <fileset dir="${target.dir}">
       <include name="**/*.jar"/>
     </fileset>
@@ -252,7 +273,7 @@
        ================================= -->
   <target name="resolve" depends="init">
     <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" 
-                  conf="common,sjc,embedded,arquillian,jetty,mail,test,tools"
+                  conf="common,sjc,embedded,arquillian,jetty,mail,test,tools,rhq"
                   sync="true"/>
   </target>
   
@@ -280,6 +301,16 @@
   </target>
   
   <!-- ================================= 
+       Target: rhq
+       ================================= -->
+  <target name="rhq" depends="jars">
+    <ant dir="rhq" inheritRefs="true" target="jars"/>
+    <ant dir="rhq" inheritRefs="true" target="prepare-test"/>
+    <ant dir="rhq" inheritRefs="true" target="test-jars"/>
+    <ant dir="rhq" inheritRefs="true" target="plugin"/>
+  </target>
+  
+  <!-- ================================= 
        Target: docs
        ================================= -->
   <target name="docs" depends="jars">

Modified: projects/jboss-jca/trunk/ivy.xml
===================================================================
--- projects/jboss-jca/trunk/ivy.xml	2011-02-22 21:04:32 UTC (rev 110747)
+++ projects/jboss-jca/trunk/ivy.xml	2011-02-23 01:42:05 UTC (rev 110748)
@@ -33,7 +33,7 @@
     </description>
   </info>
 
-  <configurations defaultconfmapping="common->default;sjc->default;embedded->default;arquillian->default;jetty->default;test->default;mail->default;;tools->default;ironjacamar-codegenerator->default;ironjacamar-common-api->default;ironjacamar-common-impl->default;ironjacamar-common-impl-papaki->default;ironjacamar-common-spi->default;ironjacamar-core-api->default;ironjacamar-core-impl->default;ironjacamar-core-spi->default;ironjacamar-depchain->default;ironjacamar-deployers-common->default;ironjacamar-deployers-fungal->default;ironjacamar-embedded->default;ironjacamar-embedded-arquillian->default;ironjacamar-spec-api->default;ironjacamar-validator->default;ironjacamar-validator-ant->default;ironjacamar-validator-cli->default;ironjacamar-validator-maven->default;jdbc-local->default;jdbc-xa->default">
+  <configurations defaultconfmapping="common->default;sjc->default;embedded->default;arquillian->default;jetty->default;test->default;mail->default;;tools->default;ironjacamar-codegenerator->default;ironjacamar-common-api->default;ironjacamar-common-impl->default;ironjacamar-common-impl-papaki->default;ironjacamar-common-spi->default;ironjacamar-core-api->default;ironjacamar-core-impl->default;ironjacamar-core-spi->default;ironjacamar-depchain->default;ironjacamar-deployers-common->default;ironjacamar-deployers-fungal->default;ironjacamar-embedded->default;ironjacamar-embedded-arquillian->default;ironjacamar-spec-api->default;ironjacamar-validator->default;ironjacamar-validator-ant->default;ironjacamar-validator-cli->default;ironjacamar-validator-maven->default;jdbc-local->default;jdbc-xa->default;rhq->default">
     <conf name="common" transitive="false"/>
     <conf name="sjc" transitive="false"/>
     <conf name="embedded" transitive="false"/>
@@ -42,6 +42,7 @@
     <conf name="mail" transitive="false"/>
     <conf name="test" transitive="false"/>
     <conf name="tools" transitive="false"/>
+    <conf name="rhq" transitive="false"/>
 
     <conf name="ironjacamar-codegenerator" transitive="false"/>
     <conf name="ironjacamar-common-api" transitive="false"/>
@@ -101,8 +102,12 @@
     <dependency org="com.github.fungal" name="fungal-cli" rev="${version.fungal}" conf="sjc,ironjacamar-depchain"/>
     <dependency org="com.h2database" name="h2" rev="${version.h2}" conf="test"/>
     <dependency org="dom4j" name="dom4j" rev="${version.dom4j}" conf="jetty,tools"/>
+    <dependency org="javax.activation" name="activation" rev="${version.activation}" conf="rhq"/>
     <dependency org="javax.mail" name="mail" rev="${version.mail-api}" conf="mail"/>
+    <dependency org="javax.persistence" name="persistence-api" rev="${version.jpa}" conf="rhq"/>
     <dependency org="javax.validation" name="validation-api" rev="${version.validation-api}" conf="common,ironjacamar-core-impl,ironjacamar-depchain,ironjacamar-deployers-fungal"/>
+    <dependency org="javax.xml" name="jaxb-api" rev="${version.jaxb.api}" conf="rhq"/>
+    <dependency org="javax.xml" name="jaxb-impl" rev="${version.jaxb.impl}" conf="rhq"/>
     <dependency org="jdepend" name="jdepend" rev="${version.jdepend}" conf="tools"/>
     <dependency org="junit" name="junit" rev="${version.junit}" conf="test"/>
     <dependency org="log4j" name="log4j" rev="${version.apache-log4j}" conf="common,ironjacamar-depchain"/>
@@ -120,6 +125,7 @@
     <dependency org="org.eclipse.jetty" name="jetty-util" rev="${version.jetty}" conf="jetty"/>
     <dependency org="org.eclipse.jetty" name="jetty-webapp" rev="${version.jetty}" conf="jetty"/>
     <dependency org="org.eclipse.jetty" name="jetty-xml" rev="${version.jetty}" conf="jetty"/>
+    <dependency org="org.hibernate" name="hibernate-annotations" rev="${version.hibernate-annotations}" conf="rhq"/>
     <dependency org="org.hibernate" name="hibernate-validator" rev="${version.hibernate-validator}" conf="common,ironjacamar-depchain"/>
     <dependency org="org.javassist" name="javassist" rev="${version.javassist}" conf="common,ironjacamar-depchain"/>
     <dependency org="org.jboss" name="jboss-common-core" rev="${version.jboss.common}" conf="common,ironjacamar-common-impl,ironjacamar-core-impl,ironjacamar-depchain"/>
@@ -147,6 +153,13 @@
     <dependency org="org.mortbay.jetty" name="jsp-api-2.1-glassfish"  rev="${version.jetty.glassfish}" conf="jetty"/>
     <dependency org="org.mortbay.jetty" name="servlet-api-2.5" rev="${version.jetty.servlet}" conf="jetty"/>
     <dependency org="org.picketbox" name="picketbox" rev="${version.jboss.picketbox}" conf="common,ironjacamar-depchain"/>
+    <dependency org="org.rhq" name="rhq-core-plugin-api" rev="${version.rhq}" conf="rhq"/>
+    <dependency org="org.rhq" name="rhq-core-client-api" rev="${version.rhq}" conf="rhq"/>
+    <dependency org="org.rhq" name="rhq-core-domain" rev="${version.rhq}" conf="rhq"/>
+    <dependency org="org.rhq" name="rhq-core-native-system" rev="${version.rhq}" conf="rhq"/>
+    <dependency org="org.rhq" name="rhq-core-util" rev="${version.rhq}" conf="rhq"/>
+    <dependency org="org.rhq" name="rhq-core-plugin-container" rev="${version.rhq}" conf="rhq"/>
+    <dependency org="org.rhq" name="rhq-core-comm-api" rev="${version.rhq}" conf="rhq"/>
     <dependency org="org.slf4j" name="jcl-over-slf4j" rev="${version.slf4j}" conf="common,ironjacamar-depchain"/>
     <dependency org="org.slf4j" name="slf4j-api" rev="${version.slf4j}" conf="common,ironjacamar-depchain"/>
   </dependencies>

Added: projects/jboss-jca/trunk/rhq/.classpath
===================================================================
--- projects/jboss-jca/trunk/rhq/.classpath	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/.classpath	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
+	<classpathentry kind="src" output="eclipse-target/tests-classes" path="src/test/java"/>
+	<classpathentry excluding="**/*.java" kind="src" output="eclipse-target/tests-classes" path="src/test/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/ironjacamar-api"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/ironjacamar-common"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/common/jboss-logging.jar"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/test/junit.jar"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/rhq-core-domain.jar"/>
+	<classpathentry kind="lib" path="/ironjacamar-parent/lib/rhq/rhq-core-plugin-api.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/ironjacamar-embedded"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/ironjacamar-core"/>
+	<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="output" path="eclipse-target/classes"/>
+</classpath>

Added: projects/jboss-jca/trunk/rhq/.project
===================================================================
--- projects/jboss-jca/trunk/rhq/.project	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/.project	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ironjacamar-rhq</name>
+	<comment>JBoss JCA Management</comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: projects/jboss-jca/trunk/rhq/build.xml
===================================================================
--- projects/jboss-jca/trunk/rhq/build.xml	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/build.xml	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,350 @@
+<!--
+ * 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.
+-->
+<project name="ironjacamar-rhq" 
+         default="compile" 
+         xmlns:ivy="antlib:org.apache.ivy.ant">
+
+  <!-- ================================= 
+       Properties              
+       ================================= -->
+  <property name="build.rhq.dir" value="${build.dir}/rhq" />
+
+  <!-- ================================= 
+       Target: compile
+       ================================= -->
+  <target name="compile">
+    <mkdir dir="${build.rhq.dir}" />
+    <mkdir dir="${build.rhq.dir}/impl" />
+
+    <javac srcdir="src/main"
+           destdir="${build.rhq.dir}/impl"
+           classpathref="rhq.lib.path.id"
+           debug="${javac.debug}"
+           deprecation="${javac.deprecation}"
+           optimize="${javac.optimize}">
+      <compilerarg value="-Xlint"/>
+    </javac> 
+  </target>
+
+  <!-- ================================= 
+       Target: jars 
+       ================================= -->
+  <target name="jars" depends="compile">
+    <mkdir dir="${build.rhq.dir}/jars" />
+
+    <!-- rhq -->
+    <mkdir dir="${build.rhq.dir}/jars/rhq" />
+
+    <copy todir="${build.rhq.dir}/jars/rhq">
+      <fileset dir="${build.rhq.dir}/impl"
+               includes="**"/>
+    </copy>
+
+    <jar destfile="${target.dir}/${name}-rhq.jar"
+         basedir="${build.rhq.dir}/jars/rhq"
+         index="true"
+         indexMetaInf="true"
+         update="true"
+         level="9">
+      <manifest>
+        <attribute name="Implementation-Title" value="IronJacamar RHQ"/>
+        <attribute name="Implementation-Version" value="${major}.${minor}.${patch}.${type}"/>
+        <attribute name="Implementation-Vendor" value="The IronJacamar project (http://www.jboss.org/ironjacamar)"/>
+        <attribute name="Implementation-Vendor-Id" value="org.jboss"/>
+      </manifest>
+    </jar>
+  </target>
+
+  <!-- ================================= 
+       Target: docs
+       ================================= -->
+  <target name="docs" depends="compile">
+    <mkdir dir="${target.dir}/docs/rhq"/>
+    <javadoc packagenames="org.*"
+             sourcepath="src/main/java"
+             destdir="${target.dir}/docs/rhq"
+             doclet="org.jboss.apiviz.APIviz"
+             docletpathref="sjc.lib.path.id"
+             author="true"
+             version="true"
+             windowtitle="IronJacamar Code Generator"
+             doctitle="IronJacamar Code Generator"
+             use="true"
+             additionalparam="-author -version"
+             classpath="${build.rhq.dir}/impl"
+             classpathref="sjc.lib.path.id"
+             bottom="Copyright &#169; 2008-2009 Red Hat Middleware LLC (http://www.jboss.com/)">
+      <link offline="true" href="http://java.sun.com/j2se/5/docs/api/" packagelistLoc="${java.home}/../docs/api"/>
+    </javadoc>
+    <copy todir="${target.dir}/docs/rhq" overwrite="true">
+      <fileset dir="${tools.dir}/api"/>
+    </copy>
+  </target>
+
+  <!-- ================================= 
+       Target: test
+       ================================= -->
+  <target name="test" depends="jars, prepare-test">
+    <mkdir dir="${reports.dir}"/>
+    <mkdir dir="${reports.dir}/rhq"/>
+
+    <junit dir="src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="${junit.fork}"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="archives.dir" value="${build.rhq.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"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      
+      <classpath>
+        <pathelement location="${build.rhq.dir}/test"/>
+        <fileset dir="${target.dir}" includes="*.jar"/>
+        <fileset dir="${lib.dir}/common" includes="*.jar" />
+        <fileset dir="${lib.dir}/embedded" includes="*.jar" />
+        <fileset dir="${lib.dir}/arquillian" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+      </classpath>
+      
+      <formatter type="plain"/>
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/rhq"
+                 haltonerror="${junit.batchtest.haltonerror}"
+                 haltonfailure="${junit.batchtest.haltonfailure}"
+                 fork="${junit.batchtest.fork}">
+        
+        <fileset dir="${build.rhq.dir}/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+
+    </junit>
+    
+  </target>
+
+
+  <!-- ================================= 
+       Target: one-test
+       ================================= -->
+  <target name="one-test" depends="jars, prepare-test">
+    <mkdir dir="${reports.dir}"/>
+    <mkdir dir="${reports.dir}/rhq"/>
+
+    <junit dir="src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="${junit.fork}"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="archives.dir" value="${build.rhq.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"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      
+      <classpath>
+        <pathelement location="${build.rhq.dir}/test"/>
+        <fileset dir="${target.dir}" includes="*.jar"/>
+        <fileset dir="${lib.dir}/common" includes="*.jar" />
+        <fileset dir="${lib.dir}/embedded" includes="*.jar" />
+        <fileset dir="${lib.dir}/arquillian" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+      </classpath>
+      
+      <formatter type="plain"/>
+      <formatter type="xml"/>
+      
+      <test todir="${reports.dir}/rhq" name="${test}"
+                 haltonerror="${junit.batchtest.haltonerror}"
+                 haltonfailure="${junit.batchtest.haltonfailure}"
+                 fork="${junit.batchtest.fork}"/>
+    </junit>
+  </target>
+
+  <!-- ================================= 
+       Target: prepare-test
+       ================================= -->
+  <target name="prepare-test">
+    <mkdir dir="${build.rhq.dir}" />
+    <mkdir dir="${build.rhq.dir}/test" />
+    <mkdir dir="${build.rhq.dir}/test/lib" />
+    <property name="rhq.lib.plugin.dir" value="${build.rhq.dir}/test/lib" />
+
+    <javac srcdir="src/test"
+           destdir="${build.rhq.dir}/test"
+           classpathref="rhq.lib.path.id"
+           debug="${javac.debug}"
+           deprecation="${javac.deprecation}"
+           optimize="${javac.optimize}">
+      <compilerarg value="-Xlint"/>
+    </javac> 
+
+    <copy todir="${build.rhq.dir}/test">
+      <fileset dir="src/test/resources"/>
+    </copy>
+
+    <jar destfile="${target.dir}/${name}-rhq-test.jar"
+         basedir="${build.rhq.dir}/test"
+         index="true"
+         indexMetaInf="true"
+         update="true"
+         level="9">
+      <manifest>
+        <attribute name="Implementation-Title" value="IronJacamar RHQ"/>
+        <attribute name="Implementation-Version" value="${major}.${minor}.${patch}.${type}"/>
+        <attribute name="Implementation-Vendor" value="The IronJacamar project (http://www.jboss.org/ironjacamar)"/>
+        <attribute name="Implementation-Vendor-Id" value="org.jboss"/>
+      </manifest>
+    </jar>
+
+  </target>
+
+  <!-- ================================= 
+       Target: test-jars 
+       ================================= -->
+  <target name="test-jars">
+    <jar destfile="${build.rhq.dir}/xa.rar">
+       <fileset dir="${build.rhq.dir}/test"
+          includes="org/jboss/jca/rhq/rar/xa/**/*.class"/>
+       <fileset dir="src/test/resources/xa.rar"/>
+    </jar>
+  </target>
+
+  <!-- ================================= 
+       Target: plugin
+       ================================= -->
+  <target name="plugin">
+    <mkdir dir="${build.rhq.dir}" />
+    <mkdir dir="${build.rhq.dir}/plugin" />
+    <mkdir dir="${build.rhq.dir}/plugin/lib" />
+    <property name="rhq.lib.plugin.dir" value="${build.rhq.dir}/plugin/lib" />
+
+    <copy todir="${build.rhq.dir}/plugin">
+      <fileset dir="src/test/resources" includes="*.properties *.xml"/>
+      <fileset dir="src/main/resources/"
+               includes="**/*"/>
+      <fileset dir="${build.rhq.dir}/"
+               includes="*.rar"/>
+    </copy>
+
+
+    <copy todir="${rhq.lib.plugin.dir}">
+      <fileset dir="${lib.dir}/common/" includes="**"/>
+      <fileset dir="${lib.dir}/arquillian/" includes="**"/>
+      <fileset dir="${lib.dir}/embedded/" includes="**"/>
+      <fileset dir="${lib.dir}/sjc/" includes="**"/>
+      <fileset dir="${lib.dir}/test/" includes="h2.jar"/>
+      <fileset dir="${lib.dir}/tools/" includes="apiviz.jar jdepend.jar"/>
+      <fileset dir="${lib.dir}/rhq/" excludes="rhq*"/>
+
+      <fileset dir="${target.dir}"
+         includes="ironjacamar*"
+         excludes="ironjacamar-rhq-plugin* ironjacamar-codegen* ironjacamar-web*"/>
+    </copy>
+
+    <jar destfile="${target.dir}/${name}-rhq-plugin.jar"
+         basedir="${build.rhq.dir}/plugin"
+         index="true"
+         indexMetaInf="true"
+         update="true"
+         level="9">
+      <manifest>
+        <attribute name="Implementation-Title" value="IronJacamar RHQ"/>
+        <attribute name="Implementation-Version" value="${major}.${minor}.${patch}.${type}"/>
+        <attribute name="Implementation-Vendor" value="The IronJacamar project (http://www.jboss.org/ironjacamar)"/>
+        <attribute name="Implementation-Vendor-Id" value="org.jboss"/>
+      </manifest>
+    </jar>
+
+  </target>
+
+  <!-- ================================= 
+       Target: artifacts
+       ================================= -->
+  <target name="artifacts" depends="jars">
+
+    <jar destfile="${target.dir}/${name}-rhq-sources.jar"
+         basedir="src/main/java"
+         index="true"
+         indexMetaInf="true"
+         update="true"
+         level="9">
+      <manifest>
+        <attribute name="Implementation-Title" value="IronJacamar RHQ - Sources"/>
+        <attribute name="Implementation-Version" value="${major}.${minor}.${patch}.${type}"/>
+        <attribute name="Implementation-Vendor" value="The IronJacamar project (http://www.jboss.org/ironjacamar)"/>
+        <attribute name="Implementation-Vendor-Id" value="org.jboss"/>
+      </manifest>
+    </jar>
+
+    <mkdir dir="${build.rhq.dir}/docs"/>
+    <javadoc packagenames="org.*"
+             sourcepath="src/main/java"
+             destdir="${build.rhq.dir}/docs"
+             doclet="org.jboss.apiviz.APIviz"
+             docletpathref="sjc.lib.path.id"
+             author="true"
+             version="true"
+             windowtitle="IronJacamar RHQ"
+             doctitle="IronJacamar RHQ"
+             use="true"
+             additionalparam="-author -version"
+             classpath="${build.rhq.dir}"
+             classpathref="sjc.lib.path.id"
+             bottom="Copyright &#169; 2008 Red Hat Middleware LLC (http://www.jboss.com/)">
+      <link offline="true" href="http://java.sun.com/j2se/5/docs/api/" packagelistLoc="${java.home}/../docs/api"/>
+    </javadoc>
+    <copy todir="${build.rhq.dir}/docs" overwrite="true">
+      <fileset dir="${tools.dir}/api"/>
+    </copy>
+
+    <jar destfile="${target.dir}/${name}-rhq-javadoc.jar"
+         basedir="${build.rhq.dir}/docs"
+         index="true"
+         indexMetaInf="true"
+         update="true"
+         level="9">
+      <manifest>
+        <attribute name="Implementation-Title" value="IronJacamar RHQ - JavaDoc"/>
+        <attribute name="Implementation-Version" value="${major}.${minor}.${patch}.${type}"/>
+        <attribute name="Implementation-Vendor" value="The IronJacamar project (http://www.jboss.org/ironjacamar)"/>
+        <attribute name="Implementation-Vendor-Id" value="org.jboss"/>
+      </manifest>
+    </jar>
+
+  </target>
+
+</project>

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/AbstractResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/AbstractResourceComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/AbstractResourceComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,258 @@
+/*
+ * 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.core;
+
+import org.jboss.jca.core.api.management.ConfigProperty;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.logging.Logger;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/**
+ * AbstractJCAResourceComponent
+ * 
+ * @author <a href="mailto:yy.young at gmail.com">Yong Yang</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public abstract class AbstractResourceComponent extends BaseResourceComponent
+   implements ResourceComponent, ConfigurationFacet, OperationFacet, MeasurementFacet
+{
+   /** log */
+   private static final Logger logger = Logger.getLogger(AbstractResourceComponent.class);
+
+   /** resourceContext */
+   private ResourceContext resourceContext;
+
+   /** resourceDescription */
+   private String resourceDescription;
+
+   /**
+    * start lifecycle
+    * 
+    * @param resourceContext ResourceContext
+    * @throws Exception Exception
+    */
+   @Override
+   public void start(ResourceContext resourceContext) throws Exception
+   {
+      this.resourceContext = resourceContext;
+      this.resourceDescription = this.resourceContext.getResourceType() + " Resource with key ["
+            + this.resourceContext.getResourceKey() + "]";
+   }
+
+   /**
+    * getResourceContext
+    * 
+    * @return resourceContext ResourceContext
+    */
+   public ResourceContext getResourceContext()
+   {
+      return this.resourceContext;
+   }
+
+   /**
+    * It is used to get unique information of the component.
+    * 
+    * @return current plugin configuration of this component.
+    */
+   protected String getResourceDescription()
+   {
+      return this.resourceDescription;
+   }
+
+
+   /**
+    * updateResourceConfiguration
+    * 
+    * @param updateResourceConfiguration ConfigurationUpdateReport
+    */
+   @Override
+   public void updateResourceConfiguration(ConfigurationUpdateReport updateResourceConfiguration)
+   {
+   }
+
+   /**
+    * getValues
+    * 
+    * @param measurementReport MeasurementReport
+    * @param measurementScheduleRequests Set<MeasurementScheduleRequest> 
+    * @throws Exception exception
+    */
+   @Override
+   public void getValues(MeasurementReport measurementReport,
+      Set<MeasurementScheduleRequest> measurementScheduleRequests) throws Exception
+   {
+   }
+
+   /**
+    * invokeOperation
+    * 
+    * @param s String
+    * @param configuration Configuration
+    * @return OperationResult OperationResult
+    * @throws InterruptedException interruptedException
+    * @throws Exception exception
+    */
+   @Override
+   public OperationResult invokeOperation(String s, Configuration configuration) throws InterruptedException, Exception
+   {
+      return null;
+   }
+   
+   /**
+    * The RAR unique id is the identifier of each RAR resource connector.
+    * If the component is under the connector, the resource key is: uniqueID#Resource_Class_Name
+    * for example of the sample ManagedConnectionFactory component, the key is:
+    * <p>
+    * localtransaction.rar#org.jboss.jca.samples.localtransaction16b.LocalTransactionManagedConnectionFactory
+    * </p>
+    * 
+    * @return The associated RAR unique ID
+    */
+   protected String getRarUniqueId()
+   {
+      String resKey = getResourceContext().getResourceKey();
+      int lastPos = resKey.lastIndexOf("#");
+      if (lastPos == -1)
+      {
+         return resKey;
+      }
+      return resKey.substring(0, lastPos);
+   }
+
+   /**
+    * getJCAClassName
+    * @return JCA Class Name.
+    */
+   protected String getJCAClassName()
+   {
+      String resKey = getResourceContext().getResourceKey();
+      int lastPos = resKey.lastIndexOf("#");
+      if (lastPos == -1)
+      {
+         return null;
+      }
+      return resKey.substring(lastPos + 1);
+   }
+
+   /**
+    * getConfigPropertiesList
+    * 
+    * @param jcaObject  JCA Object which has some ConfigProperty defined.
+    *        It can be either Connector or children of the Connector in the tree.
+    * @param configProperties  ConfigProperty instances belongs to the JCA Object.
+    * 
+    * @return PropertyList which matches the ConfigProperty defined in the JCA descriptor.
+    * 
+    * @throws InvocationTargetException 
+    * @throws IllegalAccessException 
+    * @throws NoSuchMethodException 
+    */
+   protected PropertyList getConfigPropertiesList(Object jcaObject, List<ConfigProperty> configProperties)
+      throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
+   {
+      String configListName = "config-property";
+      String configMapName = configListName;
+      PropertyList configList = new PropertyList(configListName);
+
+      for (ConfigProperty configProp : configProperties)
+      {
+         PropertyMap configMap = new PropertyMap(configMapName);
+         String configName = configProp.getName();
+
+         Object value = getProperty(jcaObject, configName);
+
+         PropertySimple nameProp = new PropertySimple("name", configName);
+         configMap.put(nameProp);
+
+         PropertySimple typeProp = new PropertySimple("type", value.getClass().getName());
+         configMap.put(typeProp);
+
+         PropertySimple valueProp = new PropertySimple("value", value);
+         configMap.put(valueProp);
+
+         configList.add(configMap);
+      }
+      return configList;
+   }
+
+   /**
+    * getProperty
+    * 
+    * @param obj object
+    * @param propName  property name
+    * 
+    * @return object 
+    * @throws InvocationTargetException 
+    * @throws IllegalAccessException 
+    * @throws NoSuchMethodException
+    */
+   private Object getProperty(Object obj, String propName) throws IllegalAccessException, 
+      InvocationTargetException, NoSuchMethodException
+   {
+      String methodNameBase = propName.substring(0, 1).toUpperCase() + propName.substring(1);
+      String methodName = "get" + methodNameBase;
+      Method method = null;
+      try
+      {
+         method = obj.getClass().getDeclaredMethod(methodName, new Class<?>[0]);
+      }
+      catch (NoSuchMethodException e)
+      {
+         logger.info("No Method: " + methodName + " found. Try method name: is" + methodNameBase);
+         method = obj.getClass().getDeclaredMethod("is" + methodNameBase, new Class<?>[0]);
+      }
+
+      return method.invoke(obj, new Object[0]);
+   }
+
+   /**
+    * It is used to get unique information of the component.
+    * 
+    * @return current plugin configuration of this component.
+    */
+   protected Configuration getPluginConfiguration()
+   {
+      if (resourceContext != null)
+         return getResourceContext().getPluginConfiguration();
+      else
+         return null;
+   }
+
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/BaseResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/BaseResourceComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/BaseResourceComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,64 @@
+/*
+ * 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.core;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+
+/**
+ * BaseResourceComponent implement some lifecycle method 
+ * 
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public abstract class BaseResourceComponent implements ResourceComponent
+{
+   /**
+    * getAvailability
+    * 
+    * @return AvailabilityType
+    */
+   @Override
+   public AvailabilityType getAvailability()
+   {
+      return AvailabilityType.UP;
+   }
+
+   /**
+    * start lifecycle
+    * 
+    * @param resourceContext ResourceContext
+    * @throws Exception Exception
+    */
+   @Override
+   public void start(ResourceContext resourceContext) throws Exception
+   {
+   }
+
+   /**
+    * stop lifecycle
+    */
+   @Override
+   public void stop()
+   {
+   }
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/Discover.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/Discover.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/Discover.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,41 @@
+/*
+ * 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.core;
+
+import org.jboss.jca.core.api.management.ManagementRepository;
+
+/**
+ * Discover interface
+ * get entry of ManagementRepository
+ * 
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public interface Discover
+{
+   /**
+    * Get a management repository instance
+    * 
+    * @return ManagementRepository
+    */
+   public ManagementRepository getManagementRepository();
+
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarPluginLifecyleListener.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarPluginLifecyleListener.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarPluginLifecyleListener.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,52 @@
+/*
+ * 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.core;
+
+import org.rhq.core.pluginapi.plugin.PluginContext;
+import org.rhq.core.pluginapi.plugin.PluginLifecycleListener;
+
+/**
+ * IronJacamarPluginLifecyleListener
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ *
+ */
+public class IronJacamarPluginLifecyleListener implements PluginLifecycleListener
+{
+   /** 
+    * initialize
+    * 
+    * @param context PluginContext
+    * @throws Exception exception
+    */
+   public void initialize(PluginContext context) throws Exception
+   {
+   }
+   
+   /** 
+    * shutdown
+    */
+   public void shutdown()
+   {
+   }
+
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarResourceComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarResourceComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,32 @@
+/*
+ * 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.core;
+
+/**
+ * A IronJacamarResourceComponent
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public class IronJacamarResourceComponent extends BaseResourceComponent
+{
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarResourceDiscoveryComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/IronJacamarResourceDiscoveryComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,64 @@
+/*
+ * 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.core;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * Discovery the root element of this plug-in.
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ */
+public class IronJacamarResourceDiscoveryComponent implements ResourceDiscoveryComponent<IronJacamarResourceComponent>
+{
+   /**
+    * discoverResources
+    * 
+    * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
+    * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+    * @throws InvalidPluginConfigurationException InvalidPluginConfigurationException
+    * @throws Exception Exception
+    */
+   public Set<DiscoveredResourceDetails> discoverResources(
+      ResourceDiscoveryContext<IronJacamarResourceComponent> context) 
+      throws InvalidPluginConfigurationException, Exception
+   {
+
+      Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+      String resourceKey = "IronJacamar_AS7";
+      String resourceName = "IronJacamar_AS7";
+      String resourceVersion = "1.0.0";
+      String resourceDescription = "JCA Management Resources";
+
+      DiscoveredResourceDetails resource = new DiscoveredResourceDetails(context.getResourceType(), resourceKey,
+         resourceName, resourceVersion, resourceDescription, context.getDefaultPluginConfiguration(), null);
+      result.add(resource);
+      return result;
+   }
+
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/ManagementRepositoryManager.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/ManagementRepositoryManager.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/ManagementRepositoryManager.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,59 @@
+/*
+ * 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.core;
+
+import org.jboss.jca.core.api.management.ManagementRepository;
+
+import java.lang.reflect.Method;
+
+/**
+ * ManagementRepositoryManager
+ * 
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public class ManagementRepositoryManager
+{
+   /**
+    * Get a management repository instance
+    * 
+    * @return ManagementRepository
+    */
+   public static ManagementRepository getManagementRepository()
+   {
+      //currently use embedded JCA
+      String jcaClass = ManagementRepositoryManager.class.getPackage().getName() + ".EmbeddedJcaDiscover";
+      try
+      {
+         Class<?> cls = Class.forName (jcaClass);
+         Method method = cls.getMethod ("getInstance");
+         Discover discover = (Discover)method.invoke(cls, (Object[])null);
+         return discover.getManagementRepository();
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+      return null;
+
+   }
+
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/package.html
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/core/package.html	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,3 @@
+<body>
+IronJacamar RHQ core.
+</body>

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/ConnectionFactoryResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/ConnectionFactoryResourceComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/ConnectionFactoryResourceComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,33 @@
+/*
+ * 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.ds;
+
+import org.jboss.jca.rhq.core.BaseResourceComponent;
+
+/**
+ * Represent <b>ConnectionFactory</b> in JCA container.
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ */
+public class ConnectionFactoryResourceComponent extends BaseResourceComponent
+{
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/ConnectionFactoryResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/ConnectionFactoryResourceDiscoveryComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/ConnectionFactoryResourceDiscoveryComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,58 @@
+/*
+ * 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.ds;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * Discovery <code>ConnectionFactoryResourceComponent</code> from JCA container.
+ *
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ */
+public class ConnectionFactoryResourceDiscoveryComponent
+   implements ResourceDiscoveryComponent<ConnectionFactoryResourceComponent>
+{
+   /**
+    * discoverResources
+    * 
+    * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
+    * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+    * @throws InvalidPluginConfigurationException InvalidPluginConfigurationException
+    * @throws Exception Exception
+    */
+   @Override
+   public Set<DiscoveredResourceDetails> discoverResources(
+      ResourceDiscoveryContext<ConnectionFactoryResourceComponent> context)
+      throws InvalidPluginConfigurationException, Exception
+   {
+      Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+
+      return result;
+   }
+
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/XADatasourceResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/XADatasourceResourceComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/XADatasourceResourceComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.ds;
+
+import org.jboss.jca.rhq.core.BaseResourceComponent;
+
+/**
+ * Represent <b>XA Datasource</b> in JCA container
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ */
+public class XADatasourceResourceComponent extends BaseResourceComponent
+{
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/XADatasourceResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/XADatasourceResourceDiscoveryComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/XADatasourceResourceDiscoveryComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,65 @@
+/*
+ * 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.ds;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * Discovery<code>XADatasourceResourceComponent</code> from JCA container.
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ */
+public class XADatasourceResourceDiscoveryComponent
+   implements ResourceDiscoveryComponent<XADatasourceResourceComponent>
+{
+   /**
+    * discoverResources
+    * 
+    * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
+    * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+    * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
+    * @throws Exception exception
+    */
+   @Override
+   public Set<DiscoveredResourceDetails> discoverResources(
+      ResourceDiscoveryContext<XADatasourceResourceComponent> context) 
+      throws InvalidPluginConfigurationException, Exception
+   {
+      Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+
+      DiscoveredResourceDetails xaDatasourceRes = new DiscoveredResourceDetails(context.getResourceType(),
+         "XA_Datasource", "XA Datasource", null, "XA Datasource(Demo)", context.getDefaultPluginConfiguration(),
+         null);
+      result.add(xaDatasourceRes);
+
+      // TODO find XA Datasource resources.
+
+      return result;
+   }
+
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/package.html
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ds/package.html	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,3 @@
+<body>
+IronJacamar RHQ ds module.
+</body>

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,81 @@
+/*
+ * 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.ra;
+
+import org.jboss.jca.core.api.management.AdminObject;
+import org.jboss.jca.core.api.management.ConfigProperty;
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.rhq.core.AbstractResourceComponent;
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.List;
+
+import org.jboss.logging.Logger;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+
+/**
+ * Represent Admin Object in JCA container.
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public class AdminObjectResourceComponent extends AbstractResourceComponent
+{
+   /** log */
+   private static final Logger logger = Logger.getLogger(AdminObjectResourceComponent.class);
+
+   /**
+    * loadResourceConfiguration
+    * 
+    * @return Configuration configuration
+    * @throws Exception exception
+    */
+   @Override
+   public Configuration loadResourceConfiguration() throws Exception
+   {
+
+      Configuration config = new Configuration();
+
+      ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+      Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
+      String jcaClsName = getJCAClassName();
+
+      for (AdminObject ao : connector.getAdminObjects())
+      {
+         Object obj = ao.getAdminObject();
+         Class<?> aoCls = obj.getClass();
+         if (aoCls.getName().equals(jcaClsName))
+         {
+            logger.debug("Class Name is: " + jcaClsName);
+            List<ConfigProperty> aoConfigProps = ao.getConfigProperties();
+            PropertyList configList = getConfigPropertiesList(obj, aoConfigProps);
+            config.put(configList);
+            break;
+         }
+      }
+      return config;
+   }
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/AdminObjectResourceDiscoveryComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,81 @@
+/*
+ * 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.ra;
+
+import org.jboss.jca.core.api.management.AdminObject;
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * Discovery AdminObjectResourceComponent from JCA container.
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public class AdminObjectResourceDiscoveryComponent implements ResourceDiscoveryComponent<AdminObjectResourceComponent>
+{
+   /**
+    * discoverResources
+    * 
+    * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
+    * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+    * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
+    * @throws Exception exception
+    */
+   @Override
+   public Set<DiscoveredResourceDetails> discoverResources(
+      ResourceDiscoveryContext<AdminObjectResourceComponent> context) 
+      throws InvalidPluginConfigurationException, Exception
+   {
+
+      Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+      // the uniqueId is the key of parent component.
+
+      String rarUniqueId = context.getParentResourceContext().getResourceKey();
+      
+      ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+      Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, rarUniqueId);
+      
+      for (AdminObject ao : connector.getAdminObjects())
+      {
+         Object aoObj = ao.getAdminObject();
+         Class<?> aoCls = aoObj.getClass();
+         String key = rarUniqueId + "#" + aoCls.getName();
+         String name = aoCls.getSimpleName();
+         DiscoveredResourceDetails mcfRes = new DiscoveredResourceDetails(context.getResourceType(), key, name, null,
+            "Admin Objects", context.getDefaultPluginConfiguration(), null);
+         result.add(mcfRes);
+      }
+      return result;
+   }
+
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,82 @@
+/*
+ * 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.ra;
+
+import org.jboss.jca.core.api.management.ConfigProperty;
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagedConnectionFactory;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.rhq.core.AbstractResourceComponent;
+
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.List;
+
+import org.jboss.logging.Logger;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+
+/**
+ * ManagedConnectionFactoryResourceComponent represent the ManagedConnectionFactory in JCA container.
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public class ManagedConnectionFactoryResourceComponent extends AbstractResourceComponent
+{
+   /** log */
+   private static final Logger logger = Logger.getLogger(ManagedConnectionFactoryResourceComponent.class);
+
+   /**
+    * loadResourceConfiguration
+    * 
+    * @return Configuration Configuration
+    * @throws Exception exception
+    */
+   @Override
+   public Configuration loadResourceConfiguration() throws Exception
+   {
+      Configuration config = new Configuration();
+
+      ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+      Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
+
+      String jcaClsName = getJCAClassName();
+
+      for (ManagedConnectionFactory mcf : connector.getManagedConnectionFactories())
+      {
+         javax.resource.spi.ManagedConnectionFactory jcaMcf = mcf.getManagedConnectionFactory();
+         Class<?> mcfCls = jcaMcf.getClass();
+         if (mcfCls.getName().equals(jcaClsName))
+         {
+            logger.debug("Class Name is: " + jcaClsName);
+            List<ConfigProperty> mcfConfProps = mcf.getConfigProperties();
+            PropertyList configList = getConfigPropertiesList(jcaMcf, mcfConfProps);
+            config.put(configList);
+            break;
+         }
+      }
+      return config;
+   }
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ManagedConnectionFactoryResourceDiscoveryComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,84 @@
+/*
+ * 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.ra;
+
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagedConnectionFactory;
+import org.jboss.jca.core.api.management.ManagementRepository;
+
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * Discovery ManagedConnectionFactoryResourceComponent resources from JCA container.
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public class ManagedConnectionFactoryResourceDiscoveryComponent
+   implements ResourceDiscoveryComponent<ManagedConnectionFactoryResourceComponent>
+{
+   /**
+    * discoverResources
+    * 
+    * @param context ResourceDiscoveryContext<AdminObjectResourceComponent>
+    * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+    * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
+    * @throws Exception exception
+    */
+   @Override
+   public Set<DiscoveredResourceDetails> discoverResources(
+      ResourceDiscoveryContext<ManagedConnectionFactoryResourceComponent> context)
+      throws InvalidPluginConfigurationException, Exception
+   {
+      Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+
+      // the uniqueId is the key of parent component.
+      String rarUniqueId = context.getParentResourceContext().getResourceKey();
+
+      ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+      Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, rarUniqueId);
+      
+      for (ManagedConnectionFactory mcf : connector.getManagedConnectionFactories())
+      {
+         javax.resource.spi.ManagedConnectionFactory jcaMcf = mcf.getManagedConnectionFactory();
+         // FIXME: jcaMcf is null due to weakreference.
+
+         Class<?> mcfCls = jcaMcf.getClass();
+         String key = rarUniqueId + "#" + mcfCls.getName(); //IMPORTANT: make the key uniqueId#class name
+         String name = mcfCls.getSimpleName();
+         DiscoveredResourceDetails mcfRes = new DiscoveredResourceDetails(context.getResourceType(), key, name, null,
+            "Managed Connection Factories", context.getDefaultPluginConfiguration(), null);
+         result.add(mcfRes);
+      }
+      return result;
+   }
+
+}

Added: 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	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,65 @@
+/*
+ * 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.ra;
+
+import org.jboss.jca.core.api.management.ConfigProperty;
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.core.api.management.ResourceAdapter;
+import org.jboss.jca.rhq.core.AbstractResourceComponent;
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+import org.jboss.jca.rhq.util.ManagementRepositoryHelper;
+
+import java.util.List;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+
+/**
+ * ResourceAdapterResourceComponent
+ * 
+ * @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
+{
+   /**
+    * loadResourceConfiguration
+    * 
+    * @return Configuration Configuration
+    * @throws Exception exception
+    */
+   @Override
+   public Configuration loadResourceConfiguration() throws Exception
+   {
+      Configuration config = new Configuration();
+
+      ManagementRepository mr = ManagementRepositoryManager.getManagementRepository();
+      Connector connector = ManagementRepositoryHelper.getConnectorByUniqueId(mr, getRarUniqueId());
+
+      ResourceAdapter manResAdapter = connector.getResourceAdapter();
+      List<ConfigProperty> manResConfigProps = manResAdapter.getConfigProperties();
+      PropertyList configList = getConfigPropertiesList(manResAdapter.getResourceAdapter(), manResConfigProps);
+      config.put(configList);
+      return config;
+   }
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceDiscoveryComponent.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceDiscoveryComponent.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/ResourceAdapterResourceDiscoveryComponent.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,76 @@
+/*
+ * 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.ra;
+
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.rhq.core.ManagementRepositoryManager;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * ResourceAdapterResourceDiscoveryComponent
+ * 
+ * @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 ResourceAdapterResourceDiscoveryComponent 
+   implements ResourceDiscoveryComponent<ResourceAdapterResourceComponent>
+{
+   /**
+    * discoverResources
+    * 
+    * @param jcaRarResourceComponentResourceDiscoveryContext ResourceDiscoveryContext<JCARarResourceComponent>
+    * @return Set<DiscoveredResourceDetails> set of DiscoveredResourceDetails
+    * @throws InvalidPluginConfigurationException invalidPluginConfigurationException
+    * @throws Exception exception
+    */
+   @Override
+   public Set<DiscoveredResourceDetails> discoverResources(
+      ResourceDiscoveryContext<ResourceAdapterResourceComponent> jcaRarResourceComponentResourceDiscoveryContext)
+      throws InvalidPluginConfigurationException, Exception
+   {
+
+      Set<DiscoveredResourceDetails> result = new HashSet<DiscoveredResourceDetails>();
+
+      ManagementRepository manRepo = ManagementRepositoryManager.getManagementRepository();
+
+      for (Connector connector : manRepo.getConnectors())
+      {
+         // make the uniqueId of the connector the key of this resource component
+         String key = connector.getUniqueId();
+         String name = key;
+         DiscoveredResourceDetails resConnector = new DiscoveredResourceDetails(
+            jcaRarResourceComponentResourceDiscoveryContext.getResourceType(), key, name, "1.0.0",
+            "Resource Adapters", jcaRarResourceComponentResourceDiscoveryContext.getDefaultPluginConfiguration(),
+            null);
+         result.add(resConnector);
+      }
+      return result;
+   }
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/package.html
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/ra/package.html	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,3 @@
+<body>
+IronJacamar RHQ ra module.
+</body>

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/ManagementRepositoryHelper.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/ManagementRepositoryHelper.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/ManagementRepositoryHelper.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,56 @@
+/*
+ * 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.util;
+
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+
+/**
+ * Helper class for management repository
+ * 
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public class ManagementRepositoryHelper
+{
+   /**
+    * getConnectorByUniqueId
+    * 
+    * @param mr ManagementRepository reference
+    * @param rarUniqueId The RAR unique ID
+    * @return the Connector associated with the RAR resource with the unique id.
+    */
+   public static Connector getConnectorByUniqueId(ManagementRepository mr, String rarUniqueId)
+   {
+      if (null == rarUniqueId)
+      {
+         throw new IllegalArgumentException("rar unique id can not be null.");
+      }
+      for (Connector connector : mr.getConnectors())
+      {
+         if (rarUniqueId.equals(connector.getUniqueId()))
+         {
+            return connector;
+         }
+      }
+      return null;
+   }
+}

Added: projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/package.html
===================================================================
--- projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/java/org/jboss/jca/rhq/util/package.html	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,3 @@
+<body>
+IronJacamar RHQ util.
+</body>

Added: 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	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/main/resources/META-INF/rhq-plugin.xml	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,122 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE plugin [
+
+<!ENTITY advancedResourceConfigProps '
+    <c:list-property required="false" name="config-property" readOnly="true">
+        <c:description>
+            Properties to supply to the ManagedConnectionFactory (MCF) MBean service configuration.
+        </c:description>
+        <c:map-property name="config-property">
+            <c:simple-property name="name" readOnly="true" description="The name of the configuration property." />
+            <c:simple-property name="type" readOnly="true" description="The type of the configuration property.">
+                <c:property-options>
+                    <c:option value="java.lang.String"/>
+                    <c:option value="java.lang.Boolean"/>
+                    <c:option value="java.lang.Integer"/>
+                    <c:option value="java.lang.Double"/>
+                    <c:option value="java.lang.Byte"/>
+                    <c:option value="java.lang.Short"/>
+                    <c:option value="java.lang.Long"/>
+                    <c:option value="java.lang.Float"/>
+                    <c:option value="java.lang.Character"/>
+                </c:property-options>
+            </c:simple-property>
+            <c:simple-property name="value" required="false" description="The value of the configuration property." />
+        </c:map-property>
+    </c:list-property>
+'>
+
+<!-- Metrics -->
+
+
+<!-- Operations  -->
+
+]>
+
+<plugin name="IronJacamar" displayName="IronJacamar Plugin"
+	description="Supports management and monitoring of IronJacamar"
+	version="1.0.0"
+	pluginLifecycleListener="org.jboss.jca.rhq.core.IronJacamarPluginLifecyleListener"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:xmlns:rhq-plugin"
+	xmlns:c="urn:xmlns:rhq-configuration">
+
+	<server name="IronJacamar_AS7" singleton="true"
+		discovery="org.jboss.jca.rhq.core.IronJacamarResourceDiscoveryComponent" 
+		class="org.jboss.jca.rhq.core.IronJacamarResourceComponent">
+
+		<!-- <runs-inside> <parent-resource-type name="JBossAS Server" plugin="JBossAS"/> 
+			</runs-inside> -->
+
+		<!-- 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">
+			
+			<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>
+            
+            <resource-configuration>
+	             <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">
+            
+				<resource-configuration>
+		             <c:group name="ConfigProperties" displayName="All Config Properties">
+						&advancedResourceConfigProps;						
+	                </c:group>
+				</resource-configuration>
+				
+			</service>
+			
+			<!-- Admin Objects -->
+			<service name="Admin Object" discovery="org.jboss.jca.rhq.ra.AdminObjectResourceDiscoveryComponent" 
+			    class="org.jboss.jca.rhq.ra.AdminObjectResourceComponent" supportsManualAdd="true">
+				
+				<resource-configuration>
+		             <c:group name="ConfigProperties" displayName="All Config Properties">
+						&advancedResourceConfigProps;						
+	                </c:group>
+				</resource-configuration>
+				
+			</service>
+	
+			<!-- Connection Factories -->
+			<service name="Connection Factories" discovery="org.jboss.jca.rhq.ds.ConnectionFactoryResourceDiscoveryComponent"
+				class="org.jboss.jca.rhq.ds.ConnectionFactoryResourceComponent" supportsManualAdd="true">
+				<!-- Not Implemented yet. -->
+			</service>
+
+			<!-- XA Datasource 
+			<service name="XA Datasources" subCategory="Datasources"
+				discovery="org.jboss.jca.rhq.ds.XADatasourceResourceDiscoveryComponent" 
+				class="org.jboss.jca.rhq.ds.XADatasourceResourceComponent" supportsManualAdd="true">
+	
+			</service>
+			-->
+			
+		</service>
+		
+	</server>
+</plugin>
\ No newline at end of file

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/EmbeddedJcaDiscover.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/EmbeddedJcaDiscover.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/EmbeddedJcaDiscover.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,166 @@
+/*
+ * 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.core;
+
+import org.jboss.jca.core.api.management.Connector;
+import org.jboss.jca.core.api.management.ManagementRepository;
+
+import org.jboss.jca.embedded.Embedded;
+import org.jboss.jca.embedded.EmbeddedFactory;
+
+import org.jboss.logging.Logger;
+
+/**
+ * EmbeddedJcaDiscover
+ * Discover implement by embedded JCA
+ * 
+ * @author <a href="mailto:lgao at redhat.com">Lin Gao</a>
+ * @author <a href="mailto:jeff.zhang at jboss.org">Jeff Zhang</a> 
+ */
+public class EmbeddedJcaDiscover implements Discover
+{
+   /** log */
+   private static final Logger logger = Logger.getLogger(EmbeddedJcaDiscover.class);
+   
+   /** instance of EmbeddedRHQ */
+   private static EmbeddedJcaDiscover instance;
+   
+   /** embedJCA */
+   private Embedded embedJCA;
+
+   /** stopped */
+   private boolean stopped = true;
+   
+   /** ManagementRepository */
+   ManagementRepository mr = null;
+   
+   /** 
+    * singleton getInstance
+    * 
+    * @return EmbeddedJCAContainer EmbeddedJCAContainer
+    */
+   public static synchronized EmbeddedJcaDiscover getInstance()
+   {
+      if (null == instance)
+      {
+         instance = new EmbeddedJcaDiscover();
+      }
+      return instance;
+   }
+   
+   /** 
+    * default constructor
+    */
+   private EmbeddedJcaDiscover()
+   {
+   }
+   
+   /** 
+    * start jca container
+    */
+   public void start()
+   {
+      try
+      {
+         embedJCA = EmbeddedFactory.create(true);
+         embedJCA.startup();
+         logger.debug("embedded JCA container started");
+         
+         //embedJCA.deploy(EmbeddedJcaDiscover.class.getResource("h2-ds.xml"));
+         //embedJCA.deploy(EmbeddedJcaDiscover.class.getResource("xa.rar"));
+         
+         stopped = false;
+      }
+      catch (Throwable e)
+      {
+         throw new IllegalStateException("Something wrong when starting Embedded JCA container", e);
+      }
+
+   }
+
+   /** 
+    * getManagementRepository
+    * 
+    * @return ManagementRepository 
+    */
+   @Override
+   public synchronized ManagementRepository getManagementRepository()
+   {
+      if (mr != null)
+         return mr;
+
+      try
+      {
+         if (stopped)
+         {
+            start();
+            if (stopped)
+               return null;
+         }
+         mr = embedJCA.lookup("ManagementRepository", ManagementRepository.class);
+         return mr;
+      }
+      catch (Throwable e)
+      {
+         throw new IllegalStateException("Can not get the beanManagementRepository", e);
+      }
+   }
+   
+   /**
+    * stop the embedded jca container.
+    */
+   public void stop()
+   {
+      try
+      {
+         embedJCA.shutdown();
+         stopped = true;
+      }
+      catch (Throwable e)
+      {
+         throw new IllegalStateException("Can not shutdown the Embedded JCA container", e);
+      }
+   }
+   
+   /**
+    * getConnectorByUniqueId
+    * 
+    * @param rarUniqueId The RAR unique ID
+    * @return the Connector associated with the RAR resource with the unique id.
+    */
+   public Connector getConnectorByUniqueId(String rarUniqueId)
+   {
+      if (null == rarUniqueId)
+      {
+         throw new IllegalArgumentException("rar unique id can not be null.");
+      }
+      ManagementRepository manRepo = getManagementRepository();
+      for (Connector connector : manRepo.getConnectors())
+      {
+         if (rarUniqueId.equals(connector.getUniqueId()))
+         {
+            return connector;
+         }
+      }
+      return null;
+   }
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/package.html
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/core/package.html	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,3 @@
+<body>
+IronJacamar RHQ test.
+</body>

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAAdminObjectImpl.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAAdminObjectImpl.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAAdminObjectImpl.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,168 @@
+/*
+ * 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.rar.xa;
+
+import java.io.Serializable;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+
+import javax.resource.Referenceable;
+import javax.resource.spi.AdministeredObject;
+import javax.resource.spi.ConfigProperty;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+/**
+ * XAAdminObjectImpl
+ *
+ * @version $Revision: $
+ */
+ at AdministeredObject
+public class XAAdminObjectImpl implements XAAdminObjectInterface,
+   ResourceAdapterAssociation, Referenceable, Serializable
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 1L;
+
+   /** The resource adapter */
+   private ResourceAdapter ra;
+
+   /** Reference */
+   private Reference reference;
+
+   /** aoConfig */
+   @ConfigProperty(defaultValue = "ao-config")
+   private String aoConfig;
+
+   /**
+    * Default constructor
+    */
+   public XAAdminObjectImpl()
+   {
+
+   }
+
+   /** 
+    * Set aoConfig
+    * @param aoConfig The value
+    */
+   public void setAoConfig(String aoConfig)
+   {
+      this.aoConfig = aoConfig;
+   }
+
+   /** 
+    * Get aoConfig
+    * @return The value
+    */
+   public String getAoConfig()
+   {
+      return aoConfig;
+   }
+
+   /**
+    * Get the resource adapter
+    *
+    * @return The handle
+    */
+   public ResourceAdapter getResourceAdapter()
+   {
+      return ra;
+   }
+
+   /**
+    * Set the resource adapter
+    *
+    * @param ra The handle
+    */
+   public void setResourceAdapter(ResourceAdapter ra)
+   {
+      this.ra = ra;
+   }
+
+   /**
+    * Get the Reference instance.
+    *
+    * @return Reference instance
+    * @exception NamingException Thrown if a reference can't be obtained
+    */
+   @Override
+   public Reference getReference() throws NamingException
+   {
+      return reference;
+   }
+
+   /**
+    * Set the Reference instance.
+    *
+    * @param reference A Reference instance
+    */
+   @Override
+   public void setReference(Reference reference)
+   {
+      this.reference = reference;
+   }
+
+   /** 
+    * Returns a hash code value for the object.
+    * @return A hash code value for this object.
+    */
+   @Override
+   public int hashCode()
+   {
+      int result = 17;
+      if (aoConfig != null)
+         result += 31 * result + 7 * aoConfig.hashCode();
+      else
+         result += 31 * result + 7;
+      return result;
+   }
+
+   /** 
+    * Indicates whether some other object is equal to this one.
+    * @param other The reference object with which to compare.
+    * @return true if this object is the same as the obj argument, false otherwise.
+    */
+   @Override
+   public boolean equals(Object other)
+   {
+      if (other == null)
+         return false;
+      if (other == this)
+         return true;
+      if (!(other instanceof XAAdminObjectImpl))
+         return false;
+      XAAdminObjectImpl obj = (XAAdminObjectImpl)other;
+      boolean result = true; 
+      if (result)
+      {
+         if (aoConfig == null)
+            result = obj.getAoConfig() == null;
+         else
+            result = aoConfig.equals(obj.getAoConfig());
+      }
+      return result;
+   }
+
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAAdminObjectInterface.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAAdminObjectInterface.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAAdminObjectInterface.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,49 @@
+/*
+ * 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.rar.xa;
+
+import java.io.Serializable;
+
+import javax.resource.Referenceable;
+
+/**
+ * XAAdminObjectInterface
+ *
+ * @version $Revision: $
+ */
+public interface XAAdminObjectInterface extends Referenceable, Serializable
+{
+
+   /** 
+    * Set aoConfig
+    * @param aoConfig The value
+    */
+   public void setAoConfig(String aoConfig);
+
+   /** 
+    * Get aoConfig
+    * @return The value
+    */
+   public String getAoConfig();
+
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnection.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnection.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnection.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,35 @@
+/*
+ * 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.rar.xa;
+
+/**
+ * XAConnection
+ *
+ * @version $Revision: $
+ */
+public interface XAConnection
+{
+   /**
+    * Call me
+    */
+   public void callMe();
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionFactory.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionFactory.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionFactory.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,44 @@
+/*
+ * 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.rar.xa;
+
+import java.io.Serializable;
+
+import javax.resource.Referenceable;
+import javax.resource.ResourceException;
+
+/**
+ * XAConnectionFactory
+ *
+ * @version $Revision: $
+ */
+public interface XAConnectionFactory extends Serializable, Referenceable
+{
+   /** 
+    * Get connection from factory
+    *
+    * @return XAConnection instance
+    * @exception ResourceException Thrown if a connection can't be obtained
+    */
+   public XAConnection getConnection() throws ResourceException;
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionFactoryImpl.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionFactoryImpl.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionFactoryImpl.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,104 @@
+/*
+ * 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.rar.xa;
+
+import java.util.logging.Logger;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+
+/**
+ * XAConnectionFactoryImpl
+ *
+ * @version $Revision: $
+ */
+public class XAConnectionFactoryImpl implements XAConnectionFactory
+{
+   /** The serial version UID */
+   private static final long serialVersionUID = 1L;
+
+   /** The logger */
+   private static Logger log = Logger.getLogger("XAConnectionFactoryImpl");
+
+   /** Reference */
+   private Reference reference;
+
+   /**
+    * Default constructor
+    */
+   public XAConnectionFactoryImpl()
+   {
+
+   }
+
+   /**
+    * Default constructor
+    * @param cxManager ConnectionManager
+    */
+   public XAConnectionFactoryImpl(ConnectionManager cxManager)
+   {
+
+   }
+
+   /** 
+    * Get connection from factory
+    *
+    * @return XAConnection instance
+    * @exception ResourceException Thrown if a connection can't be obtained
+    */
+   @Override
+   public XAConnection getConnection() throws ResourceException
+   {
+      log.finest("getConnection()");
+      return new XAConnectionImpl();
+   }
+
+   /**
+    * Get the Reference instance.
+    *
+    * @return Reference instance
+    * @exception NamingException Thrown if a reference can't be obtained
+    */
+   @Override
+   public Reference getReference() throws NamingException
+   {
+      log.finest("getReference()");
+      return reference;
+   }
+
+   /**
+    * Set the Reference instance.
+    *
+    * @param reference A Reference instance
+    */
+   @Override
+   public void setReference(Reference reference)
+   {
+      log.finest("setReference()");
+      this.reference = reference;
+   }
+
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionImpl.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionImpl.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAConnectionImpl.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,52 @@
+/*
+ * 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.rar.xa;
+
+import java.util.logging.Logger;
+
+/**
+ * XAConnectionImpl
+ *
+ * @version $Revision: $
+ */
+public class XAConnectionImpl implements XAConnection
+{
+   /** The logger */
+   private static Logger log = Logger.getLogger("XAConnectionImpl");
+
+   /**
+    * Default constructor
+    */
+   public XAConnectionImpl()
+   {
+
+   }
+
+   /**
+    * Call me
+    */
+   public void callMe()
+   {
+      log.finest("callMe()");
+   }
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnection.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnection.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnection.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,190 @@
+/*
+ * 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.rar.xa;
+
+import java.io.PrintWriter;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.LocalTransaction;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionMetaData;
+
+import javax.security.auth.Subject;
+import javax.transaction.xa.XAResource;
+
+/**
+ * XAManagedConnection
+ *
+ * @version $Revision: $
+ */
+public class XAManagedConnection implements ManagedConnection
+{
+
+   /** The logger */
+   private static Logger log = Logger.getLogger("XAManagedConnection");
+
+   /** The logwriter */
+   private PrintWriter logwriter;
+
+   /**
+    * Default constructor
+    */
+   public XAManagedConnection()
+   {
+
+   }
+
+   /**
+    * Creates a new connection handle for the underlying physical connection 
+    * represented by the ManagedConnection instance. 
+    *
+    * @param subject Security context as JAAS subject
+    * @param cxRequestInfo ConnectionRequestInfo instance
+    * @return generic Object instance representing the connection handle. 
+    * @throws ResourceException generic exception if operation fails
+    */
+   public Object getConnection(Subject subject,
+      ConnectionRequestInfo cxRequestInfo) throws ResourceException
+   {
+      log.finest("getConnection()");
+      return null;
+   }
+
+   /**
+    * Used by the container to change the association of an 
+    * application-level connection handle with a ManagedConneciton instance.
+    *
+    * @param connection Application-level connection handle
+    * @throws ResourceException generic exception if operation fails
+    */
+   public void associateConnection(Object connection) throws ResourceException
+   {
+      log.finest("associateConnection()");
+   }
+
+   /**
+    * Application server calls this method to force any cleanup on the ManagedConnection instance.
+    *
+    * @throws ResourceException generic exception if operation fails
+    */
+   public void cleanup() throws ResourceException
+
+   {
+      log.finest("cleanup()");
+   }
+
+   /**
+    * Destroys the physical connection to the underlying resource manager.
+    *
+    * @throws ResourceException generic exception if operation fails
+    */
+   public void destroy() throws ResourceException
+   {
+      log.finest("destroy()");
+   }
+
+   /**
+    * Adds a connection event listener to the ManagedConnection instance.
+    *
+    * @param listener A new ConnectionEventListener to be registered
+    */
+   public void addConnectionEventListener(ConnectionEventListener listener)
+   {
+      log.finest("addConnectionEventListener()");
+   }
+
+   /**
+    * Removes an already registered connection event listener from the ManagedConnection instance.
+    *
+    * @param listener already registered connection event listener to be removed
+    */
+   public void removeConnectionEventListener(ConnectionEventListener listener)
+   {
+      log.finest("removeConnectionEventListener()");
+   }
+
+   /**
+    * Gets the log writer for this ManagedConnection instance.
+    *
+    * @return Character ourput stream associated with this Managed-Connection instance
+    * @throws ResourceException generic exception if operation fails
+    */
+   public PrintWriter getLogWriter() throws ResourceException
+   {
+      log.finest("getLogWriter()");
+      return logwriter;
+   }
+
+   /**
+    * Sets the log writer for this ManagedConnection instance.
+    *
+    * @param out Character Output stream to be associated
+    * @throws ResourceException  generic exception if operation fails
+    */
+   public void setLogWriter(PrintWriter out) throws ResourceException
+   {
+      log.finest("setLogWriter()");
+      logwriter = out;
+   }
+
+   /**
+    * Returns an <code>javax.resource.spi.LocalTransaction</code> instance.
+    *
+    * @return LocalTransaction instance
+    * @throws ResourceException generic exception if operation fails
+    */
+   public LocalTransaction getLocalTransaction() throws ResourceException
+   {
+      log.finest("getLocalTransaction()");
+      return null;
+   }
+
+   /**
+    * Returns an <code>javax.transaction.xa.XAresource</code> instance. 
+    *
+    * @return XAResource instance
+    * @throws ResourceException generic exception if operation fails
+    */
+   public XAResource getXAResource() throws ResourceException
+   {
+      log.finest("getXAResource()");
+      return null;
+   }
+
+   /**
+    * Gets the metadata information for this connection's underlying EIS resource manager instance. 
+    *
+    * @return ManagedConnectionMetaData instance
+    * @throws ResourceException generic exception if operation fails
+    */
+   public ManagedConnectionMetaData getMetaData() throws ResourceException
+   {
+      log.finest("getMetaData()");
+      return new XAManagedConnectionMetaData();
+   }
+
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnectionFactory.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnectionFactory.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnectionFactory.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,246 @@
+/*
+ * 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.rar.xa;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ConfigProperty;
+import javax.resource.spi.ConnectionDefinition;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionFactory;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
+
+import javax.security.auth.Subject;
+
+/**
+ * XAManagedConnectionFactory
+ *
+ * @version $Revision: $
+ */
+ at ConnectionDefinition(connectionFactory = XAConnectionFactory.class,
+   connectionFactoryImpl = XAConnectionFactoryImpl.class,
+   connection = XAConnection.class,
+   connectionImpl = XAConnectionImpl.class)
+public class XAManagedConnectionFactory implements ManagedConnectionFactory, ResourceAdapterAssociation
+{
+
+   /** The serial version UID */
+   private static final long serialVersionUID = 1L;
+
+   /** The logger */
+   private static Logger log = Logger.getLogger("XAManagedConnectionFactory");
+
+   /** The resource adapter */
+   private ResourceAdapter ra;
+
+   /** The logwriter */
+   private PrintWriter logwriter;
+
+   /** management */
+   @ConfigProperty(defaultValue = "rhq")
+   private String management;
+
+   /**
+    * Default constructor
+    */
+   public XAManagedConnectionFactory()
+   {
+
+   }
+
+   /** 
+    * Set management
+    * @param management The value
+    */
+   public void setManagement(String management)
+   {
+      this.management = management;
+   }
+
+   /** 
+    * Get management
+    * @return The value
+    */
+   public String getManagement()
+   {
+      return management;
+   }
+
+   /**
+    * Creates a Connection Factory instance. 
+    *
+    * @param cxManager ConnectionManager to be associated with created EIS connection factory instance
+    * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+    * @throws ResourceException Generic exception
+    */
+   public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException
+   {
+      if (ra == null)
+         throw new IllegalStateException("RA is null");
+      log.finest("createConnectionFactory()");
+      return new XAConnectionFactoryImpl(cxManager);
+   }
+
+   /**
+    * Creates a Connection Factory instance. 
+    *
+    * @return EIS-specific Connection Factory instance or javax.resource.cci.ConnectionFactory instance
+    * @throws ResourceException Generic exception
+    */
+   public Object createConnectionFactory() throws ResourceException
+   {
+      if (ra == null)
+         throw new IllegalStateException("RA is null");
+      throw new ResourceException("This resource adapter doesn't support non-managed environments");
+   }
+
+   /**
+    * Creates a new physical connection to the underlying EIS resource manager.
+    *
+    * @param subject Caller's security information
+    * @param cxRequestInfo Additional resource adapter specific connection request information
+    * @throws ResourceException generic exception
+    * @return ManagedConnection instance 
+    */
+   public ManagedConnection createManagedConnection(Subject subject,
+         ConnectionRequestInfo cxRequestInfo) throws ResourceException
+   {
+      if (ra == null)
+         throw new IllegalStateException("RA is null");
+      log.finest("createManagedConnection()");
+      return null;
+   }
+
+   /**
+    * Returns a matched connection from the candidate set of connections. 
+    *
+    * @param connectionSet Candidate connection set
+    * @param subject Caller's security information
+    * @param cxRequestInfo Additional resource adapter specific connection request information
+    * @throws ResourceException generic exception
+    * @return ManagedConnection if resource adapter finds an acceptable match otherwise null 
+    */
+   public ManagedConnection matchManagedConnections(Set connectionSet,
+         Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException
+   {
+      if (ra == null)
+         throw new IllegalStateException("RA is null");
+      log.finest("matchManagedConnections()");
+      return null;
+   }
+
+   /**
+    * Get the log writer for this ManagedConnectionFactory instance.
+    *
+    * @return PrintWriter
+    * @throws ResourceException generic exception
+    */
+   public PrintWriter getLogWriter() throws ResourceException
+   {
+      log.finest("getLogWriter()");
+      return logwriter;
+   }
+
+   /**
+    * Set the log writer for this ManagedConnectionFactory instance.
+    *
+    * @param out PrintWriter - an out stream for error logging and tracing
+    * @throws ResourceException generic exception
+    */
+   public void setLogWriter(PrintWriter out) throws ResourceException
+   {
+      log.finest("setLogWriter()");
+      logwriter = out;
+   }
+
+   /**
+    * Get the resource adapter
+    *
+    * @return The handle
+    */
+   public ResourceAdapter getResourceAdapter()
+   {
+      log.finest("getResourceAdapter()");
+      return ra;
+   }
+
+   /**
+    * Set the resource adapter
+    *
+    * @param ra The handle
+    */
+   public void setResourceAdapter(ResourceAdapter ra)
+   {
+      log.finest("setResourceAdapter()");
+      this.ra = ra;
+   }
+
+   /** 
+    * Returns a hash code value for the object.
+    * @return A hash code value for this object.
+    */
+   @Override
+   public int hashCode()
+   {
+      int result = 17;
+      if (management != null)
+         result += 31 * result + 7 * management.hashCode();
+      else
+         result += 31 * result + 7;
+      return result;
+   }
+
+   /** 
+    * Indicates whether some other object is equal to this one.
+    * @param other The reference object with which to compare.
+    * @return true if this object is the same as the obj argument, false otherwise.
+    */
+   @Override
+   public boolean equals(Object other)
+   {
+      if (other == null)
+         return false;
+      if (other == this)
+         return true;
+      if (!(other instanceof XAManagedConnectionFactory))
+         return false;
+      XAManagedConnectionFactory obj = (XAManagedConnectionFactory)other;
+      boolean result = true; 
+      if (result)
+      {
+         if (management == null)
+            result = obj.getManagement() == null;
+         else
+            result = management.equals(obj.getManagement());
+      }
+      return result;
+   }
+
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnectionMetaData.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnectionMetaData.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAManagedConnectionMetaData.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,101 @@
+/*
+ * 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.rar.xa;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+
+import javax.resource.spi.ManagedConnectionMetaData;
+
+/**
+ * XAManagedConnectionMetaData
+ *
+ * @version $Revision: $
+ */
+public class XAManagedConnectionMetaData implements ManagedConnectionMetaData
+{
+   /** The logger */
+   private static Logger log = Logger.getLogger("XAManagedConnectionMetaData");
+
+   /**
+    * Default constructor
+    */
+   public XAManagedConnectionMetaData()
+   {
+
+   }
+
+   /**
+    * Returns Product name of the underlying EIS instance connected through the ManagedConnection.
+    *
+    * @return Product name of the EIS instance
+    * @throws ResourceException Thrown if an error occurs
+    */
+   @Override
+   public String getEISProductName() throws ResourceException
+   {
+      log.finest("getEISProductName()");
+      return null; //TODO
+   }
+
+   /**
+    * Returns Product version of the underlying EIS instance connected through the ManagedConnection.
+    *
+    * @return Product version of the EIS instance
+    * @throws ResourceException Thrown if an error occurs
+    */
+   @Override
+   public String getEISProductVersion() throws ResourceException
+   {
+      log.finest("getEISProductVersion()");
+      return null; //TODO
+   }
+
+   /**
+    * Returns maximum limit on number of active concurrent connections 
+    *
+    * @return Maximum limit for number of active concurrent connections
+    * @throws ResourceException Thrown if an error occurs
+    */
+   @Override
+   public int getMaxConnections() throws ResourceException
+   {
+      log.finest("getMaxConnections()");
+      return 0; //TODO
+   }
+
+   /**
+    * Returns name of the user associated with the ManagedConnection instance
+    *
+    * @return Name of the user
+    * @throws ResourceException Thrown if an error occurs
+    */
+   @Override
+   public String getUserName() throws ResourceException
+   {
+      log.finest("getUserName()");
+      return null; //TODO
+   }
+
+
+}

Added: 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	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/XAResourceAdapter.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,203 @@
+/*
+ * 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.rar.xa;
+
+import org.jboss.jca.rhq.rar.xa.inflow.XAActivation;
+import org.jboss.jca.rhq.rar.xa.inflow.XAActivationSpec;
+
+import java.util.concurrent.ConcurrentHashMap;
+
+import java.util.logging.Logger;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.AdministeredObject;
+import javax.resource.spi.BootstrapContext;
+import javax.resource.spi.ConfigProperty;
+import javax.resource.spi.Connector;
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterInternalException;
+import javax.resource.spi.TransactionSupport;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+
+import javax.transaction.xa.XAResource;
+
+/**
+ * XAResourceAdapter
+ *
+ * @version $Revision: $
+ */
+ at Connector(
+   reauthenticationSupport = false,
+   transactionSupport = TransactionSupport.TransactionSupportLevel.XATransaction)
+ at AdministeredObject(adminObjectInterfaces = { XAAdminObjectImpl.class })
+public class XAResourceAdapter implements ResourceAdapter
+{
+
+   /** The logger */
+   private static Logger log = Logger.getLogger("XAResourceAdapter");
+
+   /** The activations by activation spec */
+   ConcurrentHashMap<XAActivationSpec, XAActivation> activations;
+
+   /** name */
+   @ConfigProperty(defaultValue = "Jeff")
+   private String name;
+
+   /**
+    * Default constructor
+    */
+   public XAResourceAdapter()
+   {
+      this.activations = new ConcurrentHashMap<XAActivationSpec, XAActivation>();
+
+   }
+
+   /** 
+    * Set name
+    * @param name The value
+    */
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   /** 
+    * Get name
+    * @return The value
+    */
+   public String getName()
+   {
+      return name;
+   }
+
+   /**
+    * This is called during the activation of a message endpoint.
+    *
+    * @param endpointFactory A message endpoint factory instance.
+    * @param spec An activation spec JavaBean instance.
+    * @throws ResourceException generic exception 
+    */
+   public void endpointActivation(MessageEndpointFactory endpointFactory,
+      ActivationSpec spec) throws ResourceException
+   {
+      XAActivation activation = new XAActivation(this, endpointFactory, (XAActivationSpec)spec);
+      activations.put((XAActivationSpec)spec, activation);
+      activation.start();
+
+      log.finest("endpointActivation()");
+   }
+
+   /**
+    * This is called when a message endpoint is deactivated. 
+    *
+    * @param endpointFactory A message endpoint factory instance.
+    * @param spec An activation spec JavaBean instance.
+    */
+   public void endpointDeactivation(MessageEndpointFactory endpointFactory,
+      ActivationSpec spec)
+   {
+      XAActivation activation = activations.remove(spec);
+      if (activation != null)
+         activation.stop();
+
+      log.finest("endpointDeactivation()");
+   }
+
+   /**
+    * This is called when a resource adapter instance is bootstrapped.
+    *
+    * @param ctx A bootstrap context containing references 
+    * @throws ResourceAdapterInternalException indicates bootstrap failure.
+    */
+   public void start(BootstrapContext ctx)
+      throws ResourceAdapterInternalException
+   {
+      log.finest("start()");
+   }
+
+   /**
+    * This is called when a resource adapter instance is undeployed or
+    * during application server shutdown. 
+    */
+   public void stop()
+   {
+      log.finest("stop()");
+   }
+
+   /**
+    * This method is called by the application server during crash recovery.
+    *
+    * @param specs An array of ActivationSpec JavaBeans 
+    * @throws ResourceException generic exception 
+    * @return An array of XAResource objects
+    */
+   public XAResource[] getXAResources(ActivationSpec[] specs)
+      throws ResourceException
+   {
+      log.finest("getXAResources()");
+      return null;
+   }
+
+   /** 
+    * Returns a hash code value for the object.
+    * @return A hash code value for this object.
+    */
+   @Override
+   public int hashCode()
+   {
+      int result = 17;
+      if (name != null)
+         result += 31 * result + 7 * name.hashCode();
+      else
+         result += 31 * result + 7;
+      return result;
+   }
+
+   /** 
+    * Indicates whether some other object is equal to this one.
+    * @param other The reference object with which to compare.
+    * @return true if this object is the same as the obj argument, false otherwise.
+    */
+   @Override
+   public boolean equals(Object other)
+   {
+      if (other == null)
+         return false;
+      if (other == this)
+         return true;
+      if (!(other instanceof XAResourceAdapter))
+         return false;
+      XAResourceAdapter obj = (XAResourceAdapter)other;
+      boolean result = true; 
+      if (result)
+      {
+         if (name == null)
+            result = obj.getName() == null;
+         else
+            result = name.equals(obj.getName());
+      }
+      return result;
+   }
+
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAActivation.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAActivation.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAActivation.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -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.rar.xa.inflow;
+
+import org.jboss.jca.rhq.rar.xa.XAResourceAdapter;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+
+/**
+ * XAActivation
+ *
+ * @version $Revision: $
+ */
+public class XAActivation
+{
+
+   /** The resource adapter */
+   private XAResourceAdapter ra;
+
+   /** Activation spec */
+   private XAActivationSpec spec;
+
+   /** The message endpoint factory */
+   private MessageEndpointFactory endpointFactory;
+
+   /**
+    * Default constructor
+    * @exception ResourceException Thrown if an error occurs
+    */
+   public XAActivation() throws ResourceException
+   {
+      this(null, null, null);
+   }
+
+   /**
+    * Constructor
+    * @param ra XAResourceAdapter
+    * @param endpointFactory MessageEndpointFactory
+    * @param spec XAActivationSpec
+    * @exception ResourceException Thrown if an error occurs
+    */
+   public XAActivation(XAResourceAdapter ra, 
+      MessageEndpointFactory endpointFactory,
+      XAActivationSpec spec) throws ResourceException
+
+   {
+      this.ra = ra;
+      this.endpointFactory = endpointFactory;
+      this.spec = spec;
+   }
+
+   /**
+    * Get activation spec class
+    * @return Activation spec
+    */
+   public XAActivationSpec getActivationSpec()
+   {
+      return spec;
+   }
+
+   /**
+    * Get message endpoint factory
+    * @return Message endpoint factory
+    */
+   public MessageEndpointFactory getMessageEndpointFactory()
+   {
+      return endpointFactory;
+   }
+
+   /**
+    * Start the activation
+    * @throws ResourceException Thrown if an error occurs
+    */
+   public void start() throws ResourceException
+   {
+
+   }
+
+   /**
+    * Stop the activation
+    */
+   public void stop()
+   {
+
+   }
+
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAActivationSpec.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAActivationSpec.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAActivationSpec.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,111 @@
+/*
+ * 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.rar.xa.inflow;
+
+import java.util.logging.Logger;
+
+import javax.resource.spi.Activation;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.ConfigProperty;
+import javax.resource.spi.InvalidPropertyException;
+import javax.resource.spi.ResourceAdapter;
+
+/**
+ * XAActivationSpec
+ *
+ * @version $Revision: $
+ */
+ at Activation(messageListeners = { org.jboss.jca.rhq.rar.xa.inflow.XAMessageListener.class })
+public class XAActivationSpec implements ActivationSpec
+{
+
+   /** The logger */
+   private static Logger log = Logger.getLogger("XAActivationSpec");
+
+   /** The resource adapter */
+   private ResourceAdapter ra;
+
+   /** asConfig */
+   @ConfigProperty(defaultValue = "as-config")
+   private String asConfig;
+
+   /**
+    * Default constructor
+    */
+   public XAActivationSpec()
+   {
+
+   }
+
+   /** 
+    * Set asConfig
+    * @param asConfig The value
+    */
+   public void setAsConfig(String asConfig)
+   {
+      this.asConfig = asConfig;
+   }
+
+   /** 
+    * Get asConfig
+    * @return The value
+    */
+   public String getAsConfig()
+   {
+      return asConfig;
+   }
+
+   /**
+    * This method may be called by a deployment tool to validate the overall
+    * activation configuration information provided by the endpoint deployer.
+    *
+    * @throws InvalidPropertyException indicates invalid onfiguration property settings.
+    */
+   public void validate() throws InvalidPropertyException
+   {
+      log.finest("validate()");
+   }
+
+   /**
+    * Get the resource adapter
+    *
+    * @return The handle
+    */
+   public ResourceAdapter getResourceAdapter()
+   {
+      log.finest("getResourceAdapter()");
+      return ra;
+   }
+
+   /**
+    * Set the resource adapter
+    *
+    * @param ra The handle
+    */
+   public void setResourceAdapter(ResourceAdapter ra)
+   {
+      log.finest("setResourceAdapter()");
+      this.ra = ra;
+   }
+
+
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAMessageListener.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAMessageListener.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/XAMessageListener.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,36 @@
+/*
+ * 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.rar.xa.inflow;
+
+/**
+ * XAMessageListener
+ *
+ * @version $Revision: $
+ */
+public interface XAMessageListener
+{
+   /**
+    * Receive message
+    * @param msg String.
+    */
+   public void onMessage(String msg);
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/package.html
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/inflow/package.html	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,2 @@
+<body>
+</body>

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/package.html
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/rar/xa/package.html	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,2 @@
+<body>
+</body>

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/EmbeddedJCAContainerTest.java
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/EmbeddedJCAContainerTest.java	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/EmbeddedJCAContainerTest.java	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,82 @@
+/*
+ * 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 org.jboss.jca.core.api.management.ManagementRepository;
+import org.jboss.jca.embedded.Embedded;
+import org.jboss.jca.embedded.EmbeddedFactory;
+
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * EmbeddedJCAContainerTest
+ * 
+ * @author Jeff Zhang
+ *
+ */
+public class EmbeddedJCAContainerTest
+{
+   /** Embedded */
+   private static Embedded embedded;
+   
+   /**
+    * Basic testGetManagementRepository
+    * 
+    * @exception Throwable Thrown if case of an error
+    */
+   @Test
+   public void testGetManagementRepository() throws Throwable
+   {
+      ManagementRepository manRepo = embedded.lookup("ManagementRepository", ManagementRepository.class);
+      Assert.assertNotNull(manRepo);
+   }
+
+   /**
+    * Lifecycle start, before the suite is executed
+    * @throws Throwable throwable exception 
+    */
+   @BeforeClass
+   public static void beforeClass() throws Throwable
+   {
+      // Create and set an embedded JCA instance
+      embedded = EmbeddedFactory.create();
+      // Startup
+      embedded.startup();
+
+   }
+
+   /**
+    * Lifecycle stop, after the suite is executed
+    * @throws Throwable throwable exception 
+    */
+   @AfterClass
+   public static void afterClass() throws Throwable
+   {
+      // Shutdown embedded
+      embedded.shutdown();
+      // Set embedded to null
+      embedded = null;
+   }
+}

Added: projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/package.html
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/java/org/jboss/jca/rhq/test/package.html	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,3 @@
+<body>
+IronJacamar RHQ core for test.
+</body>

Added: projects/jboss-jca/trunk/rhq/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-jca/trunk/rhq/src/test/resources/jndi.properties	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/resources/jndi.properties	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,2 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

Added: 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	                        (rev 0)
+++ projects/jboss-jca/trunk/rhq/src/test/resources/xa.rar/META-INF/ironjacamar.xml	2011-02-23 01:42:05 UTC (rev 110748)
@@ -0,0 +1,47 @@
+<!--
+/*
+ * 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.
+ */
+-->
+
+<ironjacamar xmlns="http://www.jboss.org/ironjacamar/schema"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             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>
+
+  <transaction-support>XATransaction</transaction-support>
+  
+  <connection-definitions>
+    <connection-definition class-name="org.jboss.jca.rhq.test.xa.XAManagedConnectionFactory" 
+      enabled="true" jndi-name="java:/eis/XA" 
+      use-java-context="true" pool-name="XA">
+      <config-property name="management">rhq</config-property>
+
+    </connection-definition>
+  </connection-definitions>
+  <admin-objects>
+    <admin-object class-name="org.jboss.jca.rhq.test.xa.XAAdminObjectImpl" jndi-name="java:/XAAdminObjectImpl">
+      <config-property name="aoConfig">ao-config</config-property>
+    </admin-object>
+  </admin-objects>
+
+</ironjacamar>



More information about the jboss-cvs-commits mailing list