[jboss-cvs] JBossAS SVN: r111586 - in projects/jboss-jca/tags: IRONJACAMAR_1_0_0_CR2 and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jun 10 20:12:53 EDT 2011


Author: jesper.pedersen
Date: 2011-06-10 20:12:52 -0400 (Fri, 10 Jun 2011)
New Revision: 111586

Added:
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/build.xml
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/SecurityActions.java
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java
Removed:
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/build.xml
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java
   projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java
Log:
IronJacamar 1.0.0.CR2

Deleted: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/build.xml
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/build.xml	2011-06-10 14:17:48 UTC (rev 111581)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/build.xml	2011-06-11 00:12:52 UTC (rev 111586)
@@ -1,1524 +0,0 @@
-<!--
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
--->
-<project name="ironjacamar" 
-         default="jars" 
-         basedir="." 
-         xmlns:ivy="antlib:org.apache.ivy.ant">
-
-  <available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
-  <available classname="java.lang.management.LockInfo" property="HAVE_JDK_1.6"/>
-  <available classname="java.util.concurrent.ForkJoinPool" property="HAVE_JDK_1.7"/>
-
-  <!-- ================================= 
-       Project              
-       ================================= -->
-  <property name="name" value="ironjacamar"/>
-  <property name="major" value="1"/>
-  <property name="minor" value="0"/>
-  <property name="patch" value="0"/>
-  <property name="type" value="Final"/>
-
-  <condition property="version" value="${major}.${minor}.${patch}-SNAPSHOT">
-    <isset property="snapshot"/>
-  </condition>
-  <property name="version" value="${major}.${minor}.${patch}.${type}"/>
-
-  <!-- ================================= 
-       Maven repository settings
-       ================================= -->
-  <condition property="mavensettings" value="/private/ironjacamar/settings.xml">
-    <isset property="cloudbees"/>
-  </condition>
-  <property name="mavensettings" value="$HOME/.m2/settings.xml"/>
-
-  <condition property="repositoryurl" value="https://repository.jboss.org/nexus/content/repositories/snapshots/">
-    <isset property="snapshot"/>
-  </condition>
-  <property name="repositoryurl" value="https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/"/>
-
-  <condition property="repositoryid" value="jboss-snapshots">
-    <isset property="snapshot"/>
-  </condition>
-  <property name="repositoryid" value="jboss-releases"/>
-
-  <!-- ================================= 
-       Ivy              
-       ================================= -->
-  <property name="ivy.version" value="2.2.0"/>
-  <property name="ivy.dir" value="${user.home}/.ivy2/cache/org.apache.ivy/jars"/>
-  <property name="ivy.jar.name" value="ivy-${ivy.version}.jar"/>
-
-  <!-- ================================= 
-       Repositories              
-       ================================= -->
-  <property name="central.repo" value="http://repo1.maven.org/maven2"/>
-  <property name="jboss.repo" value="http://repository.jboss.org/nexus/content/groups/public/"/>
-  <property name="snapshots.repo" value="http://repository.jboss.org/nexus/content/repositories/snapshots/"/>
-  <property name="fungal.repo" value="http://jesperpedersen.github.com/fungal/maven2"/>
-  
-  <!-- ================================= 
-       Properties              
-       ================================= -->
-  <property name="lib.dir" value="${basedir}/lib" />
-  <property name="build.dir" value="${basedir}/build" />
-  <property name="api.dir" value="${basedir}/api" />
-  <property name="doc.dir" value="${basedir}/doc" />
-  <property name="target.dir" value="${basedir}/target" />
-  <property name="tools.dir" value="${basedir}/tools" />
-  <property name="reports.dir" value="${basedir}/reports" />
-  <property name="test.dir" value="${reports.dir}" />
-
-  <property name="javac.debug" value="on" />
-  <property name="javac.deprecation" value="on" />
-  <property name="javac.optimize" value="off" />
-
-  <property name="junit.printsummary" value="yes" />
-  <property name="junit.haltonerror" value="no" />
-  <property name="junit.haltonfailure" value="no" />
-  <property name="junit.fork" value="yes" />
-  <property name="junit.timeout" value="60000" />
-  <property name="junit.jvm" value="" />
-  <property name="junit.jvm.options" value="-Xms128m -Xmx512m -XX:MaxPermSize=256m" />
-  <property name="junit.batchtest.haltonerror" value="no" />
-  <property name="junit.batchtest.haltonfailure" value="no" />
-  <property name="junit.batchtest.fork" value="yes" />
-
-  <!-- ================================= 
-       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"/>
-  <property name="version.arquillian" value="1.0.0.Beta1"/>
-  <property name="version.dom4j" value="1.6.1"/>
-  <property name="version.mockito" value="1.8.5"/>
-  <property name="version.eclipse.ecj" value="3.5.1"/>
-  <property name="version.fungal" value="0.9.0.Final"/>
-  <property name="version.h2" value="1.3.154"/>
-  <property name="version.hibernate-annotations" value="3.5.1-Final"/>
-  <property name="version.hibernate-validator" value="4.1.0.Final"/>
-  <property name="version.hornetq" value="2.2.2.Final"/>
-  <property name="version.javassist" value="3.14.0-GA"/>
-  <property name="version.jboss.common" value="2.2.17.GA"/>
-  <property name="version.jboss.jaspi.api" value="1.0.0.Final"/>
-  <property name="version.jboss.jms.api" value="1.0.0.Beta1"/>
-  <property name="version.jboss.logging" value="3.0.0.CR1"/>
-  <property name="version.jboss.logging-generator" value="1.0.0.Beta7"/>
-  <property name="version.jboss.logging-processor" value="1.0.0.Beta7"/>
-  <property name="version.jboss.logmanager" value="1.2.0.CR9"/>
-  <property name="version.jboss.naming" value="5.0.3.GA"/>
-  <property name="version.jboss.netty" value="3.2.1.Final"/>
-  <property name="version.jboss.papaki" value="1.0.0.Beta3"/>
-  <property name="version.jboss.picketbox" value="4.0.0.Beta4"/>
-  <property name="version.jboss.security" value="2.1.0.20090318"/>
-  <property name="version.jboss.shrinkwrap" value="1.0.0-beta-2"/>
-  <property name="version.jboss.shrinkwrap.descriptors" value="1.0.0-beta-1"/>
-  <property name="version.jboss.slf4j" value="1.0.2.GA"/>
-  <property name="version.jboss.slf4j.logmanager" value="1.0.0.CR3"/>
-  <property name="version.jboss.stdio" value="1.0.0.CR3"/>
-  <property name="version.jboss.threads" value="2.0.0.CR7"/>
-  <property name="version.jboss.ts" value="4.15.1.Final"/>
-  <property name="version.jboss.ts.spi" value="7.0.0.CR1"/>
-  <property name="version.jdepend" value="2.9.1"/>
-  <property name="version.jetty" value="7.4.0.v20110414"/>
-  <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.Beta1"/>
-  <property name="version.slf4j" value="1.5.8"/>
-  <property name="version.transaction.api" value="1.0.0.Final"/>
-  <property name="version.validation-api" value="1.0.0.GA"/>
-
-  <!-- ================================= 
-       Paths              
-       ================================= -->
-  <path id="sjc.lib.path.id">
-    <fileset dir="${lib.dir}/common">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/embedded">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/arquillian">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/jetty">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/hornetq">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/sjc">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/mail">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/tools">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${target.dir}">
-      <include name="**/*.jar"/>
-    </fileset>
-  </path>
-
-  <path id="rhq.lib.path.id">
-    <path refid="sjc.lib.path.id"/>
-    <fileset dir="${lib.dir}/rhq">
-      <include name="**/*.jar"/>
-    </fileset>
-  </path>
-
-  <path id="test.lib.path.id">
-    <fileset dir="${lib.dir}/common">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/sjc">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/embedded">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/arquillian">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/mail">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/hornetq">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/test">
-      <include name="**/*.jar"/>
-    </fileset>
-    <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>
-  </path>
-
-  <path id="checkstyle.lib.path.id">
-    <fileset dir="${tools.dir}/checkstyle/lib"/>
-    <fileset dir="${lib.dir}/common">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/embedded">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/arquillian">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/jetty">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/hornetq">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/sjc">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/mail">
-      <include name="**/*.jar"/>
-    </fileset>
-    <fileset dir="${lib.dir}/test">
-      <include name="**/*.jar"/>
-    </fileset>
-    <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>
-  </path>
-
-  <path id="findbugs.lib.path.id">
-    <fileset dir="${tools.dir}/findbugs/lib"/>
-  </path>
-
-  <path id="cobertura.lib.path.id">
-    <fileset dir="${tools.dir}/cobertura/lib"/>
-  </path>
-
-  <path id="tattletale.lib.path.id">
-    <fileset dir="${tools.dir}/tattletale/lib"/>
-  </path>
-
-  <!-- ================================= 
-       Bootstrap Ivy
-       ================================= -->
-  <mkdir dir="${ivy.dir}"/>
-  <get usetimestamp="true" src="https://repository.apache.org/content/repositories/releases/org/apache/ivy/ivy/${ivy.version}/${ivy.jar.name}" 
-       skipexisting="true"
-       dest="${ivy.dir}/${ivy.jar.name}"/>
-  <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.dir}/${ivy.jar.name}"/>
-
-  <!-- ================================= 
-       Target: init              
-       ================================= -->
-  <target name="init">
-    <fail message="IronJacamar requires JDK6+" unless="HAVE_JDK_1.6"/>
-  
-    <ivy:settings file="${basedir}/ivy.settings.xml"/>
-
-    <mkdir dir="${build.dir}" />
-    <mkdir dir="${target.dir}" />
-  </target>
-
-  <!-- ================================= 
-       Target: resolve              
-       ================================= -->
-  <target name="resolve" depends="init">
-    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" 
-                  conf="common,sjc,embedded,arquillian,jetty,hornetq,mail,rhq,test,tools"
-                  sync="true"/>
-  </target>
-  
-  <!-- ================================= 
-       Target: report              
-       ================================= -->
-  <target name="report" depends="resolve">
-    <ivy:report todir="${target.dir}"/>
-  </target>
-  
-  <!-- ================================= 
-       Target: jars
-       ================================= -->
-  <target name="jars" depends="resolve">
-    <ant dir="api" inheritRefs="true" target="jars"/>
-    <ant dir="common" inheritRefs="true" target="jars"/>
-    <ant dir="core" inheritRefs="true" target="jars"/>
-    <ant dir="validator" inheritRefs="true" target="jars"/>
-    <ant dir="deployers" inheritRefs="true" target="jars"/>
-    <ant dir="embedded" inheritRefs="true" target="jars"/>
-    <ant dir="web" inheritRefs="true" target="jars"/>
-    <ant dir="sjc" inheritRefs="true" target="jars"/>
-    <ant dir="codegenerator" inheritRefs="true" target="jars"/>
-    <ant dir="adapters" inheritRefs="true" target="jars"/>
-    <ant dir="rhq" inheritRefs="true" target="jars"/>
-  </target>
-  
-  <!-- ================================= 
-       Target: docs
-       ================================= -->
-  <target name="docs" depends="jars">
-    <ant dir="api" inheritRefs="true" target="docs"/>
-    <ant dir="common" inheritRefs="true" target="docs"/>
-    <ant dir="core" inheritRefs="true" target="docs"/>
-    <ant dir="validator" inheritRefs="true" target="docs"/>
-    <ant dir="deployers" inheritRefs="true" target="docs"/>
-    <ant dir="embedded" inheritRefs="true" target="docs"/>
-    <ant dir="web" inheritRefs="true" target="docs"/>
-    <ant dir="sjc" inheritRefs="true" target="docs"/>
-    <ant dir="codegenerator" inheritRefs="true" target="docs"/>
-    <ant dir="adapters" inheritRefs="true" target="docs"/>
-    <ant dir="rhq" inheritRefs="true" target="docs"/>
-  </target>
-  
-  <!-- ================================= 
-       Target: manual
-       ================================= -->
-  <target name="manual">
-    <ant dir="${doc.dir}/developerguide" inheritRefs="false" inheritAll="false"/>
-    <ant dir="${doc.dir}/userguide" inheritRefs="false" inheritAll="false"/>
-  </target>
-
-  <!-- ================================= 
-       Target: prepare test
-       ================================= -->
-  <target name="prepare-test" depends="jars">
-    <ant dir="common" inheritRefs="true" target="prepare-test"/>
-    <ant dir="core" inheritRefs="true" target="prepare-test"/>
-    <ant dir="embedded" inheritRefs="true" target="prepare-test"/>
-    <ant dir="deployers" inheritRefs="true" target="prepare-test"/>
-    <ant dir="validator" inheritRefs="true" target="prepare-test"/>
-    <ant dir="codegenerator" inheritRefs="true" target="prepare-test"/>
-    <ant dir="adapters" inheritRefs="true" target="prepare-test"/>
-    <ant dir="rhq" inheritRefs="true" target="prepare-test"/>
-  </target>
-  
-  <!-- ================================= 
-       Target: test
-       ================================= -->
-  <target name="test" depends="prepare-test">
-    <ant dir="common" inheritRefs="true" target="test"/>
-    <ant dir="core" inheritRefs="true" target="test"/>
-    <ant dir="embedded" inheritRefs="true" target="test"/>
-    <ant dir="deployers" inheritRefs="true" target="test"/>
-    <ant dir="validator" inheritRefs="true" target="test"/>
-    <ant dir="adapters" inheritRefs="true" target="test"/>
-    <ant dir="rhq" inheritRefs="true" target="test"/>
-  </target>
-  
-  <!-- ================================= 
-       Target: one-test
-       ================================= -->
-  <target name="one-test" depends="jars">
-    <condition property="module" else="core">
-      <equals arg1="${module}" arg2="" trim="true"/> 
-    </condition>
-
-    <ant dir="${module}" inheritRefs="true" target="one-test"/>
-  </target>
-
-  <!-- ================================= 
-       Target: module-test
-       ================================= -->
-  <target name="module-test" depends="jars">
-    <condition property="module" else="core">
-      <equals arg1="${module}" arg2="" trim="true"/> 
-    </condition>
-  	
-    <ant dir="${module}" inheritRefs="true" target="test"/>
-  </target>
-
-  <!-- ================================= 
-       Target: artifacts
-       ================================= -->
-  <target name="artifacts" depends="resolve">
-    <ant dir="api" inheritRefs="true" target="artifacts"/>
-    <ant dir="common" inheritRefs="true" target="artifacts"/>
-    <ant dir="core" inheritRefs="true" target="artifacts"/>
-    <ant dir="validator" inheritRefs="true" target="artifacts"/>
-    <ant dir="deployers" inheritRefs="true" target="artifacts"/>
-    <ant dir="embedded" inheritRefs="true" target="artifacts"/>
-    <ant dir="codegenerator" inheritRefs="true" target="artifacts"/>
-    <ant dir="adapters" inheritRefs="true" target="artifacts"/>
-  </target>
-  
-  <!-- ================================= 
-       Target: sjc
-       ================================= -->
-  <target name="sjc" depends="jars">
-    <ant dir="sjc" inheritRefs="true" target="sjc"/>
-  </target>
-
-  <!-- ================================= 
-       Target: release
-       ================================= -->
-  <target name="release" depends="clean,sjc">
-    <delete dir="${build.dir}"/>
-
-    <mkdir dir="${build.dir}" />
-    <mkdir dir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}" />
-    <mkdir dir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc" />
-    <mkdir dir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc/spec" />
-
-    <ant dir="${doc.dir}/samples/helloworld" target="dist-clean" inheritRefs="false" inheritAll="false"/>
-
-    <ant dir="${doc.dir}/developerguide" target="pdf" inheritRefs="false" inheritAll="false"/>
-    <ant dir="${doc.dir}/userguide" target="pdf" inheritRefs="false" inheritAll="false"/>
-
-    <copy flatten="true" todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc">
-      <fileset dir="${target.dir}/docs">
-        <include name="**/*.pdf"/>
-      </fileset>
-    </copy>
-
-    <ant dir="sjc" inheritRefs="true" target="war"/>
-    <delete dir="${build.dir}/sjc"/>
-
-    <ant dir="api" inheritRefs="true" target="docs"/>
-    <move todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc/spec">
-      <fileset dir="${target.dir}/docs/spec">
-        <include name="**/*"/>
-      </fileset>
-    </move>
-    <delete dir="${build.dir}/api"/>
-
-    <copy todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}">
-      <fileset dir="${target.dir}/sjc"/>
-    </copy>
-    <chmod perm="755" type="file">
-      <fileset dir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}">
-        <include name="**/*.sh"/>
-      </fileset>
-    </chmod>
-
-    <delete dir="${build.dir}/docbook"/>
-
-    <zip destfile="${name}-${major}.${minor}.${patch}.${type}.zip"
-         basedir="${build.dir}"/>
-    
-    <tar destfile="${name}-${major}.${minor}.${patch}.${type}.tar"
-         basedir="${build.dir}"/>
-    
-    <gzip zipfile="${name}-${major}.${minor}.${patch}.${type}.tar.gz" 
-          src="${name}-${major}.${minor}.${patch}.${type}.tar"/>
-    
-    <delete file="${name}-${major}.${minor}.${patch}.${type}.tar"/>
-    
-  </target>
-
-  <!-- ================================= 
-       Target: checkstyle
-       ================================= -->
-  <target name="checkstyle" depends="jars">
-    <taskdef name="checkstyle"
-             classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"
-             classpathref="checkstyle.lib.path.id"/>
-
-    <mkdir dir="${reports.dir}/checkstyle" />
-
-    <checkstyle config="${tools.dir}/checkstyle/checkstyle.xml"
-                failOnViolation="false"
-                classpathref="checkstyle.lib.path.id">
-      <fileset dir="${basedir}">
-        <include name="**/*.java"/>
-        <exclude name="build/**/*.java"/>
-      </fileset>
-      <formatter type="plain"/>
-      <formatter type="xml" toFile="${reports.dir}/checkstyle/checkstyle-result.xml"/>
-    </checkstyle>
-  </target>
-
-  <!-- ================================= 
-       Target: findbugs
-       ================================= -->
-  <target name="findbugs" depends="jars">
-    <taskdef name="findbugs"
-             classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
-             classpathref="findbugs.lib.path.id"/>
-
-    <mkdir dir="${reports.dir}/findbugs" />
-
-    <findbugs home="${basedir}/tools/findbugs/lib/"
-              output="html"
-              outputFile="${reports.dir}/findbugs/findbugs.html" 
-              excludeFilter="${basedir}/tools/findbugs/filter.xml"
-              reportLevel="low">
-      <auxClasspath>
-        <fileset dir="${lib.dir}/common">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/embedded">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/arquillian">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/jetty">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/hornetq">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/sjc">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/mail">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/rhq">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/test">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/tools">
-          <include name="*.jar"/>
-        </fileset>
-      </auxClasspath>
-      <class location="${target.dir}/${name}-codegenerator.jar" />
-      <class location="${target.dir}/${name}-common-api.jar" />
-      <class location="${target.dir}/${name}-common-impl.jar" />
-      <class location="${target.dir}/${name}-common-impl-papaki.jar" />
-      <class location="${target.dir}/${name}-common-spi.jar" />
-      <class location="${target.dir}/${name}-core-api.jar" />
-      <class location="${target.dir}/${name}-core-impl.jar" />
-      <class location="${target.dir}/${name}-deployers-common.jar" />
-      <class location="${target.dir}/${name}-deployers-fungal.jar" />
-      <class location="${target.dir}/${name}-embedded.jar" />
-      <class location="${target.dir}/${name}-embedded-arquillian.jar" />
-      <class location="${target.dir}/${name}-rhq.jar" />
-      <class location="${target.dir}/${name}-sjc.jar" />
-      <class location="${target.dir}/${name}-spec-api.jar" />
-      <class location="${target.dir}/${name}-validator.jar" />
-      <class location="${target.dir}/${name}-validator-ant.jar" />
-      <class location="${target.dir}/${name}-validator-cli.jar" />
-      <class location="${target.dir}/${name}-validator-maven.jar" />
-      <class location="${target.dir}/${name}-web.jar" />
-      <class location="${target.dir}/${name}-web-console.jar" />
-    </findbugs>
-
-    <findbugs home="${basedir}/tools/findbugs/lib/"
-              output="xml:withMessages"
-              outputFile="${reports.dir}/findbugs/findbugs.xml" 
-              excludeFilter="${basedir}/tools/findbugs/filter.xml"
-              reportLevel="low">
-      <auxClasspath>
-        <fileset dir="${lib.dir}/common">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/embedded">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/arquillian">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/jetty">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/hornetq">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/sjc">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/mail">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/rhq">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/test">
-          <include name="*.jar"/>
-        </fileset>
-        <fileset dir="${lib.dir}/tools">
-          <include name="*.jar"/>
-        </fileset>
-      </auxClasspath>
-      <class location="${target.dir}/${name}-codegenerator.jar" />
-      <class location="${target.dir}/${name}-common-api.jar" />
-      <class location="${target.dir}/${name}-common-impl.jar" />
-      <class location="${target.dir}/${name}-common-impl-papaki.jar" />
-      <class location="${target.dir}/${name}-common-spi.jar" />
-      <class location="${target.dir}/${name}-core-api.jar" />
-      <class location="${target.dir}/${name}-core-impl.jar" />
-      <class location="${target.dir}/${name}-deployers-common.jar" />
-      <class location="${target.dir}/${name}-deployers-fungal.jar" />
-      <class location="${target.dir}/${name}-embedded.jar" />
-      <class location="${target.dir}/${name}-embedded-arquillian.jar" />
-      <class location="${target.dir}/${name}-rhq.jar" />
-      <class location="${target.dir}/${name}-sjc.jar" />
-      <class location="${target.dir}/${name}-spec-api.jar" />
-      <class location="${target.dir}/${name}-validator.jar" />
-      <class location="${target.dir}/${name}-validator-ant.jar" />
-      <class location="${target.dir}/${name}-validator-cli.jar" />
-      <class location="${target.dir}/${name}-validator-maven.jar" />
-      <class location="${target.dir}/${name}-web.jar" />
-      <class location="${target.dir}/${name}-web-console.jar" />
-    </findbugs>
-  </target>
-
-  <!-- ================================= 
-       Target: cobertura
-       ================================= -->
-  <target name="cobertura" depends="prepare-test">
-    <taskdef resource="tasks.properties"
-             classpathref="cobertura.lib.path.id"/>
-
-    <mkdir dir="${reports.dir}/cobertura" />
-    <mkdir dir="${reports.dir}/cobertura/tests" />
-
-    <delete file="${reports.dir}/cobertura/cobertura.ser"/>
-    <delete dir="${build.dir}/instrumented"/>
-    
-    <mkdir dir="${build.dir}/instrumented" />
-    <copy todir="${build.dir}/instrumented">
-      <fileset dir="${target.dir}">
-        <include name="*.jar"/>
-      </fileset>
-    </copy>
-
-    <copy todir="${build.dir}/instrumented">
-      <fileset dir="${build.dir}/adapters">
-        <include name="*.jar"/>
-      </fileset>
-    </copy>
-
-    <cobertura-instrument todir="${build.dir}/instrumented"
-                          datafile="${reports.dir}/cobertura/cobertura.ser">
-      <fileset dir="${target.dir}">
-        <include name="ironjacamar*.jar" />
-      </fileset>
-    </cobertura-instrument>
-
-    <copy todir="${build.dir}/instrumented">
-      <fileset dir="${target.dir}">
-        <include name="${name}-core-api.jar"/>
-      </fileset>
-    </copy>
-
-    <junit dir="common/src/test"
-           printsummary="${junit.printsummary}"
-           haltonerror="${junit.haltonerror}"
-           haltonfailure="${junit.haltonfailure}"
-           fork="yes"
-           timeout="${junit.timeout}">
-      
-      <jvmarg line="${junit.jvm.options}"/>
-      <sysproperty key="test.dir" value="${test.dir}"/>
-      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
-      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
-      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
-      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
-      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
-      <sysproperty key="log4j.defaultInitOverride" value="true"/>
-
-      <classpath>
-        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
-        <pathelement location="${build.dir}/common/test"/>
-        <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}/jetty" includes="*.jar" />
-        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
-        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
-        <fileset dir="${lib.dir}/mail" includes="*.jar" />
-        <fileset dir="${lib.dir}/test" includes="*.jar" />
-        <fileset dir="${lib.dir}/tools" includes="*.jar" />
-        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
-      </classpath>
-      <classpath refid="cobertura.lib.path.id" />
-      
-      <formatter type="xml"/>
-      
-      <batchtest todir="${reports.dir}/cobertura/tests">
-        <fileset dir="${build.dir}/common/test">
-          <include name="**/*TestCase.class"/>
-        </fileset>
-      </batchtest>
-    </junit>
-
-    <junit dir="core/src/test"
-           printsummary="${junit.printsummary}"
-           haltonerror="${junit.haltonerror}"
-           haltonfailure="${junit.haltonfailure}"
-           fork="yes"
-           timeout="${junit.timeout}">
-      
-      <jvmarg line="${junit.jvm.options}"/>
-      <sysproperty key="test.dir" value="${test.dir}"/>
-      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
-      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
-      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
-      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
-      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
-      <sysproperty key="log4j.defaultInitOverride" value="true"/>
-
-      <classpath>
-        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
-        <pathelement location="${build.dir}/core/test"/>
-        <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}/jetty" includes="*.jar" />
-        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
-        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
-        <fileset dir="${lib.dir}/mail" includes="*.jar" />
-        <fileset dir="${lib.dir}/test" includes="*.jar" />
-        <fileset dir="${lib.dir}/tools" includes="*.jar" />
-        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
-      </classpath>
-      <classpath refid="cobertura.lib.path.id" />
-      
-      <formatter type="xml"/>
-      
-      <batchtest todir="${reports.dir}/cobertura/tests">
-        <fileset dir="${build.dir}/core/test">
-          <include name="**/*TestCase.class"/>
-        </fileset>
-      </batchtest>
-    </junit>
-
-    <junit dir="deployers/src/test"
-           printsummary="${junit.printsummary}"
-           haltonerror="${junit.haltonerror}"
-           haltonfailure="${junit.haltonfailure}"
-           fork="yes"
-           timeout="${junit.timeout}">
-      
-      <jvmarg line="${junit.jvm.options}"/>
-      <sysproperty key="archives.dir" value="${build.dir}/deployers"/>
-      <sysproperty key="test.dir" value="${test.dir}"/>
-      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
-      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
-      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
-      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
-      <sysproperty key="log4j.defaultInitOverride" value="true"/>
-
-      <classpath>
-        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
-        <pathelement location="${build.dir}/deployers/test"/>
-        <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}/jetty" includes="*.jar" />
-        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
-        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
-        <fileset dir="${lib.dir}/mail" includes="*.jar" />
-        <fileset dir="${lib.dir}/test" includes="*.jar" />
-        <fileset dir="${lib.dir}/tools" includes="*.jar" />
-        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
-      </classpath>
-      <classpath refid="cobertura.lib.path.id" />
-      
-      <formatter type="xml"/>
-      
-      <batchtest todir="${reports.dir}/cobertura/tests">
-        <fileset dir="${build.dir}/deployers/test">
-          <include name="**/*TestCase.class"/>
-        </fileset>
-      </batchtest>
-    </junit>
-
-    <junit dir="embedded/src/test"
-           printsummary="${junit.printsummary}"
-           haltonerror="${junit.haltonerror}"
-           haltonfailure="${junit.haltonfailure}"
-           fork="yes"
-           timeout="${junit.timeout}">
-      
-      <jvmarg line="${junit.jvm.options}"/>
-      <sysproperty key="test.dir" value="${test.dir}"/>
-      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
-      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
-      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
-      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
-      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
-      <sysproperty key="log4j.defaultInitOverride" value="true"/>
-
-      <classpath>
-        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
-        <pathelement location="${build.dir}/embedded/test"/>
-        <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}/jetty" includes="*.jar" />
-        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
-        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
-        <fileset dir="${lib.dir}/mail" includes="*.jar" />
-        <fileset dir="${lib.dir}/test" includes="*.jar" />
-        <fileset dir="${lib.dir}/tools" includes="*.jar" />
-        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
-      </classpath>
-      <classpath refid="cobertura.lib.path.id" />
-      
-      <formatter type="xml"/>
-      
-      <batchtest todir="${reports.dir}/cobertura/tests">
-        <fileset dir="${build.dir}/embedded/test">
-          <include name="**/*TestCase.class"/>
-        </fileset>
-      </batchtest>
-    </junit>
-
-    <junit dir="validator/src/test"
-           printsummary="${junit.printsummary}"
-           haltonerror="${junit.haltonerror}"
-           haltonfailure="${junit.haltonfailure}"
-           fork="yes"
-           timeout="${junit.timeout}">
-      
-      <jvmarg line="${junit.jvm.options}"/>
-      <sysproperty key="test.dir" value="${test.dir}"/>
-      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
-      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
-      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
-      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
-      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
-      <sysproperty key="log4j.defaultInitOverride" value="true"/>
-
-      <classpath>
-        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
-        <pathelement location="${build.dir}/validator/test"/>
-        <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}/jetty" includes="*.jar" />
-        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
-        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
-        <fileset dir="${lib.dir}/mail" includes="*.jar" />
-        <fileset dir="${lib.dir}/test" includes="*.jar" />
-        <fileset dir="${lib.dir}/tools" includes="*.jar" />
-        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
-      </classpath>
-      <classpath refid="cobertura.lib.path.id" />
-      
-      <formatter type="xml"/>
-      
-      <batchtest todir="${reports.dir}/cobertura/tests">
-        <fileset dir="${build.dir}/validator/test">
-          <include name="**/*TestCase.class"/>
-        </fileset>
-      </batchtest>
-    </junit>
-
-    <junit dir="codegenerator/src/test"
-           printsummary="${junit.printsummary}"
-           haltonerror="${junit.haltonerror}"
-           haltonfailure="${junit.haltonfailure}"
-           fork="yes"
-           timeout="${junit.timeout}">
-      
-      <jvmarg line="${junit.jvm.options}"/>
-      <sysproperty key="test.dir" value="${test.dir}"/>
-      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
-      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
-      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
-      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
-      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
-      <sysproperty key="log4j.defaultInitOverride" value="true"/>
-
-      <classpath>
-        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
-        <pathelement location="${build.dir}/codegenerator/test"/>
-        <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}/jetty" includes="*.jar" />
-        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
-        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
-        <fileset dir="${lib.dir}/mail" includes="*.jar" />
-        <fileset dir="${lib.dir}/test" includes="*.jar" />
-        <fileset dir="${lib.dir}/tools" includes="*.jar" />
-        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
-      </classpath>
-      <classpath refid="cobertura.lib.path.id" />
-      
-      <formatter type="xml"/>
-      
-      <batchtest todir="${reports.dir}/cobertura/tests">
-        <fileset dir="${build.dir}/codegenerator/test">
-          <include name="**/*TestCase.class"/>
-        </fileset>
-      </batchtest>
-    </junit>
-
-    <junit dir="adapters/src/test"
-           printsummary="${junit.printsummary}"
-           haltonerror="${junit.haltonerror}"
-           haltonfailure="${junit.haltonfailure}"
-           fork="yes"
-           timeout="${junit.timeout}">
-      
-      <jvmarg line="${junit.jvm.options}"/>
-      <sysproperty key="test.dir" value="${test.dir}"/>
-      <sysproperty key="archives.dir" value="${build.dir}/adapters"/>
-      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
-      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
-      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
-      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
-      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
-      <sysproperty key="log4j.defaultInitOverride" value="true"/>
-
-      <classpath>
-        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
-        <pathelement location="${build.dir}/adapters/"/>
-        <pathelement location="${build.dir}/adapters/test"/>
-        <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}/jetty" includes="*.jar" />
-        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
-        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
-        <fileset dir="${lib.dir}/mail" includes="*.jar" />
-        <fileset dir="${lib.dir}/test" includes="*.jar" />
-        <fileset dir="${lib.dir}/tools" includes="*.jar" />
-        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
-      </classpath>
-      <classpath refid="cobertura.lib.path.id" />
-      
-      <formatter type="xml"/>
-      
-      <batchtest todir="${reports.dir}/cobertura/tests">
-        <fileset dir="${build.dir}/adapters/test">
-          <include name="**/*TestCase.class"/>
-        </fileset>
-      </batchtest>
-    </junit>
-
-    <junit dir="rhq/src/test"
-           printsummary="${junit.printsummary}"
-           haltonerror="${junit.haltonerror}"
-           haltonfailure="${junit.haltonfailure}"
-           fork="yes"
-           timeout="${junit.timeout}">
-      
-      <jvmarg line="${junit.jvm.options}"/>
-      <sysproperty key="test.dir" value="${test.dir}"/>
-      <sysproperty key="archives.dir" value="${build.dir}/rhq"/>
-      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
-      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
-      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
-      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
-      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
-      <sysproperty key="log4j.defaultInitOverride" value="true"/>
-
-      <classpath>
-        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
-        <pathelement location="${build.dir}/rhq/"/>
-        <pathelement location="${build.dir}/rhq/test"/>
-        <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}/jetty" includes="*.jar" />
-        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
-        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
-        <fileset dir="${lib.dir}/mail" includes="*.jar" />
-        <fileset dir="${lib.dir}/test" includes="*.jar" />
-        <fileset dir="${lib.dir}/tools" includes="*.jar" />
-        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
-      </classpath>
-      <classpath refid="cobertura.lib.path.id" />
-      
-      <formatter type="xml"/>
-      
-      <batchtest todir="${reports.dir}/cobertura/tests">
-        <fileset dir="${build.dir}/rhq/test">
-          <include name="**/*TestCase.class"/>
-        </fileset>
-      </batchtest>
-    </junit>
-
-    <cobertura-report format="html" 
-                      destdir="${reports.dir}/cobertura/html" 
-                      datafile="${reports.dir}/cobertura/cobertura.ser">
-      <fileset dir="api/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="adapters/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="codegenerator/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="common/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="core/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="deployers/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="embedded/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="sjc/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="validator/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="web/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="rhq/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-    </cobertura-report>
-
-    <cobertura-report format="xml" 
-                      destdir="${reports.dir}/cobertura/xml" 
-                      datafile="${reports.dir}/cobertura/cobertura.ser">
-      <fileset dir="api/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="adapters/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="codegenerator/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="common/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="core/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="deployers/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="embedded/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="sjc/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="validator/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="web/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-      <fileset dir="rhq/src/main/java">
-        <include name="**/*.java" />
-      </fileset>
-    </cobertura-report>
-  </target>
-
-  <!-- ================================= 
-       Target: tattletale
-       ================================= -->
-  <target name="tattletale" depends="sjc">
-    <taskdef name="report"
-             classname="org.jboss.tattletale.ant.ReportTask"
-             classpathref="tattletale.lib.path.id"/>
-
-    <mkdir dir="${reports.dir}/tattletale"/>
-
-    <report source="${target.dir}/sjc"
-            destination="${reports.dir}/tattletale"
-            configuration="${tools.dir}/tattletale/configuration.properties"
-            filter="${tools.dir}/tattletale/filter.properties"
-            profiles="java6"/>
-  </target>
-
-  <!-- ================================= 
-       Target: clean              
-       ================================= -->
-  <target name="clean">
-    <delete>
-      <fileset dir="${basedir}" defaultexcludes="no">
-        <include name="**/*~"/>
-        <include name="**/*.bak"/>
-      </fileset>
-    </delete>
-    <delete>
-      <fileset dir="${lib.dir}" includes="**/*.jar"/>
-    </delete>
-    <delete dir="${build.dir}"/>
-    <delete dir="${target.dir}"/>
-    <delete dir="${reports.dir}"/>
-    <delete file="${name}-${major}.${minor}.${patch}.${type}.zip" />
-    <delete file="${name}-${major}.${minor}.${patch}.${type}.tar.gz" />
-
-    <ant antfile="tools/docant/build.xml" target="clean" inheritrefs="false" inheritAll="false"/>
-    <delete dir="${doc.dir}/target"/>
-  </target>
-  
-  <!-- ================================= 
-       Target: clean-cache              
-       ================================= -->
-  <target name="clean-cache">
-    <ivy:cleancache />
-  </target>
-
-  <!-- ================================= 
-       Target: nexus
-       ================================= -->
-  <macrodef name="deploy-file">
-    <attribute name="file"/>
-    <attribute name="artifact"/>
-    <attribute name="extension"/>
-    <sequential>
-      <concat destfile="${target.dir}/@{file}" append="true" force="true" eol="unix">
-mvn -s ${mavensettings} org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file -Dfile=$PWD/@{artifact}.@{extension} -DpomFile=@{artifact}.xml -Dsources=$PWD/@{artifact}-sources.jar -Djavadoc=$PWD/@{artifact}-javadoc.jar $REPOSITORY
-</concat>
-    </sequential>
-  </macrodef>
-
-  <macrodef name="install-file">
-    <attribute name="file"/>
-    <attribute name="artifact"/>
-    <attribute name="extension"/>
-    <sequential>
-      <concat destfile="${target.dir}/@{file}" append="true" force="true" eol="unix">
-mvn install:install-file -Dfile=$PWD/@{artifact}.@{extension} -DpomFile=@{artifact}.xml -Dsources=$PWD/@{artifact}-sources.jar -Djavadoc=$PWD/@{artifact}-javadoc.jar
-</concat>
-    </sequential>
-  </macrodef>
-
-  <target name="nexus" depends="clean,artifacts">
-    <fail message="IronJacamar doesn't support JDK 7+ artifacts" if="HAVE_JDK_1.7"/>
-  
-    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" 
-                  conf="${name}-codegenerator,${name}-common-api,${name}-common-impl,${name}-common-impl-papaki,${name}-common-spi,${name}-core-api,${name}-core-impl,${name}-deployers-common,${name}-deployers-fungal,${name}-embedded,${name}-embedded-arquillian,${name}-spec-api,${name}-validator,${name}-validator-ant,${name}-validator-cli,jdbc-local,jdbc-xa,mail"
-                  sync="true"/>
-
-    <delete file="${target.dir}/deploy.sh"/>
-    <delete file="${target.dir}/install.sh"/>
-
-    <concat destfile="${target.dir}/deploy.sh" append="true" force="true" eol="unix">#!/bin/sh
-PWD=`pwd`
-VERSION=${version}
-REPOSITORY='-Durl=${repositoryurl} -DrepositoryId=${repositoryid}'
-</concat>
-
-    <concat destfile="${target.dir}/install.sh" append="true" force="true" eol="unix">#!/bin/sh
-PWD=`pwd`
-VERSION=${version}
-</concat>
-
-    <!-- ironjacamar-codegenerator -->
-    <delete file="${target.dir}/${name}-codegenerator.xml"/>
-    <ivy:makepom artifactName="${name}-codegenerator" 
-                 conf="${name}-codegenerator"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-codegenerator.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-codegenerator" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-codegenerator" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-codegenerator" extension="jar"/>
-
-    <!-- ironjacamar-common-api -->
-    <delete file="${target.dir}/${name}-common-api.xml"/>
-    <ivy:makepom artifactName="${name}-common-api" 
-                 conf="${name}-common-api"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-common-api.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-common-api" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-common-api" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-common-api" extension="jar"/>
-
-    <!-- ironjacamar-common-impl -->
-    <delete file="${target.dir}/${name}-common-impl.xml"/>
-    <ivy:makepom artifactName="${name}-common-impl" 
-                 conf="${name}-common-impl"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-common-impl.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-common-impl" scope="runtime"/>
-      <dependency artifact="${name}-common-api" scope="runtime"/>
-      <dependency artifact="${name}-common-spi" scope="runtime"/>
-      <dependency artifact="${name}-spec-api" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-common-impl" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-common-impl" extension="jar"/>
-
-    <!-- ironjacamar-common-impl-papaki -->
-    <delete file="${target.dir}/${name}-common-impl-papaki.xml"/>
-    <ivy:makepom artifactName="${name}-common-impl-papaki" 
-                 conf="${name}-common-impl-papaki"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-common-impl-papaki.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-common-impl-papaki" scope="runtime"/>
-      <dependency artifact="${name}-common-spi" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-common-impl-papaki" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-common-impl-papaki" extension="jar"/>
-
-    <!-- ironjacamar-common-spi -->
-    <delete file="${target.dir}/${name}-common-spi.xml"/>
-    <ivy:makepom artifactName="${name}-common-spi" 
-                 conf="${name}-common-spi"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-common-spi.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-common-spi" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-common-spi" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-common-spi" extension="jar"/>
-
-    <!-- ironjacamar-core-api -->
-    <delete file="${target.dir}/${name}-core-api.xml"/>
-    <ivy:makepom artifactName="${name}-core-api" 
-                 conf="${name}-core-api"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-core-api.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-core-api" scope="runtime"/>
-      <dependency artifact="${name}-spec-api" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-core-api" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-core-api" extension="jar"/>
-
-    <!-- ironjacamar-core-impl -->
-    <delete file="${target.dir}/${name}-core-impl.xml"/>
-    <ivy:makepom artifactName="${name}-core-impl" 
-                 conf="${name}-core-impl"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-core-impl.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-core-impl" scope="runtime"/>
-      <dependency artifact="${name}-common-impl" scope="runtime"/>
-      <dependency artifact="${name}-core-api" scope="runtime"/>
-      <dependency artifact="${name}-spec-api" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-core-impl" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-core-impl" extension="jar"/>
-
-    <!-- ironjacamar-depchain -->
-    <delete file="${target.dir}/${name}-depchain.xml"/>
-    <ivy:makepom artifactName="${name}-depchain" 
-                 conf="${name}-depchain"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-depchain.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-depchain" scope="runtime"/>
-    </ivy:makepom>
-
-    <concat destfile="${target.dir}/deploy.sh" append="true" force="true" eol="unix">
-mvn -s ${mavensettings} org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file -Dfile=$PWD/${name}-depchain.xml -DpomFile=${name}-depchain.xml $REPOSITORY
-</concat>
-<concat destfile="${target.dir}/install.sh" append="true" force="true" eol="unix">
-mvn install:install-file -Dfile=$PWD/${name}-depchain.xml -DpomFile=${name}-depchain.xml -DuniqueVersion=false $REPOSITORY
-</concat>
-
-    <!-- ironjacamar-deployers-common -->
-    <delete file="${target.dir}/${name}-deployers-common.xml"/>
-    <ivy:makepom artifactName="${name}-deployers-common" 
-                 conf="${name}-deployers-common"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-deployers-common.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-deployers-common" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-deployers-common" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-deployers-common" extension="jar"/>
-
-    <!-- ironjacamar-deployers-fungal -->
-    <delete file="${target.dir}/${name}-deployers-fungal.xml"/>
-    <ivy:makepom artifactName="${name}-deployers-fungal" 
-                 conf="${name}-deployers-fungal"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-deployers-fungal.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-deployers-fungal" scope="runtime"/>
-      <dependency artifact="${name}-common-impl" scope="runtime"/>
-      <dependency artifact="${name}-core-api" scope="runtime"/>
-      <dependency artifact="${name}-core-impl" scope="runtime"/>
-      <dependency artifact="${name}-spec-api" scope="runtime"/>
-      <dependency artifact="${name}-validator" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-deployers-fungal" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-deployers-fungal" extension="jar"/>
-
-    <!-- ironjacamar-embedded -->
-    <delete file="${target.dir}/${name}-embedded.xml"/>
-    <ivy:makepom artifactName="${name}-embedded" 
-                 conf="${name}-embedded"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-embedded.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-embedded" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-embedded" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-embedded" extension="jar"/>
-
-    <!-- ironjacamar-embedded-arquillian -->
-    <delete file="${target.dir}/${name}-embedded-arquillian.xml"/>
-    <ivy:makepom artifactName="${name}-embedded-arquillian" 
-                 conf="${name}-embedded-arquillian"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-embedded-arquillian.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-embedded-arquillian" scope="runtime"/>
-      <dependency artifact="${name}-embedded" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-embedded-arquillian" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-embedded-arquillian" extension="jar"/>
-
-    <!-- ironjacamar-spec-api -->
-    <delete file="${target.dir}/${name}-spec-api.xml"/>
-    <ivy:makepom artifactName="${name}-spec-api" 
-                 conf="${name}-spec-api"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-spec-api.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-spec-api" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-spec-api" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-spec-api" extension="jar"/>
-
-    <!-- ironjacamar-validator -->
-    <delete file="${target.dir}/${name}-validator.xml"/>
-    <ivy:makepom artifactName="${name}-validator" 
-                 conf="${name}-validator"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-validator.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-validator" scope="runtime"/>
-      <dependency artifact="${name}-common-api" scope="runtime"/>
-      <dependency artifact="${name}-common-impl" scope="runtime"/>
-      <dependency artifact="${name}-common-spi" scope="runtime"/>
-      <dependency artifact="${name}-spec-api" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-validator" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-validator" extension="jar"/>
-
-    <!-- ironjacamar-validator-ant -->
-    <delete file="${target.dir}/${name}-validator-ant.xml"/>
-    <ivy:makepom artifactName="${name}-validator-ant" 
-                 conf="${name}-validator-ant"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-validator-ant.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-validator-ant" scope="runtime"/>
-      <dependency artifact="${name}-validator" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-validator-ant" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-validator" extension="jar"/>
-
-    <!-- ironjacamar-validator-cli -->
-    <delete file="${target.dir}/${name}-validator-cli.xml"/>
-    <ivy:makepom artifactName="${name}-validator-cli" 
-                 conf="${name}-validator-cli"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-validator-cli.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-validator-cli" scope="runtime"/>
-      <dependency artifact="${name}-validator" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-validator-cli" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-validator-cli" extension="jar"/>
-
-    <!-- ironjacamar-validator-maven -->
-    <delete file="${target.dir}/${name}-validator-maven.xml"/>
-    <ivy:makepom artifactName="${name}-validator-maven" 
-                 conf="${name}-validator-maven"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/${name}-validator-maven.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="${name}-validator-maven" scope="runtime"/>
-      <dependency artifact="${name}-validator" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-validator-maven" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-validator-maven" extension="jar"/>
-
-    <!-- ironjacamar-jdbc -->
-    <delete file="${target.dir}/${name}-jdbc.xml"/>
-    <ivy:makepom artifactName="${name}-jdbc" 
-                conf="${name}-jdbc"
-                ivyfile="${basedir}/ivy.xml" 
-                pomfile="${target.dir}/${name}-jdbc.xml"
-                headerFile="${tools.dir}/mvn/HEADER"
-                templatefile="${tools.dir}/mvn/pom.template"
-                printIvyInfo="false">
-      <mapping conf="${name}-jdbc" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="${name}-jdbc" extension="jar"/>
-    <install-file file="install.sh" artifact="${name}-jdbc" extension="jar"/>
-  	
-    <!-- jdbc-local -->
-    <delete file="${target.dir}/jdbc-local.xml"/>
-    <ivy:makepom artifactName="jdbc-local" 
-                 conf="jdbc-local"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/jdbc-local.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="jdbc-local" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="jdbc-local" extension="rar"/>
-    <install-file file="install.sh" artifact="jdbc-local" extension="rar"/>
-
-    <!-- jdbc-xa -->
-    <delete file="${target.dir}/jdbc-xa.xml"/>
-    <ivy:makepom artifactName="jdbc-xa" 
-                 conf="jdbc-xa"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/jdbc-xa.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="jdbc-xa" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="jdbc-xa" extension="rar"/>
-    <install-file file="install.sh" artifact="jdbc-xa" extension="rar"/>
-
-    <!-- mail -->
-    <delete file="${target.dir}/mail.xml"/>
-    <ivy:makepom artifactName="mail" 
-                 conf="mail"
-                 ivyfile="${basedir}/ivy.xml" 
-                 pomfile="${target.dir}/mail.xml"
-                 headerFile="${tools.dir}/mvn/HEADER"
-                 templatefile="${tools.dir}/mvn/pom.template"
-                 printIvyInfo="false">
-      <mapping conf="mail" scope="runtime"/>
-    </ivy:makepom>
-
-    <deploy-file file="deploy.sh" artifact="mail" extension="rar"/>
-    <install-file file="install.sh" artifact="mail" extension="rar"/>
-
-    <chmod file="${target.dir}/deploy.sh" perm="755"/>
-    <chmod file="${target.dir}/install.sh" perm="755"/>
-
-  </target>
-
-</project>

Copied: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/build.xml (from rev 111585, projects/jboss-jca/branches/Branch_1_0/build.xml)
===================================================================
--- projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/build.xml	                        (rev 0)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/build.xml	2011-06-11 00:12:52 UTC (rev 111586)
@@ -0,0 +1,1524 @@
+<!--
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<project name="ironjacamar" 
+         default="jars" 
+         basedir="." 
+         xmlns:ivy="antlib:org.apache.ivy.ant">
+
+  <available classname="java.lang.Enum" property="HAVE_JDK_1.5"/>
+  <available classname="java.lang.management.LockInfo" property="HAVE_JDK_1.6"/>
+  <available classname="java.util.concurrent.ForkJoinPool" property="HAVE_JDK_1.7"/>
+
+  <!-- ================================= 
+       Project              
+       ================================= -->
+  <property name="name" value="ironjacamar"/>
+  <property name="major" value="1"/>
+  <property name="minor" value="0"/>
+  <property name="patch" value="0"/>
+  <property name="type" value="CR2"/>
+
+  <condition property="version" value="${major}.${minor}.${patch}-SNAPSHOT">
+    <isset property="snapshot"/>
+  </condition>
+  <property name="version" value="${major}.${minor}.${patch}.${type}"/>
+
+  <!-- ================================= 
+       Maven repository settings
+       ================================= -->
+  <condition property="mavensettings" value="/private/ironjacamar/settings.xml">
+    <isset property="cloudbees"/>
+  </condition>
+  <property name="mavensettings" value="$HOME/.m2/settings.xml"/>
+
+  <condition property="repositoryurl" value="https://repository.jboss.org/nexus/content/repositories/snapshots/">
+    <isset property="snapshot"/>
+  </condition>
+  <property name="repositoryurl" value="https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/"/>
+
+  <condition property="repositoryid" value="jboss-snapshots">
+    <isset property="snapshot"/>
+  </condition>
+  <property name="repositoryid" value="jboss-releases"/>
+
+  <!-- ================================= 
+       Ivy              
+       ================================= -->
+  <property name="ivy.version" value="2.2.0"/>
+  <property name="ivy.dir" value="${user.home}/.ivy2/cache/org.apache.ivy/jars"/>
+  <property name="ivy.jar.name" value="ivy-${ivy.version}.jar"/>
+
+  <!-- ================================= 
+       Repositories              
+       ================================= -->
+  <property name="central.repo" value="http://repo1.maven.org/maven2"/>
+  <property name="jboss.repo" value="http://repository.jboss.org/nexus/content/groups/public/"/>
+  <property name="snapshots.repo" value="http://repository.jboss.org/nexus/content/repositories/snapshots/"/>
+  <property name="fungal.repo" value="http://jesperpedersen.github.com/fungal/maven2"/>
+  
+  <!-- ================================= 
+       Properties              
+       ================================= -->
+  <property name="lib.dir" value="${basedir}/lib" />
+  <property name="build.dir" value="${basedir}/build" />
+  <property name="api.dir" value="${basedir}/api" />
+  <property name="doc.dir" value="${basedir}/doc" />
+  <property name="target.dir" value="${basedir}/target" />
+  <property name="tools.dir" value="${basedir}/tools" />
+  <property name="reports.dir" value="${basedir}/reports" />
+  <property name="test.dir" value="${reports.dir}" />
+
+  <property name="javac.debug" value="on" />
+  <property name="javac.deprecation" value="on" />
+  <property name="javac.optimize" value="off" />
+
+  <property name="junit.printsummary" value="yes" />
+  <property name="junit.haltonerror" value="no" />
+  <property name="junit.haltonfailure" value="no" />
+  <property name="junit.fork" value="yes" />
+  <property name="junit.timeout" value="60000" />
+  <property name="junit.jvm" value="" />
+  <property name="junit.jvm.options" value="-Xms128m -Xmx512m -XX:MaxPermSize=256m" />
+  <property name="junit.batchtest.haltonerror" value="no" />
+  <property name="junit.batchtest.haltonfailure" value="no" />
+  <property name="junit.batchtest.fork" value="yes" />
+
+  <!-- ================================= 
+       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"/>
+  <property name="version.arquillian" value="1.0.0.Beta1"/>
+  <property name="version.dom4j" value="1.6.1"/>
+  <property name="version.mockito" value="1.8.5"/>
+  <property name="version.eclipse.ecj" value="3.5.1"/>
+  <property name="version.fungal" value="0.9.0.Final"/>
+  <property name="version.h2" value="1.3.154"/>
+  <property name="version.hibernate-annotations" value="3.5.1-Final"/>
+  <property name="version.hibernate-validator" value="4.1.0.Final"/>
+  <property name="version.hornetq" value="2.2.2.Final"/>
+  <property name="version.javassist" value="3.14.0-GA"/>
+  <property name="version.jboss.common" value="2.2.17.GA"/>
+  <property name="version.jboss.jaspi.api" value="1.0.0.Final"/>
+  <property name="version.jboss.jms.api" value="1.0.0.Beta1"/>
+  <property name="version.jboss.logging" value="3.0.0.CR1"/>
+  <property name="version.jboss.logging-generator" value="1.0.0.Beta7"/>
+  <property name="version.jboss.logging-processor" value="1.0.0.Beta7"/>
+  <property name="version.jboss.logmanager" value="1.2.0.CR9"/>
+  <property name="version.jboss.naming" value="5.0.3.GA"/>
+  <property name="version.jboss.netty" value="3.2.1.Final"/>
+  <property name="version.jboss.papaki" value="1.0.0.Beta3"/>
+  <property name="version.jboss.picketbox" value="4.0.0.Beta4"/>
+  <property name="version.jboss.security" value="2.1.0.20090318"/>
+  <property name="version.jboss.shrinkwrap" value="1.0.0-beta-2"/>
+  <property name="version.jboss.shrinkwrap.descriptors" value="1.0.0-beta-1"/>
+  <property name="version.jboss.slf4j" value="1.0.2.GA"/>
+  <property name="version.jboss.slf4j.logmanager" value="1.0.0.CR3"/>
+  <property name="version.jboss.stdio" value="1.0.0.CR3"/>
+  <property name="version.jboss.threads" value="2.0.0.CR7"/>
+  <property name="version.jboss.ts" value="4.15.1.Final"/>
+  <property name="version.jboss.ts.spi" value="7.0.0.CR1"/>
+  <property name="version.jdepend" value="2.9.1"/>
+  <property name="version.jetty" value="7.4.0.v20110414"/>
+  <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.Beta1"/>
+  <property name="version.slf4j" value="1.5.8"/>
+  <property name="version.transaction.api" value="1.0.0.Final"/>
+  <property name="version.validation-api" value="1.0.0.GA"/>
+
+  <!-- ================================= 
+       Paths              
+       ================================= -->
+  <path id="sjc.lib.path.id">
+    <fileset dir="${lib.dir}/common">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/embedded">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/arquillian">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/jetty">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/hornetq">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/sjc">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/mail">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/tools">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${target.dir}">
+      <include name="**/*.jar"/>
+    </fileset>
+  </path>
+
+  <path id="rhq.lib.path.id">
+    <path refid="sjc.lib.path.id"/>
+    <fileset dir="${lib.dir}/rhq">
+      <include name="**/*.jar"/>
+    </fileset>
+  </path>
+
+  <path id="test.lib.path.id">
+    <fileset dir="${lib.dir}/common">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/sjc">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/embedded">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/arquillian">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/mail">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/hornetq">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/test">
+      <include name="**/*.jar"/>
+    </fileset>
+    <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>
+  </path>
+
+  <path id="checkstyle.lib.path.id">
+    <fileset dir="${tools.dir}/checkstyle/lib"/>
+    <fileset dir="${lib.dir}/common">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/embedded">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/arquillian">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/jetty">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/hornetq">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/sjc">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/mail">
+      <include name="**/*.jar"/>
+    </fileset>
+    <fileset dir="${lib.dir}/test">
+      <include name="**/*.jar"/>
+    </fileset>
+    <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>
+  </path>
+
+  <path id="findbugs.lib.path.id">
+    <fileset dir="${tools.dir}/findbugs/lib"/>
+  </path>
+
+  <path id="cobertura.lib.path.id">
+    <fileset dir="${tools.dir}/cobertura/lib"/>
+  </path>
+
+  <path id="tattletale.lib.path.id">
+    <fileset dir="${tools.dir}/tattletale/lib"/>
+  </path>
+
+  <!-- ================================= 
+       Bootstrap Ivy
+       ================================= -->
+  <mkdir dir="${ivy.dir}"/>
+  <get usetimestamp="true" src="https://repository.apache.org/content/repositories/releases/org/apache/ivy/ivy/${ivy.version}/${ivy.jar.name}" 
+       skipexisting="true"
+       dest="${ivy.dir}/${ivy.jar.name}"/>
+  <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.dir}/${ivy.jar.name}"/>
+
+  <!-- ================================= 
+       Target: init              
+       ================================= -->
+  <target name="init">
+    <fail message="IronJacamar requires JDK6+" unless="HAVE_JDK_1.6"/>
+  
+    <ivy:settings file="${basedir}/ivy.settings.xml"/>
+
+    <mkdir dir="${build.dir}" />
+    <mkdir dir="${target.dir}" />
+  </target>
+
+  <!-- ================================= 
+       Target: resolve              
+       ================================= -->
+  <target name="resolve" depends="init">
+    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" 
+                  conf="common,sjc,embedded,arquillian,jetty,hornetq,mail,rhq,test,tools"
+                  sync="true"/>
+  </target>
+  
+  <!-- ================================= 
+       Target: report              
+       ================================= -->
+  <target name="report" depends="resolve">
+    <ivy:report todir="${target.dir}"/>
+  </target>
+  
+  <!-- ================================= 
+       Target: jars
+       ================================= -->
+  <target name="jars" depends="resolve">
+    <ant dir="api" inheritRefs="true" target="jars"/>
+    <ant dir="common" inheritRefs="true" target="jars"/>
+    <ant dir="core" inheritRefs="true" target="jars"/>
+    <ant dir="validator" inheritRefs="true" target="jars"/>
+    <ant dir="deployers" inheritRefs="true" target="jars"/>
+    <ant dir="embedded" inheritRefs="true" target="jars"/>
+    <ant dir="web" inheritRefs="true" target="jars"/>
+    <ant dir="sjc" inheritRefs="true" target="jars"/>
+    <ant dir="codegenerator" inheritRefs="true" target="jars"/>
+    <ant dir="adapters" inheritRefs="true" target="jars"/>
+    <ant dir="rhq" inheritRefs="true" target="jars"/>
+  </target>
+  
+  <!-- ================================= 
+       Target: docs
+       ================================= -->
+  <target name="docs" depends="jars">
+    <ant dir="api" inheritRefs="true" target="docs"/>
+    <ant dir="common" inheritRefs="true" target="docs"/>
+    <ant dir="core" inheritRefs="true" target="docs"/>
+    <ant dir="validator" inheritRefs="true" target="docs"/>
+    <ant dir="deployers" inheritRefs="true" target="docs"/>
+    <ant dir="embedded" inheritRefs="true" target="docs"/>
+    <ant dir="web" inheritRefs="true" target="docs"/>
+    <ant dir="sjc" inheritRefs="true" target="docs"/>
+    <ant dir="codegenerator" inheritRefs="true" target="docs"/>
+    <ant dir="adapters" inheritRefs="true" target="docs"/>
+    <ant dir="rhq" inheritRefs="true" target="docs"/>
+  </target>
+  
+  <!-- ================================= 
+       Target: manual
+       ================================= -->
+  <target name="manual">
+    <ant dir="${doc.dir}/developerguide" inheritRefs="false" inheritAll="false"/>
+    <ant dir="${doc.dir}/userguide" inheritRefs="false" inheritAll="false"/>
+  </target>
+
+  <!-- ================================= 
+       Target: prepare test
+       ================================= -->
+  <target name="prepare-test" depends="jars">
+    <ant dir="common" inheritRefs="true" target="prepare-test"/>
+    <ant dir="core" inheritRefs="true" target="prepare-test"/>
+    <ant dir="embedded" inheritRefs="true" target="prepare-test"/>
+    <ant dir="deployers" inheritRefs="true" target="prepare-test"/>
+    <ant dir="validator" inheritRefs="true" target="prepare-test"/>
+    <ant dir="codegenerator" inheritRefs="true" target="prepare-test"/>
+    <ant dir="adapters" inheritRefs="true" target="prepare-test"/>
+    <ant dir="rhq" inheritRefs="true" target="prepare-test"/>
+  </target>
+  
+  <!-- ================================= 
+       Target: test
+       ================================= -->
+  <target name="test" depends="prepare-test">
+    <ant dir="common" inheritRefs="true" target="test"/>
+    <ant dir="core" inheritRefs="true" target="test"/>
+    <ant dir="embedded" inheritRefs="true" target="test"/>
+    <ant dir="deployers" inheritRefs="true" target="test"/>
+    <ant dir="validator" inheritRefs="true" target="test"/>
+    <ant dir="adapters" inheritRefs="true" target="test"/>
+    <ant dir="rhq" inheritRefs="true" target="test"/>
+  </target>
+  
+  <!-- ================================= 
+       Target: one-test
+       ================================= -->
+  <target name="one-test" depends="jars">
+    <condition property="module" else="core">
+      <equals arg1="${module}" arg2="" trim="true"/> 
+    </condition>
+
+    <ant dir="${module}" inheritRefs="true" target="one-test"/>
+  </target>
+
+  <!-- ================================= 
+       Target: module-test
+       ================================= -->
+  <target name="module-test" depends="jars">
+    <condition property="module" else="core">
+      <equals arg1="${module}" arg2="" trim="true"/> 
+    </condition>
+  	
+    <ant dir="${module}" inheritRefs="true" target="test"/>
+  </target>
+
+  <!-- ================================= 
+       Target: artifacts
+       ================================= -->
+  <target name="artifacts" depends="resolve">
+    <ant dir="api" inheritRefs="true" target="artifacts"/>
+    <ant dir="common" inheritRefs="true" target="artifacts"/>
+    <ant dir="core" inheritRefs="true" target="artifacts"/>
+    <ant dir="validator" inheritRefs="true" target="artifacts"/>
+    <ant dir="deployers" inheritRefs="true" target="artifacts"/>
+    <ant dir="embedded" inheritRefs="true" target="artifacts"/>
+    <ant dir="codegenerator" inheritRefs="true" target="artifacts"/>
+    <ant dir="adapters" inheritRefs="true" target="artifacts"/>
+  </target>
+  
+  <!-- ================================= 
+       Target: sjc
+       ================================= -->
+  <target name="sjc" depends="jars">
+    <ant dir="sjc" inheritRefs="true" target="sjc"/>
+  </target>
+
+  <!-- ================================= 
+       Target: release
+       ================================= -->
+  <target name="release" depends="clean,sjc">
+    <delete dir="${build.dir}"/>
+
+    <mkdir dir="${build.dir}" />
+    <mkdir dir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}" />
+    <mkdir dir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc" />
+    <mkdir dir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc/spec" />
+
+    <ant dir="${doc.dir}/samples/helloworld" target="dist-clean" inheritRefs="false" inheritAll="false"/>
+
+    <ant dir="${doc.dir}/developerguide" target="pdf" inheritRefs="false" inheritAll="false"/>
+    <ant dir="${doc.dir}/userguide" target="pdf" inheritRefs="false" inheritAll="false"/>
+
+    <copy flatten="true" todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc">
+      <fileset dir="${target.dir}/docs">
+        <include name="**/*.pdf"/>
+      </fileset>
+    </copy>
+
+    <ant dir="sjc" inheritRefs="true" target="war"/>
+    <delete dir="${build.dir}/sjc"/>
+
+    <ant dir="api" inheritRefs="true" target="docs"/>
+    <move todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc/spec">
+      <fileset dir="${target.dir}/docs/spec">
+        <include name="**/*"/>
+      </fileset>
+    </move>
+    <delete dir="${build.dir}/api"/>
+
+    <copy todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}">
+      <fileset dir="${target.dir}/sjc"/>
+    </copy>
+    <chmod perm="755" type="file">
+      <fileset dir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}">
+        <include name="**/*.sh"/>
+      </fileset>
+    </chmod>
+
+    <delete dir="${build.dir}/docbook"/>
+
+    <zip destfile="${name}-${major}.${minor}.${patch}.${type}.zip"
+         basedir="${build.dir}"/>
+    
+    <tar destfile="${name}-${major}.${minor}.${patch}.${type}.tar"
+         basedir="${build.dir}"/>
+    
+    <gzip zipfile="${name}-${major}.${minor}.${patch}.${type}.tar.gz" 
+          src="${name}-${major}.${minor}.${patch}.${type}.tar"/>
+    
+    <delete file="${name}-${major}.${minor}.${patch}.${type}.tar"/>
+    
+  </target>
+
+  <!-- ================================= 
+       Target: checkstyle
+       ================================= -->
+  <target name="checkstyle" depends="jars">
+    <taskdef name="checkstyle"
+             classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"
+             classpathref="checkstyle.lib.path.id"/>
+
+    <mkdir dir="${reports.dir}/checkstyle" />
+
+    <checkstyle config="${tools.dir}/checkstyle/checkstyle.xml"
+                failOnViolation="false"
+                classpathref="checkstyle.lib.path.id">
+      <fileset dir="${basedir}">
+        <include name="**/*.java"/>
+        <exclude name="build/**/*.java"/>
+      </fileset>
+      <formatter type="plain"/>
+      <formatter type="xml" toFile="${reports.dir}/checkstyle/checkstyle-result.xml"/>
+    </checkstyle>
+  </target>
+
+  <!-- ================================= 
+       Target: findbugs
+       ================================= -->
+  <target name="findbugs" depends="jars">
+    <taskdef name="findbugs"
+             classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
+             classpathref="findbugs.lib.path.id"/>
+
+    <mkdir dir="${reports.dir}/findbugs" />
+
+    <findbugs home="${basedir}/tools/findbugs/lib/"
+              output="html"
+              outputFile="${reports.dir}/findbugs/findbugs.html" 
+              excludeFilter="${basedir}/tools/findbugs/filter.xml"
+              reportLevel="low">
+      <auxClasspath>
+        <fileset dir="${lib.dir}/common">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/embedded">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/arquillian">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/jetty">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/hornetq">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/sjc">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/mail">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/rhq">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/test">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/tools">
+          <include name="*.jar"/>
+        </fileset>
+      </auxClasspath>
+      <class location="${target.dir}/${name}-codegenerator.jar" />
+      <class location="${target.dir}/${name}-common-api.jar" />
+      <class location="${target.dir}/${name}-common-impl.jar" />
+      <class location="${target.dir}/${name}-common-impl-papaki.jar" />
+      <class location="${target.dir}/${name}-common-spi.jar" />
+      <class location="${target.dir}/${name}-core-api.jar" />
+      <class location="${target.dir}/${name}-core-impl.jar" />
+      <class location="${target.dir}/${name}-deployers-common.jar" />
+      <class location="${target.dir}/${name}-deployers-fungal.jar" />
+      <class location="${target.dir}/${name}-embedded.jar" />
+      <class location="${target.dir}/${name}-embedded-arquillian.jar" />
+      <class location="${target.dir}/${name}-rhq.jar" />
+      <class location="${target.dir}/${name}-sjc.jar" />
+      <class location="${target.dir}/${name}-spec-api.jar" />
+      <class location="${target.dir}/${name}-validator.jar" />
+      <class location="${target.dir}/${name}-validator-ant.jar" />
+      <class location="${target.dir}/${name}-validator-cli.jar" />
+      <class location="${target.dir}/${name}-validator-maven.jar" />
+      <class location="${target.dir}/${name}-web.jar" />
+      <class location="${target.dir}/${name}-web-console.jar" />
+    </findbugs>
+
+    <findbugs home="${basedir}/tools/findbugs/lib/"
+              output="xml:withMessages"
+              outputFile="${reports.dir}/findbugs/findbugs.xml" 
+              excludeFilter="${basedir}/tools/findbugs/filter.xml"
+              reportLevel="low">
+      <auxClasspath>
+        <fileset dir="${lib.dir}/common">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/embedded">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/arquillian">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/jetty">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/hornetq">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/sjc">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/mail">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/rhq">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/test">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}/tools">
+          <include name="*.jar"/>
+        </fileset>
+      </auxClasspath>
+      <class location="${target.dir}/${name}-codegenerator.jar" />
+      <class location="${target.dir}/${name}-common-api.jar" />
+      <class location="${target.dir}/${name}-common-impl.jar" />
+      <class location="${target.dir}/${name}-common-impl-papaki.jar" />
+      <class location="${target.dir}/${name}-common-spi.jar" />
+      <class location="${target.dir}/${name}-core-api.jar" />
+      <class location="${target.dir}/${name}-core-impl.jar" />
+      <class location="${target.dir}/${name}-deployers-common.jar" />
+      <class location="${target.dir}/${name}-deployers-fungal.jar" />
+      <class location="${target.dir}/${name}-embedded.jar" />
+      <class location="${target.dir}/${name}-embedded-arquillian.jar" />
+      <class location="${target.dir}/${name}-rhq.jar" />
+      <class location="${target.dir}/${name}-sjc.jar" />
+      <class location="${target.dir}/${name}-spec-api.jar" />
+      <class location="${target.dir}/${name}-validator.jar" />
+      <class location="${target.dir}/${name}-validator-ant.jar" />
+      <class location="${target.dir}/${name}-validator-cli.jar" />
+      <class location="${target.dir}/${name}-validator-maven.jar" />
+      <class location="${target.dir}/${name}-web.jar" />
+      <class location="${target.dir}/${name}-web-console.jar" />
+    </findbugs>
+  </target>
+
+  <!-- ================================= 
+       Target: cobertura
+       ================================= -->
+  <target name="cobertura" depends="prepare-test">
+    <taskdef resource="tasks.properties"
+             classpathref="cobertura.lib.path.id"/>
+
+    <mkdir dir="${reports.dir}/cobertura" />
+    <mkdir dir="${reports.dir}/cobertura/tests" />
+
+    <delete file="${reports.dir}/cobertura/cobertura.ser"/>
+    <delete dir="${build.dir}/instrumented"/>
+    
+    <mkdir dir="${build.dir}/instrumented" />
+    <copy todir="${build.dir}/instrumented">
+      <fileset dir="${target.dir}">
+        <include name="*.jar"/>
+      </fileset>
+    </copy>
+
+    <copy todir="${build.dir}/instrumented">
+      <fileset dir="${build.dir}/adapters">
+        <include name="*.jar"/>
+      </fileset>
+    </copy>
+
+    <cobertura-instrument todir="${build.dir}/instrumented"
+                          datafile="${reports.dir}/cobertura/cobertura.ser">
+      <fileset dir="${target.dir}">
+        <include name="ironjacamar*.jar" />
+      </fileset>
+    </cobertura-instrument>
+
+    <copy todir="${build.dir}/instrumented">
+      <fileset dir="${target.dir}">
+        <include name="${name}-core-api.jar"/>
+      </fileset>
+    </copy>
+
+    <junit dir="common/src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="yes"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
+      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
+      <sysproperty key="log4j.defaultInitOverride" value="true"/>
+
+      <classpath>
+        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
+        <pathelement location="${build.dir}/common/test"/>
+        <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}/jetty" includes="*.jar" />
+        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/mail" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+        <fileset dir="${lib.dir}/tools" includes="*.jar" />
+        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
+      </classpath>
+      <classpath refid="cobertura.lib.path.id" />
+      
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/cobertura/tests">
+        <fileset dir="${build.dir}/common/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+    </junit>
+
+    <junit dir="core/src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="yes"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
+      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
+      <sysproperty key="log4j.defaultInitOverride" value="true"/>
+
+      <classpath>
+        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
+        <pathelement location="${build.dir}/core/test"/>
+        <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}/jetty" includes="*.jar" />
+        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/mail" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+        <fileset dir="${lib.dir}/tools" includes="*.jar" />
+        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
+      </classpath>
+      <classpath refid="cobertura.lib.path.id" />
+      
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/cobertura/tests">
+        <fileset dir="${build.dir}/core/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+    </junit>
+
+    <junit dir="deployers/src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="yes"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="archives.dir" value="${build.dir}/deployers"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
+      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
+      <sysproperty key="log4j.defaultInitOverride" value="true"/>
+
+      <classpath>
+        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
+        <pathelement location="${build.dir}/deployers/test"/>
+        <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}/jetty" includes="*.jar" />
+        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/mail" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+        <fileset dir="${lib.dir}/tools" includes="*.jar" />
+        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
+      </classpath>
+      <classpath refid="cobertura.lib.path.id" />
+      
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/cobertura/tests">
+        <fileset dir="${build.dir}/deployers/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+    </junit>
+
+    <junit dir="embedded/src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="yes"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
+      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
+      <sysproperty key="log4j.defaultInitOverride" value="true"/>
+
+      <classpath>
+        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
+        <pathelement location="${build.dir}/embedded/test"/>
+        <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}/jetty" includes="*.jar" />
+        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/mail" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+        <fileset dir="${lib.dir}/tools" includes="*.jar" />
+        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
+      </classpath>
+      <classpath refid="cobertura.lib.path.id" />
+      
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/cobertura/tests">
+        <fileset dir="${build.dir}/embedded/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+    </junit>
+
+    <junit dir="validator/src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="yes"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
+      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
+      <sysproperty key="log4j.defaultInitOverride" value="true"/>
+
+      <classpath>
+        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
+        <pathelement location="${build.dir}/validator/test"/>
+        <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}/jetty" includes="*.jar" />
+        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/mail" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+        <fileset dir="${lib.dir}/tools" includes="*.jar" />
+        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
+      </classpath>
+      <classpath refid="cobertura.lib.path.id" />
+      
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/cobertura/tests">
+        <fileset dir="${build.dir}/validator/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+    </junit>
+
+    <junit dir="codegenerator/src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="yes"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
+      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
+      <sysproperty key="log4j.defaultInitOverride" value="true"/>
+
+      <classpath>
+        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
+        <pathelement location="${build.dir}/codegenerator/test"/>
+        <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}/jetty" includes="*.jar" />
+        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/mail" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+        <fileset dir="${lib.dir}/tools" includes="*.jar" />
+        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
+      </classpath>
+      <classpath refid="cobertura.lib.path.id" />
+      
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/cobertura/tests">
+        <fileset dir="${build.dir}/codegenerator/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+    </junit>
+
+    <junit dir="adapters/src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="yes"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="archives.dir" value="${build.dir}/adapters"/>
+      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
+      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
+      <sysproperty key="log4j.defaultInitOverride" value="true"/>
+
+      <classpath>
+        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
+        <pathelement location="${build.dir}/adapters/"/>
+        <pathelement location="${build.dir}/adapters/test"/>
+        <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}/jetty" includes="*.jar" />
+        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/mail" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+        <fileset dir="${lib.dir}/tools" includes="*.jar" />
+        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
+      </classpath>
+      <classpath refid="cobertura.lib.path.id" />
+      
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/cobertura/tests">
+        <fileset dir="${build.dir}/adapters/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+    </junit>
+
+    <junit dir="rhq/src/test"
+           printsummary="${junit.printsummary}"
+           haltonerror="${junit.haltonerror}"
+           haltonfailure="${junit.haltonfailure}"
+           fork="yes"
+           timeout="${junit.timeout}">
+      
+      <jvmarg line="${junit.jvm.options}"/>
+      <sysproperty key="test.dir" value="${test.dir}"/>
+      <sysproperty key="archives.dir" value="${build.dir}/rhq"/>
+      <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
+      <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
+      <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
+      <sysproperty key="log4j.defaultInitOverride" value="true"/>
+
+      <classpath>
+        <fileset dir="${build.dir}/instrumented" includes="*.jar" />
+        <pathelement location="${build.dir}/rhq/"/>
+        <pathelement location="${build.dir}/rhq/test"/>
+        <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}/jetty" includes="*.jar" />
+        <fileset dir="${lib.dir}/hornetq" includes="*.jar" />
+        <fileset dir="${lib.dir}/sjc" includes="*.jar" />
+        <fileset dir="${lib.dir}/mail" includes="*.jar" />
+        <fileset dir="${lib.dir}/test" includes="*.jar" />
+        <fileset dir="${lib.dir}/tools" includes="*.jar" />
+        <fileset dir="${lib.dir}/rhq" includes="*.jar" />
+      </classpath>
+      <classpath refid="cobertura.lib.path.id" />
+      
+      <formatter type="xml"/>
+      
+      <batchtest todir="${reports.dir}/cobertura/tests">
+        <fileset dir="${build.dir}/rhq/test">
+          <include name="**/*TestCase.class"/>
+        </fileset>
+      </batchtest>
+    </junit>
+
+    <cobertura-report format="html" 
+                      destdir="${reports.dir}/cobertura/html" 
+                      datafile="${reports.dir}/cobertura/cobertura.ser">
+      <fileset dir="api/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="adapters/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="codegenerator/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="common/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="core/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="deployers/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="embedded/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="sjc/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="validator/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="web/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="rhq/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+    </cobertura-report>
+
+    <cobertura-report format="xml" 
+                      destdir="${reports.dir}/cobertura/xml" 
+                      datafile="${reports.dir}/cobertura/cobertura.ser">
+      <fileset dir="api/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="adapters/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="codegenerator/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="common/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="core/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="deployers/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="embedded/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="sjc/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="validator/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="web/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+      <fileset dir="rhq/src/main/java">
+        <include name="**/*.java" />
+      </fileset>
+    </cobertura-report>
+  </target>
+
+  <!-- ================================= 
+       Target: tattletale
+       ================================= -->
+  <target name="tattletale" depends="sjc">
+    <taskdef name="report"
+             classname="org.jboss.tattletale.ant.ReportTask"
+             classpathref="tattletale.lib.path.id"/>
+
+    <mkdir dir="${reports.dir}/tattletale"/>
+
+    <report source="${target.dir}/sjc"
+            destination="${reports.dir}/tattletale"
+            configuration="${tools.dir}/tattletale/configuration.properties"
+            filter="${tools.dir}/tattletale/filter.properties"
+            profiles="java6"/>
+  </target>
+
+  <!-- ================================= 
+       Target: clean              
+       ================================= -->
+  <target name="clean">
+    <delete>
+      <fileset dir="${basedir}" defaultexcludes="no">
+        <include name="**/*~"/>
+        <include name="**/*.bak"/>
+      </fileset>
+    </delete>
+    <delete>
+      <fileset dir="${lib.dir}" includes="**/*.jar"/>
+    </delete>
+    <delete dir="${build.dir}"/>
+    <delete dir="${target.dir}"/>
+    <delete dir="${reports.dir}"/>
+    <delete file="${name}-${major}.${minor}.${patch}.${type}.zip" />
+    <delete file="${name}-${major}.${minor}.${patch}.${type}.tar.gz" />
+
+    <ant antfile="tools/docant/build.xml" target="clean" inheritrefs="false" inheritAll="false"/>
+    <delete dir="${doc.dir}/target"/>
+  </target>
+  
+  <!-- ================================= 
+       Target: clean-cache              
+       ================================= -->
+  <target name="clean-cache">
+    <ivy:cleancache />
+  </target>
+
+  <!-- ================================= 
+       Target: nexus
+       ================================= -->
+  <macrodef name="deploy-file">
+    <attribute name="file"/>
+    <attribute name="artifact"/>
+    <attribute name="extension"/>
+    <sequential>
+      <concat destfile="${target.dir}/@{file}" append="true" force="true" eol="unix">
+mvn -s ${mavensettings} org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file -Dfile=$PWD/@{artifact}.@{extension} -DpomFile=@{artifact}.xml -Dsources=$PWD/@{artifact}-sources.jar -Djavadoc=$PWD/@{artifact}-javadoc.jar $REPOSITORY
+</concat>
+    </sequential>
+  </macrodef>
+
+  <macrodef name="install-file">
+    <attribute name="file"/>
+    <attribute name="artifact"/>
+    <attribute name="extension"/>
+    <sequential>
+      <concat destfile="${target.dir}/@{file}" append="true" force="true" eol="unix">
+mvn install:install-file -Dfile=$PWD/@{artifact}.@{extension} -DpomFile=@{artifact}.xml -Dsources=$PWD/@{artifact}-sources.jar -Djavadoc=$PWD/@{artifact}-javadoc.jar
+</concat>
+    </sequential>
+  </macrodef>
+
+  <target name="nexus" depends="clean,artifacts">
+    <fail message="IronJacamar doesn't support JDK 7+ artifacts" if="HAVE_JDK_1.7"/>
+  
+    <ivy:retrieve pattern="${lib.dir}/[conf]/[artifact].[ext]" 
+                  conf="${name}-codegenerator,${name}-common-api,${name}-common-impl,${name}-common-impl-papaki,${name}-common-spi,${name}-core-api,${name}-core-impl,${name}-deployers-common,${name}-deployers-fungal,${name}-embedded,${name}-embedded-arquillian,${name}-spec-api,${name}-validator,${name}-validator-ant,${name}-validator-cli,jdbc-local,jdbc-xa,mail"
+                  sync="true"/>
+
+    <delete file="${target.dir}/deploy.sh"/>
+    <delete file="${target.dir}/install.sh"/>
+
+    <concat destfile="${target.dir}/deploy.sh" append="true" force="true" eol="unix">#!/bin/sh
+PWD=`pwd`
+VERSION=${version}
+REPOSITORY='-Durl=${repositoryurl} -DrepositoryId=${repositoryid}'
+</concat>
+
+    <concat destfile="${target.dir}/install.sh" append="true" force="true" eol="unix">#!/bin/sh
+PWD=`pwd`
+VERSION=${version}
+</concat>
+
+    <!-- ironjacamar-codegenerator -->
+    <delete file="${target.dir}/${name}-codegenerator.xml"/>
+    <ivy:makepom artifactName="${name}-codegenerator" 
+                 conf="${name}-codegenerator"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-codegenerator.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-codegenerator" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-codegenerator" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-codegenerator" extension="jar"/>
+
+    <!-- ironjacamar-common-api -->
+    <delete file="${target.dir}/${name}-common-api.xml"/>
+    <ivy:makepom artifactName="${name}-common-api" 
+                 conf="${name}-common-api"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-common-api.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-common-api" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-common-api" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-common-api" extension="jar"/>
+
+    <!-- ironjacamar-common-impl -->
+    <delete file="${target.dir}/${name}-common-impl.xml"/>
+    <ivy:makepom artifactName="${name}-common-impl" 
+                 conf="${name}-common-impl"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-common-impl.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-common-impl" scope="runtime"/>
+      <dependency artifact="${name}-common-api" scope="runtime"/>
+      <dependency artifact="${name}-common-spi" scope="runtime"/>
+      <dependency artifact="${name}-spec-api" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-common-impl" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-common-impl" extension="jar"/>
+
+    <!-- ironjacamar-common-impl-papaki -->
+    <delete file="${target.dir}/${name}-common-impl-papaki.xml"/>
+    <ivy:makepom artifactName="${name}-common-impl-papaki" 
+                 conf="${name}-common-impl-papaki"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-common-impl-papaki.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-common-impl-papaki" scope="runtime"/>
+      <dependency artifact="${name}-common-spi" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-common-impl-papaki" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-common-impl-papaki" extension="jar"/>
+
+    <!-- ironjacamar-common-spi -->
+    <delete file="${target.dir}/${name}-common-spi.xml"/>
+    <ivy:makepom artifactName="${name}-common-spi" 
+                 conf="${name}-common-spi"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-common-spi.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-common-spi" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-common-spi" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-common-spi" extension="jar"/>
+
+    <!-- ironjacamar-core-api -->
+    <delete file="${target.dir}/${name}-core-api.xml"/>
+    <ivy:makepom artifactName="${name}-core-api" 
+                 conf="${name}-core-api"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-core-api.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-core-api" scope="runtime"/>
+      <dependency artifact="${name}-spec-api" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-core-api" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-core-api" extension="jar"/>
+
+    <!-- ironjacamar-core-impl -->
+    <delete file="${target.dir}/${name}-core-impl.xml"/>
+    <ivy:makepom artifactName="${name}-core-impl" 
+                 conf="${name}-core-impl"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-core-impl.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-core-impl" scope="runtime"/>
+      <dependency artifact="${name}-common-impl" scope="runtime"/>
+      <dependency artifact="${name}-core-api" scope="runtime"/>
+      <dependency artifact="${name}-spec-api" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-core-impl" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-core-impl" extension="jar"/>
+
+    <!-- ironjacamar-depchain -->
+    <delete file="${target.dir}/${name}-depchain.xml"/>
+    <ivy:makepom artifactName="${name}-depchain" 
+                 conf="${name}-depchain"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-depchain.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-depchain" scope="runtime"/>
+    </ivy:makepom>
+
+    <concat destfile="${target.dir}/deploy.sh" append="true" force="true" eol="unix">
+mvn -s ${mavensettings} org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file -Dfile=$PWD/${name}-depchain.xml -DpomFile=${name}-depchain.xml $REPOSITORY
+</concat>
+<concat destfile="${target.dir}/install.sh" append="true" force="true" eol="unix">
+mvn install:install-file -Dfile=$PWD/${name}-depchain.xml -DpomFile=${name}-depchain.xml -DuniqueVersion=false $REPOSITORY
+</concat>
+
+    <!-- ironjacamar-deployers-common -->
+    <delete file="${target.dir}/${name}-deployers-common.xml"/>
+    <ivy:makepom artifactName="${name}-deployers-common" 
+                 conf="${name}-deployers-common"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-deployers-common.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-deployers-common" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-deployers-common" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-deployers-common" extension="jar"/>
+
+    <!-- ironjacamar-deployers-fungal -->
+    <delete file="${target.dir}/${name}-deployers-fungal.xml"/>
+    <ivy:makepom artifactName="${name}-deployers-fungal" 
+                 conf="${name}-deployers-fungal"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-deployers-fungal.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-deployers-fungal" scope="runtime"/>
+      <dependency artifact="${name}-common-impl" scope="runtime"/>
+      <dependency artifact="${name}-core-api" scope="runtime"/>
+      <dependency artifact="${name}-core-impl" scope="runtime"/>
+      <dependency artifact="${name}-spec-api" scope="runtime"/>
+      <dependency artifact="${name}-validator" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-deployers-fungal" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-deployers-fungal" extension="jar"/>
+
+    <!-- ironjacamar-embedded -->
+    <delete file="${target.dir}/${name}-embedded.xml"/>
+    <ivy:makepom artifactName="${name}-embedded" 
+                 conf="${name}-embedded"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-embedded.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-embedded" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-embedded" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-embedded" extension="jar"/>
+
+    <!-- ironjacamar-embedded-arquillian -->
+    <delete file="${target.dir}/${name}-embedded-arquillian.xml"/>
+    <ivy:makepom artifactName="${name}-embedded-arquillian" 
+                 conf="${name}-embedded-arquillian"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-embedded-arquillian.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-embedded-arquillian" scope="runtime"/>
+      <dependency artifact="${name}-embedded" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-embedded-arquillian" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-embedded-arquillian" extension="jar"/>
+
+    <!-- ironjacamar-spec-api -->
+    <delete file="${target.dir}/${name}-spec-api.xml"/>
+    <ivy:makepom artifactName="${name}-spec-api" 
+                 conf="${name}-spec-api"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-spec-api.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-spec-api" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-spec-api" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-spec-api" extension="jar"/>
+
+    <!-- ironjacamar-validator -->
+    <delete file="${target.dir}/${name}-validator.xml"/>
+    <ivy:makepom artifactName="${name}-validator" 
+                 conf="${name}-validator"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-validator.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-validator" scope="runtime"/>
+      <dependency artifact="${name}-common-api" scope="runtime"/>
+      <dependency artifact="${name}-common-impl" scope="runtime"/>
+      <dependency artifact="${name}-common-spi" scope="runtime"/>
+      <dependency artifact="${name}-spec-api" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-validator" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-validator" extension="jar"/>
+
+    <!-- ironjacamar-validator-ant -->
+    <delete file="${target.dir}/${name}-validator-ant.xml"/>
+    <ivy:makepom artifactName="${name}-validator-ant" 
+                 conf="${name}-validator-ant"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-validator-ant.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-validator-ant" scope="runtime"/>
+      <dependency artifact="${name}-validator" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-validator-ant" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-validator" extension="jar"/>
+
+    <!-- ironjacamar-validator-cli -->
+    <delete file="${target.dir}/${name}-validator-cli.xml"/>
+    <ivy:makepom artifactName="${name}-validator-cli" 
+                 conf="${name}-validator-cli"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-validator-cli.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-validator-cli" scope="runtime"/>
+      <dependency artifact="${name}-validator" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-validator-cli" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-validator-cli" extension="jar"/>
+
+    <!-- ironjacamar-validator-maven -->
+    <delete file="${target.dir}/${name}-validator-maven.xml"/>
+    <ivy:makepom artifactName="${name}-validator-maven" 
+                 conf="${name}-validator-maven"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/${name}-validator-maven.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="${name}-validator-maven" scope="runtime"/>
+      <dependency artifact="${name}-validator" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-validator-maven" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-validator-maven" extension="jar"/>
+
+    <!-- ironjacamar-jdbc -->
+    <delete file="${target.dir}/${name}-jdbc.xml"/>
+    <ivy:makepom artifactName="${name}-jdbc" 
+                conf="${name}-jdbc"
+                ivyfile="${basedir}/ivy.xml" 
+                pomfile="${target.dir}/${name}-jdbc.xml"
+                headerFile="${tools.dir}/mvn/HEADER"
+                templatefile="${tools.dir}/mvn/pom.template"
+                printIvyInfo="false">
+      <mapping conf="${name}-jdbc" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="${name}-jdbc" extension="jar"/>
+    <install-file file="install.sh" artifact="${name}-jdbc" extension="jar"/>
+  	
+    <!-- jdbc-local -->
+    <delete file="${target.dir}/jdbc-local.xml"/>
+    <ivy:makepom artifactName="jdbc-local" 
+                 conf="jdbc-local"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/jdbc-local.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="jdbc-local" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="jdbc-local" extension="rar"/>
+    <install-file file="install.sh" artifact="jdbc-local" extension="rar"/>
+
+    <!-- jdbc-xa -->
+    <delete file="${target.dir}/jdbc-xa.xml"/>
+    <ivy:makepom artifactName="jdbc-xa" 
+                 conf="jdbc-xa"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/jdbc-xa.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="jdbc-xa" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="jdbc-xa" extension="rar"/>
+    <install-file file="install.sh" artifact="jdbc-xa" extension="rar"/>
+
+    <!-- mail -->
+    <delete file="${target.dir}/mail.xml"/>
+    <ivy:makepom artifactName="mail" 
+                 conf="mail"
+                 ivyfile="${basedir}/ivy.xml" 
+                 pomfile="${target.dir}/mail.xml"
+                 headerFile="${tools.dir}/mvn/HEADER"
+                 templatefile="${tools.dir}/mvn/pom.template"
+                 printIvyInfo="false">
+      <mapping conf="mail" scope="runtime"/>
+    </ivy:makepom>
+
+    <deploy-file file="deploy.sh" artifact="mail" extension="rar"/>
+    <install-file file="install.sh" artifact="mail" extension="rar"/>
+
+    <chmod file="${target.dir}/deploy.sh" perm="755"/>
+    <chmod file="${target.dir}/install.sh" perm="755"/>
+
+  </target>
+
+</project>

Deleted: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java	2011-06-10 14:17:48 UTC (rev 111581)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -1,345 +0,0 @@
-/*
- * 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.core.security;
-
-import org.jboss.jca.core.CoreLogger;
-import org.jboss.jca.core.spi.security.Callback;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.jboss.logging.Logger;
-
-/**
- * An user / role implementation based on property files
- * 
- * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
- * @version $Rev: 97162 $
- */
-public class UsersRoles implements Callback
-{
-   /** Serial version uid */
-   private static final long serialVersionUID = 1L;
-
-   /** Log instance */
-   private static CoreLogger log = Logger.getMessageLogger(CoreLogger.class, UsersRoles.class.getName());
-
-   /** Trace */
-   private static boolean trace = log.isTraceEnabled();
-
-   /** Default users.properties file name */
-   private static final String DEFAULT_USERS_PROPERTIES = "users.properties";
-
-   /** Default roles.properties file name */
-   private static final String DEFAULT_ROLES_PROPERTIES = "roles.properties";
-
-   /** The users map */
-   private Map<String, String> users;
-
-   /** The roles map */
-   private Map<String, Set<String>> roles;
-
-   /** users.properties name */
-   private String usersProperties;
-
-   /** roles.properties name */
-   private String rolesProperties;
-
-   /**
-    * Constructor
-    */
-   public UsersRoles()
-   {
-      users = new HashMap<String, String>();
-      roles = new HashMap<String, Set<String>>();
-      usersProperties = null;
-      rolesProperties = null;
-   }
-
-   /**
-    * Get the users.properties file name
-    * @return The value
-    */
-   public String getUsersProperties()
-   {
-      return usersProperties;
-   }
-
-   /**
-    * Set the users.properties file name
-    * @param value The value
-    */
-   public void setUsersProperties(String value)
-   {
-      usersProperties = value;
-   }
-
-   /**
-    * Get the roles.properties file name
-    * @return The value
-    */
-   public String getRolesProperties()
-   {
-      return rolesProperties;
-   }
-
-   /**
-    * Set the roles.properties file name
-    * @param value The value
-    */
-   public void setRolesProperties(String value)
-   {
-      rolesProperties = value;
-   }
-
-   /**
-    * Get the users
-    * @return A set of user names
-    */
-   public Set<String> getUsers()
-   {
-      Set<String> s = users.keySet();
-      
-      if (s != null)
-         return Collections.unmodifiableSet(s);
-
-      return null;
-   }
-
-   /**
-    * Get the credential for an user
-    * @param user The user name
-    * @return The credential; <code>null</code> if user doesn't exists
-    */
-   public char[] getCredential(String user)
-   {
-      String pwd = users.get(user);
-
-      if (pwd != null)
-         return pwd.toCharArray();
-
-      return null;
-   }
-
-   /**
-    * Get the roles for an user
-    * @param user The user name
-    * @return A set of roles; <code>null</code> if user doesn't exists
-    */
-   public String[] getRoles(String user)
-   {
-      Set<String> s = roles.get(user);
-
-      if (s != null)
-      {
-         String[] result = new String[s.size()];
-         return s.toArray(result);
-      }
-
-      return null;
-   }
-
-   /**
-    * Start
-    * @exception Throwable Thrown if an error occurs
-    */
-   public void start() throws Throwable
-   {
-      InputStream is = null;
-
-      try
-      {
-         if (usersProperties != null)
-         {
-            File f = new File(usersProperties);
-
-            if (f.exists())
-            {
-               if (trace)
-                  log.trace("users.properties: Using file: " + usersProperties);
-
-               is = new FileInputStream(f);
-            }
-         }
-
-         if (is == null)
-         {
-            if (trace)
-               log.trace("users.properties: Using classloader");
-
-            is = SecurityActions.getResourceAsStream(DEFAULT_USERS_PROPERTIES);
-         }
-
-         if (is != null)
-         {
-            Properties p = new Properties();
-            p.load(is);
-            
-            Set<?> keys = p.keySet();
-            if (keys != null && keys.size() > 0)
-            {
-               Iterator it = keys.iterator();
-               while (it.hasNext())
-               {
-                  String user = (String)it.next();
-
-                  if (log.isDebugEnabled())
-                     log.debug("Adding user: " + user);
-
-                  users.put(user, p.getProperty(user));
-               }
-            }
-            else
-            {
-               if (log.isDebugEnabled())
-                  log.debug("Empty users.properties file");
-            }
-         }
-         else
-         {
-            log.noUsersPropertiesFound();
-         }
-      }
-      catch (IOException ioe)
-      {
-         log.errorWhileLoadingUsersProperties(ioe);
-      }
-      finally
-      {
-         if (is != null)
-         {
-            try
-            {
-               is.close();
-            }
-            catch (IOException ignore)
-            {
-               // Ignore
-            }
-         }
-      }
-
-      is = null;
-
-      try
-      {
-         if (rolesProperties != null)
-         {
-            File f = new File(rolesProperties);
-
-            if (f.exists())
-            {
-               if (trace)
-                  log.trace("roles.properties: Using file: " + rolesProperties);
-
-               is = new FileInputStream(f);
-            }
-         }
-
-         if (is == null)
-         {
-            if (trace)
-               log.trace("roles.properties: Using classloader");
-
-            is = SecurityActions.getResourceAsStream(DEFAULT_ROLES_PROPERTIES);
-         }
-
-         if (is != null)
-         {
-            Properties p = new Properties();
-            p.load(is);
-            
-            Set<?> keys = p.keySet();
-            if (keys != null && keys.size() > 0)
-            {
-               Iterator it = keys.iterator();
-               while (it.hasNext())
-               {
-                  String user = (String)it.next();
-                  String value = p.getProperty(user);
-
-                  StringTokenizer st = new StringTokenizer(value, ",");
-                  Set<String> s = new HashSet<String>(st.countTokens());
-                  
-                  while (st.hasMoreTokens())
-                  {
-                     s.add(st.nextToken().trim());
-                  }
-
-                  if (log.isDebugEnabled())
-                     log.debug("Adding roles: " + s + " for user: " + user);
-
-                  roles.put(user, s);
-               }
-            }
-            else
-            {
-               if (log.isDebugEnabled())
-                  log.debug("Empty roles.properties file");
-            }
-         }
-         else
-         {
-            log.noRolesPropertiesFound();
-         }
-      }
-      catch (IOException ioe)
-      {
-         log.errorWhileLoadingRolesProperties(ioe);
-      }
-      finally
-      {
-         if (is != null)
-         {
-            try
-            {
-               is.close();
-            }
-            catch (IOException ignore)
-            {
-               // Ignore
-            }
-         }
-      }
-   }
-
-   /**
-    * Stop
-    * @exception Throwable Thrown if an error occurs
-    */
-   public void stop() throws Throwable
-   {
-      users.clear();
-      roles.clear();
-   }
-}

Copied: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java (from rev 111583, projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java)
===================================================================
--- projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java	                        (rev 0)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/security/UsersRoles.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -0,0 +1,367 @@
+/*
+ * 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.core.security;
+
+import org.jboss.jca.core.CoreLogger;
+import org.jboss.jca.core.spi.security.Callback;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.jboss.logging.Logger;
+
+/**
+ * An user / role implementation based on property files
+ * 
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Rev: 97162 $
+ */
+public class UsersRoles implements Callback
+{
+   /** Serial version uid */
+   private static final long serialVersionUID = 1L;
+
+   /** Log instance */
+   private static CoreLogger log = Logger.getMessageLogger(CoreLogger.class, UsersRoles.class.getName());
+
+   /** Trace */
+   private static boolean trace = log.isTraceEnabled();
+
+   /** Default users.properties file name */
+   private static final String DEFAULT_USERS_PROPERTIES = "users.properties";
+
+   /** Default roles.properties file name */
+   private static final String DEFAULT_ROLES_PROPERTIES = "roles.properties";
+
+   /** The users map */
+   private Map<String, String> users;
+
+   /** The roles map */
+   private Map<String, Set<String>> roles;
+
+   /** users.properties name */
+   private String usersProperties;
+
+   /** roles.properties name */
+   private String rolesProperties;
+
+   /** The domain */
+   private String domain;
+
+   /**
+    * Constructor
+    */
+   public UsersRoles()
+   {
+      users = new HashMap<String, String>();
+      roles = new HashMap<String, Set<String>>();
+      usersProperties = null;
+      rolesProperties = null;
+      domain = "work";
+   }
+
+   /**
+    * Get the users.properties file name
+    * @return The value
+    */
+   public String getUsersProperties()
+   {
+      return usersProperties;
+   }
+
+   /**
+    * Set the users.properties file name
+    * @param value The value
+    */
+   public void setUsersProperties(String value)
+   {
+      usersProperties = value;
+   }
+
+   /**
+    * Get the roles.properties file name
+    * @return The value
+    */
+   public String getRolesProperties()
+   {
+      return rolesProperties;
+   }
+
+   /**
+    * Set the roles.properties file name
+    * @param value The value
+    */
+   public void setRolesProperties(String value)
+   {
+      rolesProperties = value;
+   }
+
+   /**
+    * Get the domain
+    * @return The value
+    */
+   public String getDomain()
+   {
+      return domain;
+   }
+
+   /**
+    * Set the domain
+    * @param v The value
+    */
+   public void setDomain(String v)
+   {
+      this.domain = v;
+   }
+
+   /**
+    * Get the users
+    * @return A set of user names
+    */
+   public Set<String> getUsers()
+   {
+      Set<String> s = users.keySet();
+      
+      if (s != null)
+         return Collections.unmodifiableSet(s);
+
+      return null;
+   }
+
+   /**
+    * Get the credential for an user
+    * @param user The user name
+    * @return The credential; <code>null</code> if user doesn't exists
+    */
+   public char[] getCredential(String user)
+   {
+      String pwd = users.get(user);
+
+      if (pwd != null)
+         return pwd.toCharArray();
+
+      return null;
+   }
+
+   /**
+    * Get the roles for an user
+    * @param user The user name
+    * @return A set of roles; <code>null</code> if user doesn't exists
+    */
+   public String[] getRoles(String user)
+   {
+      Set<String> s = roles.get(user);
+
+      if (s != null)
+      {
+         String[] result = new String[s.size()];
+         return s.toArray(result);
+      }
+
+      return null;
+   }
+
+   /**
+    * Start
+    * @exception Throwable Thrown if an error occurs
+    */
+   public void start() throws Throwable
+   {
+      InputStream is = null;
+
+      try
+      {
+         if (usersProperties != null)
+         {
+            File f = new File(usersProperties);
+
+            if (f.exists())
+            {
+               if (trace)
+                  log.trace("users.properties: Using file: " + usersProperties);
+
+               is = new FileInputStream(f);
+            }
+         }
+
+         if (is == null)
+         {
+            if (trace)
+               log.trace("users.properties: Using classloader");
+
+            is = SecurityActions.getResourceAsStream(DEFAULT_USERS_PROPERTIES);
+         }
+
+         if (is != null)
+         {
+            Properties p = new Properties();
+            p.load(is);
+            
+            Set<?> keys = p.keySet();
+            if (keys != null && keys.size() > 0)
+            {
+               Iterator it = keys.iterator();
+               while (it.hasNext())
+               {
+                  String user = (String)it.next();
+
+                  if (log.isDebugEnabled())
+                     log.debug("Adding user: " + user);
+
+                  users.put(user, p.getProperty(user));
+               }
+            }
+            else
+            {
+               if (log.isDebugEnabled())
+                  log.debug("Empty users.properties file");
+            }
+         }
+         else
+         {
+            log.noUsersPropertiesFound();
+         }
+      }
+      catch (IOException ioe)
+      {
+         log.errorWhileLoadingUsersProperties(ioe);
+      }
+      finally
+      {
+         if (is != null)
+         {
+            try
+            {
+               is.close();
+            }
+            catch (IOException ignore)
+            {
+               // Ignore
+            }
+         }
+      }
+
+      is = null;
+
+      try
+      {
+         if (rolesProperties != null)
+         {
+            File f = new File(rolesProperties);
+
+            if (f.exists())
+            {
+               if (trace)
+                  log.trace("roles.properties: Using file: " + rolesProperties);
+
+               is = new FileInputStream(f);
+            }
+         }
+
+         if (is == null)
+         {
+            if (trace)
+               log.trace("roles.properties: Using classloader");
+
+            is = SecurityActions.getResourceAsStream(DEFAULT_ROLES_PROPERTIES);
+         }
+
+         if (is != null)
+         {
+            Properties p = new Properties();
+            p.load(is);
+            
+            Set<?> keys = p.keySet();
+            if (keys != null && keys.size() > 0)
+            {
+               Iterator it = keys.iterator();
+               while (it.hasNext())
+               {
+                  String user = (String)it.next();
+                  String value = p.getProperty(user);
+
+                  StringTokenizer st = new StringTokenizer(value, ",");
+                  Set<String> s = new HashSet<String>(st.countTokens());
+                  
+                  while (st.hasMoreTokens())
+                  {
+                     s.add(st.nextToken().trim());
+                  }
+
+                  if (log.isDebugEnabled())
+                     log.debug("Adding roles: " + s + " for user: " + user);
+
+                  roles.put(user, s);
+               }
+            }
+            else
+            {
+               if (log.isDebugEnabled())
+                  log.debug("Empty roles.properties file");
+            }
+         }
+         else
+         {
+            log.noRolesPropertiesFound();
+         }
+      }
+      catch (IOException ioe)
+      {
+         log.errorWhileLoadingRolesProperties(ioe);
+      }
+      finally
+      {
+         if (is != null)
+         {
+            try
+            {
+               is.close();
+            }
+            catch (IOException ignore)
+            {
+               // Ignore
+            }
+         }
+      }
+   }
+
+   /**
+    * Stop
+    * @exception Throwable Thrown if an error occurs
+    */
+   public void stop() throws Throwable
+   {
+      users.clear();
+      roles.clear();
+   }
+}

Deleted: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java	2011-06-10 14:17:48 UTC (rev 111581)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -1,56 +0,0 @@
-/*
- * 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.core.spi.security;
-
-import java.io.Serializable;
-import java.util.Set;
-
-/**
- * This SPI interface represents the the users and their passwords and roles in
- * the container environment
- * 
- * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
- * @version $Rev: 97162 $
- */
-public interface Callback extends Serializable
-{
-   /**
-    * Get the users
-    * @return A set of user names
-    */
-   public Set<String> getUsers();
-
-   /**
-    * Get the credential for an user
-    * @param user The user name
-    * @return The credential; <code>null</code> if user doesn't exists
-    */
-   public char[] getCredential(String user);
-
-   /**
-    * Get the roles for an user
-    * @param user The user name
-    * @return A set of roles; <code>null</code> if user doesn't exists or no roles
-    */
-   public String[] getRoles(String user);
-}

Copied: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java (from rev 111583, projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java)
===================================================================
--- projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java	                        (rev 0)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/spi/security/Callback.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -0,0 +1,62 @@
+/*
+ * 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.core.spi.security;
+
+import java.io.Serializable;
+import java.util.Set;
+
+/**
+ * This SPI interface represents the the users and their passwords and roles in
+ * the container environment
+ * 
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Rev: 97162 $
+ */
+public interface Callback extends Serializable
+{
+   /**
+    * Get the domain
+    * @return The domain
+    */
+   public String getDomain();
+
+   /**
+    * Get the users
+    * @return A set of user names
+    */
+   public Set<String> getUsers();
+
+   /**
+    * Get the credential for an user
+    * @param user The user name
+    * @return The credential; <code>null</code> if user doesn't exists
+    */
+   public char[] getCredential(String user);
+
+   /**
+    * Get the roles for an user
+    * @param user The user name
+    * @return A set of roles; <code>null</code> if user doesn't exists or no roles
+    */
+   public String[] getRoles(String user);
+}

Copied: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/SecurityActions.java (from rev 111583, projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/workmanager/SecurityActions.java)
===================================================================
--- projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/SecurityActions.java	                        (rev 0)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/SecurityActions.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -0,0 +1,73 @@
+/*
+ * 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.core.workmanager;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Privileged Blocks
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+class SecurityActions
+{
+   /**
+    * Constructor
+    */
+   private SecurityActions()
+   {
+   }
+
+   /**
+    * Get the thread context class loader
+    * @return The class loader
+    */
+   static ClassLoader getThreadContextClassLoader()
+   {
+      return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+      {
+         @Override
+         public ClassLoader run()
+         {
+            return Thread.currentThread().getContextClassLoader();
+         }
+      });
+   }
+
+   /**
+    * Set the thread context class loader
+    * @param cl The class loader
+    */
+   static void setThreadContextClassLoader(final ClassLoader cl)
+   {
+      AccessController.doPrivileged(new PrivilegedAction<Object>()
+      {
+         @Override
+         public Object run()
+         {
+            Thread.currentThread().setContextClassLoader(cl);
+            return null;
+         }
+      });
+   }
+}

Deleted: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java	2011-06-10 14:17:48 UTC (rev 111581)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -1,876 +0,0 @@
-/*
- * 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.core.workmanager;
-
-import org.jboss.jca.core.CoreBundle;
-import org.jboss.jca.core.CoreLogger;
-import org.jboss.jca.core.api.workmanager.WorkManager;
-import org.jboss.jca.core.spi.security.Callback;
-import org.jboss.jca.core.spi.transaction.xa.XATerminator;
-
-import java.lang.reflect.Method;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.TimeUnit;
-
-import javax.resource.spi.work.ExecutionContext;
-import javax.resource.spi.work.HintsContext;
-import javax.resource.spi.work.SecurityContext;
-import javax.resource.spi.work.TransactionContext;
-import javax.resource.spi.work.Work;
-import javax.resource.spi.work.WorkCompletedException;
-import javax.resource.spi.work.WorkContext;
-import javax.resource.spi.work.WorkContextErrorCodes;
-import javax.resource.spi.work.WorkContextLifecycleListener;
-import javax.resource.spi.work.WorkContextProvider;
-import javax.resource.spi.work.WorkEvent;
-import javax.resource.spi.work.WorkException;
-import javax.resource.spi.work.WorkListener;
-import javax.resource.spi.work.WorkRejectedException;
-
-import org.jboss.logging.Logger;
-import org.jboss.logging.Messages;
-import org.jboss.threads.BlockingExecutor;
-import org.jboss.threads.ExecutionTimedOutException;
-
-/**
- * The work manager implementation.
- * 
- * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
- */
-public class WorkManagerImpl implements WorkManager
-{
-   /** The logger */
-   private static CoreLogger log = Logger.getMessageLogger(CoreLogger.class, WorkManagerImpl.class.getName());
-   
-   /** Whether trace is enabled */
-   private static boolean trace = log.isTraceEnabled();
-   
-   /** The bundle */
-   private static CoreBundle bundle = Messages.getBundle(CoreBundle.class);
-   
-   /**Work run method name*/
-   private static final String RUN_METHOD_NAME = "run";
-   
-   /**Work release method name*/
-   private static final String RELEASE_METHOD_NAME = "release";
-
-   /**Supported work context set*/
-   private static final Set<Class<? extends WorkContext>> SUPPORTED_WORK_CONTEXT_CLASSES = 
-       new HashSet<Class<? extends WorkContext>>(3); 
-
-   /** Running in spec compliant mode */
-   private boolean specCompliant;
-
-   /** The short running executor */
-   private BlockingExecutor shortRunningExecutor;
-
-   /** The long running executor */
-   private BlockingExecutor longRunningExecutor;
-
-   /** The XA terminator */
-   private XATerminator xaTerminator;
-
-   /** Validated work instances */
-   private Set<String> validatedWork;
-
-   /** Security module for callback */
-   private Callback callbackSecurity;
-
-   /**Default supported workcontext types*/
-   static
-   {
-      SUPPORTED_WORK_CONTEXT_CLASSES.add(TransactionContext.class);
-      SUPPORTED_WORK_CONTEXT_CLASSES.add(SecurityContext.class);
-      SUPPORTED_WORK_CONTEXT_CLASSES.add(HintsContext.class);
-   }
-   
-   /**
-    * Constructor - by default the WorkManager is running in spec-compliant mode
-    */
-   public WorkManagerImpl()
-   {
-      specCompliant = true;
-      validatedWork = new HashSet<String>();
-   }
-   
-   /**
-    * Retrieve the executor for short running tasks
-    * @return The executor
-    */
-   public BlockingExecutor getShortRunningThreadPool()
-   {
-      return shortRunningExecutor;
-   }
-
-   /**
-    * Set the executor for short running tasks
-    * @param executor The executor
-    */
-   public void setShortRunningThreadPool(BlockingExecutor executor)
-   {
-      this.shortRunningExecutor = executor;
-   }
-
-   /**
-    * Retrieve the executor for long running tasks
-    * @return The executor
-    */
-   public BlockingExecutor getLongRunningThreadPool()
-   {
-      return longRunningExecutor;
-   }
-
-   /**
-    * Set the executor for long running tasks
-    * @param executor The executor
-    */
-   public void setLongRunningThreadPool(BlockingExecutor executor)
-   {
-      this.longRunningExecutor = executor;
-   }
-
-   /**
-    * Get the XATerminator
-    * @return The XA terminator
-    */
-   public XATerminator getXATerminator()
-   {
-      return xaTerminator;
-   }
-
-   /**
-    * Set the XATerminator
-    * @param xaTerminator The XA terminator
-    */
-   public void setXATerminator(XATerminator xaTerminator)
-   {
-      this.xaTerminator = xaTerminator;
-   }
-
-   /**
-    * Is spec compliant
-    * @return True if spec compliant; otherwise false
-    */
-   public boolean isSpecCompliant()
-   {
-      return specCompliant;
-   }
-
-   /**
-    * Set spec compliant flag
-    * @param v The value
-    */
-   public void setSpecCompliant(boolean v)
-   {
-      specCompliant = v;
-   }
-
-   /**
-    * Get the callback security module
-    * @return The value
-    */
-   public Callback getCallbackSecurity()
-   {
-      return callbackSecurity;
-   }
-
-   /**
-    * Set callback security module
-    * @param v The value
-    */
-   public void setCallbackSecurity(Callback v)
-   {
-      callbackSecurity = v;
-   }
-
-   /**
-    * Clone the WorkManager implementation
-    * @return A copy of the implementation
-    * @exception CloneNotSupportedException Thrown if the copy operation isn't supported
-    *  
-    */
-   public WorkManager clone() throws CloneNotSupportedException
-   {
-      WorkManager wm = (WorkManager)super.clone();
-      wm.setShortRunningThreadPool(getShortRunningThreadPool());
-      wm.setLongRunningThreadPool(getLongRunningThreadPool());
-      wm.setXATerminator(getXATerminator());
-      wm.setSpecCompliant(isSpecCompliant());
-      wm.setCallbackSecurity(getCallbackSecurity());
-      
-      return wm;
-   }
-
-   /**
-    * {@inheritDoc}
-    */
-   public void doWork(Work work) throws WorkException
-   {
-      doWork(work, WorkManager.INDEFINITE, null, null);
-   }
-   
-   /**
-    * {@inheritDoc}
-    */
-   public void doWork(Work work,
-                      long startTimeout, 
-                      ExecutionContext execContext, 
-                      WorkListener workListener) 
-      throws WorkException
-   {
-      if (trace)
-         log.tracef("doWork(%s, %s, %s, %s)", work, startTimeout, execContext, workListener);
-
-      WorkException exception = null;
-      WorkWrapper wrapper = null;
-      try
-      {
-         if (work == null)
-            throw new WorkRejectedException(bundle.workIsNull());
-
-         if (startTimeout < 0)
-            throw new WorkRejectedException(bundle.startTimeoutIsNegative(startTimeout));
-
-         checkAndVerifyWork(work, execContext);
-      
-         if (execContext == null)
-         {
-            execContext = new ExecutionContext();  
-         }
-
-         final CountDownLatch completedLatch = new CountDownLatch(1);
-
-         wrapper = new WorkWrapper(this, work, execContext, workListener, null, completedLatch);
-
-         setup(wrapper);
-
-         if (workListener != null)
-         {
-            WorkEvent event = new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null);
-            workListener.workAccepted(event);
-         }
-
-         BlockingExecutor executor = getExecutor(work);
-
-         if (startTimeout == WorkManager.INDEFINITE)
-         {
-            executor.executeBlocking(wrapper);
-         }
-         else
-         {
-            executor.executeBlocking(wrapper, startTimeout, TimeUnit.MILLISECONDS);
-         }
-
-         completedLatch.await();
-      }
-      catch (ExecutionTimedOutException etoe)
-      {
-         exception = new WorkRejectedException(etoe);
-         exception.setErrorCode(WorkRejectedException.START_TIMED_OUT);  
-      }
-      catch (RejectedExecutionException ree)
-      {
-         exception = new WorkRejectedException(ree);
-      }
-      catch (WorkException we)
-      {
-         exception = we;
-      }
-      catch (InterruptedException ie)
-      {
-         Thread.currentThread().interrupt();
-         exception = new WorkRejectedException(bundle.interruptedWhileRequestingPermit());
-      }
-      finally
-      {
-         if (exception != null)
-         {
-            if (workListener != null)
-            {
-               WorkEvent event = new WorkEvent(this, WorkEvent.WORK_REJECTED, work, exception);
-               workListener.workRejected(event);
-            }
-
-            throw exception;
-         }
-
-         if (wrapper != null)
-            checkWorkCompletionException(wrapper);
-      }
-   }
-   
-   /**
-    * {@inheritDoc}
-    */
-   public long startWork(Work work) throws WorkException
-   {
-      return startWork(work, WorkManager.INDEFINITE, null, null);
-   }
-   
-   /**
-    * {@inheritDoc}
-    */
-   public long startWork(Work work, 
-                         long startTimeout, 
-                         ExecutionContext execContext, 
-                         WorkListener workListener) 
-      throws WorkException
-   {
-      log.tracef("startWork(%s, %s, %s, %s)", work, startTimeout, execContext, workListener);
-
-      WorkException exception = null;
-      WorkWrapper wrapper = null;
-      try
-      {
-         if (work == null)
-            throw new WorkRejectedException(bundle.workIsNull());
-
-         if (startTimeout < 0)
-            throw new WorkRejectedException(bundle.startTimeoutIsNegative(startTimeout));
-
-         long started = System.currentTimeMillis();
-
-         checkAndVerifyWork(work, execContext);
-      
-         if (execContext == null)
-         {
-            execContext = new ExecutionContext();  
-         }
-
-         final CountDownLatch startedLatch = new CountDownLatch(1);
-
-         wrapper = new WorkWrapper(this, work, execContext, workListener, startedLatch, null);
-
-         setup(wrapper);
-
-         if (workListener != null)
-         {
-            WorkEvent event = new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null);
-            workListener.workAccepted(event);
-         }
-
-         BlockingExecutor executor = getExecutor(work);
-
-         if (startTimeout == WorkManager.INDEFINITE)
-         {
-            executor.executeBlocking(wrapper);
-         }
-         else
-         {
-            executor.executeBlocking(wrapper, startTimeout, TimeUnit.MILLISECONDS);
-         }
-
-         startedLatch.await();
-
-         return System.currentTimeMillis() - started;
-      }
-      catch (ExecutionTimedOutException etoe)
-      {
-         exception = new WorkRejectedException(etoe);
-         exception.setErrorCode(WorkRejectedException.START_TIMED_OUT);  
-      }
-      catch (RejectedExecutionException ree)
-      {
-         exception = new WorkRejectedException(ree);
-      }
-      catch (WorkException we)
-      {
-         exception = we;
-      }
-      catch (InterruptedException ie)
-      {
-         Thread.currentThread().interrupt();
-         exception = new WorkRejectedException(bundle.interruptedWhileRequestingPermit());
-      }
-      finally
-      {
-         if (exception != null)
-         {
-            if (workListener != null)
-            {
-               WorkEvent event = new WorkEvent(this, WorkEvent.WORK_REJECTED, work, exception);
-               workListener.workRejected(event);
-            }
-
-            throw exception;
-         }
-
-         if (wrapper != null)
-            checkWorkCompletionException(wrapper);
-      }
-
-      return WorkManager.UNKNOWN;
-   }
-   
-   /**
-    * {@inheritDoc}
-    */
-   public void scheduleWork(Work work) throws WorkException
-   {
-      scheduleWork(work, WorkManager.INDEFINITE, null, null);
-   }
-   
-   /**
-    * {@inheritDoc}
-    */
-   public void scheduleWork(Work work,
-                            long startTimeout, 
-                            ExecutionContext execContext, 
-                            WorkListener workListener) 
-      throws WorkException
-   {
-      log.tracef("scheduleWork(%s, %s, %s, %s)", work, startTimeout, execContext, workListener);
-
-      WorkException exception = null;
-      WorkWrapper wrapper = null;
-      try
-      {
-         if (work == null)
-            throw new WorkRejectedException(bundle.workIsNull());
-
-         if (startTimeout < 0)
-            throw new WorkRejectedException(bundle.startTimeoutIsNegative(startTimeout));
-
-         checkAndVerifyWork(work, execContext);
-      
-         if (execContext == null)
-         {
-            execContext = new ExecutionContext();  
-         }
-
-         wrapper = new WorkWrapper(this, work, execContext, workListener, null, null);
-
-         setup(wrapper);
-
-         if (workListener != null)
-         {
-            WorkEvent event = new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null);
-            workListener.workAccepted(event);
-         }
-
-         BlockingExecutor executor = getExecutor(work);
-
-         if (startTimeout == WorkManager.INDEFINITE)
-         {
-            executor.executeBlocking(wrapper);
-         }
-         else
-         {
-            executor.executeBlocking(wrapper, startTimeout, TimeUnit.MILLISECONDS);
-         }
-      }
-      catch (ExecutionTimedOutException etoe)
-      {
-         exception = new WorkRejectedException(etoe);
-         exception.setErrorCode(WorkRejectedException.START_TIMED_OUT);  
-      }
-      catch (RejectedExecutionException ree)
-      {
-         exception = new WorkRejectedException(ree);
-      }
-      catch (WorkException we)
-      {
-         exception = we;
-      }
-      catch (InterruptedException ie)
-      {
-         Thread.currentThread().interrupt();
-         exception = new WorkRejectedException(bundle.interruptedWhileRequestingPermit());
-      }
-      finally
-      {
-         if (exception != null)
-         {
-            if (workListener != null)
-            {
-               WorkEvent event = new WorkEvent(this, WorkEvent.WORK_REJECTED, work, exception);
-               workListener.workRejected(event);
-            }
-
-            throw exception;
-         }
-
-         if (wrapper != null)
-            checkWorkCompletionException(wrapper);
-      }
-   }
-
-   /**
-    * Get the executor
-    * @param work The work instance
-    * @return The executor
-    */
-   private BlockingExecutor getExecutor(Work work)
-   {
-      BlockingExecutor executor = shortRunningExecutor;
-      if (work instanceof WorkContextProvider)
-      {
-         WorkContextProvider wcProvider = (WorkContextProvider)work;
-         List<WorkContext> contexts = wcProvider.getWorkContexts();
-
-         if (contexts != null && contexts.size() > 0)
-         {
-            boolean found = false;
-            Iterator<WorkContext> it = contexts.iterator();
-            while (!found && it.hasNext())
-            {
-               WorkContext wc = it.next();
-               if (wc instanceof HintsContext)
-               {
-                  HintsContext hc = (HintsContext)wc;
-                  if (hc.getHints().containsKey(HintsContext.LONGRUNNING_HINT))
-                  {
-                     executor = longRunningExecutor;
-                     found = true;
-                  }
-               }
-            }
-         }
-      }
-
-      return executor;
-   }
-
-
-
-   /**
-    * Check and verify work before submitting.
-    * @param work the work instance
-    * @param executionContext any execution context that is passed by apadater
-    * @throws WorkException if any exception occurs
-    */
-   private void checkAndVerifyWork(Work work, ExecutionContext executionContext) throws WorkException
-   {
-      if (specCompliant)
-      {
-         verifyWork(work);  
-      }   
-      
-      if (work instanceof WorkContextProvider)
-      {
-          //Implements WorkContextProvider and not-null ExecutionContext
-         if (executionContext != null)
-         {
-            throw new WorkRejectedException(bundle.workExecutionContextMustNullImplementsWorkContextProvider());
-         }          
-      }      
-   }
-   
-   /**
-    * Verify the given work instance.
-    * @param work The work
-    * @throws WorkException Thrown if a spec compliant issue is found
-    */
-   private void verifyWork(Work work) throws WorkException
-   {     
-      if (!validatedWork.contains(work.getClass().getName()))
-      {
-         Class<?> workClass = work.getClass();
-         boolean result = false;
-      
-         result = verifyWorkMethods(workClass, RUN_METHOD_NAME, null, workClass.getName() + 
-                                    ": Run method is not defined");
-     
-         if (!result)
-         {
-            throw new WorkException(bundle.runMethodIsSynchronized(workClass.getName()));
-         }
-      
-         result = verifyWorkMethods(workClass, RELEASE_METHOD_NAME, null, workClass.getName() + 
-                                    ": Release method is not defined");
-      
-         if (!result)
-         {
-            throw new WorkException(bundle.releaseMethodIsSynchronized(workClass.getName()));
-         }
-
-         validatedWork.add(work.getClass().getName());
-      }
-   }
-   
-   private boolean verifyWorkMethods(Class<?> workClass, String methodName, 
-                                     Class<?>[] parameterTypes, String errorMessage) throws WorkException
-   {
-      Method method = null;
-      try
-      {
-         method = ClassUtil.getClassMethod(workClass, methodName, null);
-         
-         if (ClassUtil.modifiersHasSynchronizedKeyword(method.getModifiers()))
-         {
-            return false;  
-         }
-      }
-      catch (NoSuchMethodException nsme)
-      {
-         throw new WorkException(errorMessage);
-      }
-      
-      return true;
-   }
-
-   /**
-    * Checks work completed status. 
-    * @param wrapper work wrapper instance
-    * @throws {@link WorkException} if work is completed with an exception
-    */
-   private void checkWorkCompletionException(WorkWrapper wrapper) throws WorkException
-   {
-      if (wrapper.getWorkException() != null)
-      {
-         throw wrapper.getWorkException();  
-      }      
-   }
-
-   /**
-    * Setup work context's of the given work instance.
-    * 
-    * @param wrapper The work wrapper instance
-    * @throws WorkException if any exception occurs
-    */
-   private void setup(WorkWrapper wrapper) throws WorkException
-   {
-      if (trace)
-      {
-         log.trace("Setting up work contexts " + wrapper);  
-      }
-
-      Work work = wrapper.getWork();
-      
-      //If work is an instanceof WorkContextProvider
-      if (work instanceof WorkContextProvider)
-      {
-         WorkContextProvider wcProvider = (WorkContextProvider)work;
-         List<WorkContext> contexts = wcProvider.getWorkContexts();
-
-         if (contexts != null && contexts.size() > 0)
-         {
-            boolean isTransactionContext = false;
-            boolean isSecurityContext = false;
-            boolean isHintcontext = false;
-
-            for (WorkContext context : contexts)
-            {
-               Class<? extends WorkContext> contextType = null;
-
-               // Get supported work context class
-               contextType = getSupportedWorkContextClass(context.getClass());
-
-               // Not supported
-               if (contextType == null)
-               {
-                  if (trace)
-                  {
-                     log.trace("Not supported work context class : " + context.getClass().getName());
-                  }
-                  
-                  fireWorkContextSetupFailed(context, WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
-                  
-                  throw new WorkCompletedException(bundle.unsupportedWorkContextClass(context.getClass().getName()), 
-                      WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
-               }
-               // Duplicate checks
-               else
-               {
-                  // TransactionContext duplicate
-                  if (isTransactionContext(contextType))
-                  {
-                     if (isTransactionContext)
-                     {
-                        if (trace)
-                        {
-                           log.trace("Duplicate transaction work context : " + context.getClass().getName());
-                        }
-
-                        fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
-                        
-                        throw new WorkCompletedException(bundle.duplicateTransactionWorkContextClass(
-                              context.getClass().getName()), WorkContextErrorCodes.DUPLICATE_CONTEXTS);
-                     }
-                     else
-                     {
-                        isTransactionContext = true;
-                     }
-                  }
-                  // SecurityContext duplicate
-                  else if (isSecurityContext(contextType))
-                  {
-                     if (isSecurityContext)
-                     {
-                        if (trace)
-                        {
-                           log.trace("Duplicate security work context : " + context.getClass().getName());
-                        }
-                        
-                        fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
-
-                        throw new WorkCompletedException(bundle.duplicateSecurityWorkContextClass(
-                              context.getClass().getName()), WorkContextErrorCodes.DUPLICATE_CONTEXTS);
-                     }
-                     else
-                     {
-                        isSecurityContext = true;
-                     }
-                  }
-                  // HintContext duplicate
-                  else if (isHintContext(contextType))
-                  {
-                     if (isHintcontext)
-                     {
-                        if (trace)
-                        {
-                           log.trace("Duplicate hint work context : " + context.getClass().getName());
-                        }
-
-                        fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
-                        
-                        throw new WorkCompletedException(bundle.duplicateHintWorkContextClass(
-                              context.getClass().getName()), WorkContextErrorCodes.DUPLICATE_CONTEXTS);
-                     }
-                     else
-                     {
-                        isHintcontext = true;
-                     }
-                  }
-                  // Normally, this must not be happened!i just safe check!
-                  else
-                  {
-                     fireWorkContextSetupFailed(context, WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
-                     
-                     throw new WorkCompletedException(bundle.unsupportedWorkContextClass(context.getClass().getName()), 
-                                                      WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
-                  }
-               }
-
-               // Add workcontext instance to the work
-               wrapper.addWorkContext(contextType, context);
-            }
-         }         
-      }      
-
-      if (trace)
-      {
-         log.trace("Setted up work contexts " + wrapper);  
-      }      
-   }
-
-   /**
-    * Calls listener with given error code.
-    * @param listener work context listener
-    * @param errorCode error code
-    */
-   private void fireWorkContextSetupFailed(Object workContext, String errorCode)
-   {
-      if (workContext instanceof WorkContextLifecycleListener)
-      {
-         WorkContextLifecycleListener listener = (WorkContextLifecycleListener)workContext;
-         listener.contextSetupFailed(errorCode);   
-      }
-      
-   }
-
-   /**
-    * Returns true if contexts is a transaction context.
-    * 
-    * @param workContextType context type
-    * @return true if contexts is a transaction context
-    */
-   private boolean isTransactionContext(Class<? extends WorkContext> workContextType)
-   {
-      if (workContextType.isAssignableFrom(TransactionContext.class))
-      {
-         return true;
-      }
-
-      return false;
-   }
-
-   /**
-    * Returns true if contexts is a security context.
-    * 
-    * @param workContextType context type
-    * @return true if contexts is a security context
-    */
-   private boolean isSecurityContext(Class<? extends WorkContext> workContextType)
-   {
-      if (workContextType.isAssignableFrom(SecurityContext.class))
-      {
-         return true;
-      }
-
-      return false;
-   }
-
-   /**
-    * Returns true if contexts is a hint context.
-    * 
-    * @param workContextType context type
-    * @return true if contexts is a hint context
-    */
-   private boolean isHintContext(Class<? extends WorkContext> workContextType)
-   {
-      if (workContextType.isAssignableFrom(HintsContext.class))
-      {
-         return true;
-      }
-
-      return false;
-   }
-
-   /**
-    * Returns work context class if given work context is supported by server,
-    * returns null instance otherwise.
-    * 
-    * @param <T> work context class
-    * @param adaptorWorkContext adaptor supplied work context class
-    * @return work context class
-    */
-   @SuppressWarnings("unchecked")
-   private <T extends WorkContext> Class<T> getSupportedWorkContextClass(Class<T> adaptorWorkContext)
-   {
-      for (Class<? extends WorkContext> supportedWorkContext : SUPPORTED_WORK_CONTEXT_CLASSES)
-      {
-         // Assignable or not
-         if (adaptorWorkContext.isAssignableFrom(supportedWorkContext))
-         {
-            // Supported by the server
-            if (adaptorWorkContext.equals(supportedWorkContext))
-            {
-               return adaptorWorkContext;
-            }
-            else
-            {
-               // Fallback to super class
-               return (Class<T>) adaptorWorkContext.getSuperclass();
-            }
-         }
-      }
-
-      return null;
-   }
-}

Copied: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java (from rev 111583, projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java)
===================================================================
--- projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java	                        (rev 0)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkManagerImpl.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -0,0 +1,890 @@
+/*
+ * 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.core.workmanager;
+
+import org.jboss.jca.core.CoreBundle;
+import org.jboss.jca.core.CoreLogger;
+import org.jboss.jca.core.api.workmanager.WorkManager;
+import org.jboss.jca.core.spi.security.Callback;
+import org.jboss.jca.core.spi.transaction.xa.XATerminator;
+
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.TimeUnit;
+
+import javax.resource.spi.work.ExecutionContext;
+import javax.resource.spi.work.HintsContext;
+import javax.resource.spi.work.SecurityContext;
+import javax.resource.spi.work.TransactionContext;
+import javax.resource.spi.work.Work;
+import javax.resource.spi.work.WorkCompletedException;
+import javax.resource.spi.work.WorkContext;
+import javax.resource.spi.work.WorkContextErrorCodes;
+import javax.resource.spi.work.WorkContextLifecycleListener;
+import javax.resource.spi.work.WorkContextProvider;
+import javax.resource.spi.work.WorkEvent;
+import javax.resource.spi.work.WorkException;
+import javax.resource.spi.work.WorkListener;
+import javax.resource.spi.work.WorkRejectedException;
+
+import org.jboss.logging.Logger;
+import org.jboss.logging.Messages;
+import org.jboss.threads.BlockingExecutor;
+import org.jboss.threads.ExecutionTimedOutException;
+
+/**
+ * The work manager implementation.
+ * 
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class WorkManagerImpl implements WorkManager
+{
+   /** The logger */
+   private static CoreLogger log = Logger.getMessageLogger(CoreLogger.class, WorkManagerImpl.class.getName());
+   
+   /** Whether trace is enabled */
+   private static boolean trace = log.isTraceEnabled();
+   
+   /** The bundle */
+   private static CoreBundle bundle = Messages.getBundle(CoreBundle.class);
+   
+   /**Work run method name*/
+   private static final String RUN_METHOD_NAME = "run";
+   
+   /**Work release method name*/
+   private static final String RELEASE_METHOD_NAME = "release";
+
+   /**Supported work context set*/
+   private static final Set<Class<? extends WorkContext>> SUPPORTED_WORK_CONTEXT_CLASSES = 
+       new HashSet<Class<? extends WorkContext>>(3); 
+
+   /** Running in spec compliant mode */
+   private boolean specCompliant;
+
+   /** The short running executor */
+   private BlockingExecutor shortRunningExecutor;
+
+   /** The long running executor */
+   private BlockingExecutor longRunningExecutor;
+
+   /** The XA terminator */
+   private XATerminator xaTerminator;
+
+   /** Validated work instances */
+   private Set<String> validatedWork;
+
+   /** Security module for callback */
+   private Callback callbackSecurity;
+
+   /**Default supported workcontext types*/
+   static
+   {
+      SUPPORTED_WORK_CONTEXT_CLASSES.add(TransactionContext.class);
+      SUPPORTED_WORK_CONTEXT_CLASSES.add(SecurityContext.class);
+      SUPPORTED_WORK_CONTEXT_CLASSES.add(HintsContext.class);
+   }
+   
+   /**
+    * Constructor - by default the WorkManager is running in spec-compliant mode
+    */
+   public WorkManagerImpl()
+   {
+      specCompliant = true;
+      validatedWork = new HashSet<String>();
+   }
+   
+   /**
+    * Retrieve the executor for short running tasks
+    * @return The executor
+    */
+   public BlockingExecutor getShortRunningThreadPool()
+   {
+      return shortRunningExecutor;
+   }
+
+   /**
+    * Set the executor for short running tasks
+    * @param executor The executor
+    */
+   public void setShortRunningThreadPool(BlockingExecutor executor)
+   {
+      this.shortRunningExecutor = executor;
+   }
+
+   /**
+    * Retrieve the executor for long running tasks
+    * @return The executor
+    */
+   public BlockingExecutor getLongRunningThreadPool()
+   {
+      return longRunningExecutor;
+   }
+
+   /**
+    * Set the executor for long running tasks
+    * @param executor The executor
+    */
+   public void setLongRunningThreadPool(BlockingExecutor executor)
+   {
+      this.longRunningExecutor = executor;
+   }
+
+   /**
+    * Get the XATerminator
+    * @return The XA terminator
+    */
+   public XATerminator getXATerminator()
+   {
+      return xaTerminator;
+   }
+
+   /**
+    * Set the XATerminator
+    * @param xaTerminator The XA terminator
+    */
+   public void setXATerminator(XATerminator xaTerminator)
+   {
+      this.xaTerminator = xaTerminator;
+   }
+
+   /**
+    * Is spec compliant
+    * @return True if spec compliant; otherwise false
+    */
+   public boolean isSpecCompliant()
+   {
+      return specCompliant;
+   }
+
+   /**
+    * Set spec compliant flag
+    * @param v The value
+    */
+   public void setSpecCompliant(boolean v)
+   {
+      specCompliant = v;
+   }
+
+   /**
+    * Get the callback security module
+    * @return The value
+    */
+   public Callback getCallbackSecurity()
+   {
+      return callbackSecurity;
+   }
+
+   /**
+    * Set callback security module
+    * @param v The value
+    */
+   public void setCallbackSecurity(Callback v)
+   {
+      callbackSecurity = v;
+   }
+
+   /**
+    * Clone the WorkManager implementation
+    * @return A copy of the implementation
+    * @exception CloneNotSupportedException Thrown if the copy operation isn't supported
+    *  
+    */
+   public WorkManager clone() throws CloneNotSupportedException
+   {
+      WorkManager wm = (WorkManager)super.clone();
+      wm.setShortRunningThreadPool(getShortRunningThreadPool());
+      wm.setLongRunningThreadPool(getLongRunningThreadPool());
+      wm.setXATerminator(getXATerminator());
+      wm.setSpecCompliant(isSpecCompliant());
+      wm.setCallbackSecurity(getCallbackSecurity());
+      
+      return wm;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void doWork(Work work) throws WorkException
+   {
+      doWork(work, WorkManager.INDEFINITE, null, null);
+   }
+   
+   /**
+    * {@inheritDoc}
+    */
+   public void doWork(Work work,
+                      long startTimeout, 
+                      ExecutionContext execContext, 
+                      WorkListener workListener) 
+      throws WorkException
+   {
+      if (trace)
+         log.tracef("doWork(%s, %s, %s, %s)", work, startTimeout, execContext, workListener);
+
+      WorkException exception = null;
+      WorkWrapper wrapper = null;
+      try
+      {
+         if (work == null)
+            throw new WorkRejectedException(bundle.workIsNull());
+
+         if (startTimeout < 0)
+            throw new WorkRejectedException(bundle.startTimeoutIsNegative(startTimeout));
+
+         checkAndVerifyWork(work, execContext);
+      
+         if (execContext == null)
+         {
+            execContext = new ExecutionContext();  
+         }
+
+         final CountDownLatch completedLatch = new CountDownLatch(1);
+
+         wrapper = new WorkWrapper(this, work, execContext, workListener, null, completedLatch);
+
+         setup(wrapper);
+
+         if (workListener != null)
+         {
+            WorkEvent event = new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null);
+            workListener.workAccepted(event);
+         }
+
+         BlockingExecutor executor = getExecutor(work);
+
+         if (startTimeout == WorkManager.INDEFINITE)
+         {
+            executor.executeBlocking(wrapper);
+         }
+         else
+         {
+            executor.executeBlocking(wrapper, startTimeout, TimeUnit.MILLISECONDS);
+         }
+
+         completedLatch.await();
+      }
+      catch (ExecutionTimedOutException etoe)
+      {
+         exception = new WorkRejectedException(etoe);
+         exception.setErrorCode(WorkRejectedException.START_TIMED_OUT);  
+      }
+      catch (RejectedExecutionException ree)
+      {
+         exception = new WorkRejectedException(ree);
+      }
+      catch (WorkException we)
+      {
+         exception = we;
+      }
+      catch (InterruptedException ie)
+      {
+         Thread.currentThread().interrupt();
+         exception = new WorkRejectedException(bundle.interruptedWhileRequestingPermit());
+      }
+      finally
+      {
+         if (exception != null)
+         {
+            if (workListener != null)
+            {
+               WorkEvent event = new WorkEvent(this, WorkEvent.WORK_REJECTED, work, exception);
+               workListener.workRejected(event);
+            }
+
+            if (trace)
+               log.tracef("Exception %s for %s", exception, this);
+
+            throw exception;
+         }
+
+         if (wrapper != null)
+            checkWorkCompletionException(wrapper);
+      }
+   }
+   
+   /**
+    * {@inheritDoc}
+    */
+   public long startWork(Work work) throws WorkException
+   {
+      return startWork(work, WorkManager.INDEFINITE, null, null);
+   }
+   
+   /**
+    * {@inheritDoc}
+    */
+   public long startWork(Work work, 
+                         long startTimeout, 
+                         ExecutionContext execContext, 
+                         WorkListener workListener) 
+      throws WorkException
+   {
+      log.tracef("startWork(%s, %s, %s, %s)", work, startTimeout, execContext, workListener);
+
+      WorkException exception = null;
+      WorkWrapper wrapper = null;
+      try
+      {
+         if (work == null)
+            throw new WorkRejectedException(bundle.workIsNull());
+
+         if (startTimeout < 0)
+            throw new WorkRejectedException(bundle.startTimeoutIsNegative(startTimeout));
+
+         long started = System.currentTimeMillis();
+
+         checkAndVerifyWork(work, execContext);
+      
+         if (execContext == null)
+         {
+            execContext = new ExecutionContext();  
+         }
+
+         final CountDownLatch startedLatch = new CountDownLatch(1);
+
+         wrapper = new WorkWrapper(this, work, execContext, workListener, startedLatch, null);
+
+         setup(wrapper);
+
+         if (workListener != null)
+         {
+            WorkEvent event = new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null);
+            workListener.workAccepted(event);
+         }
+
+         BlockingExecutor executor = getExecutor(work);
+
+         if (startTimeout == WorkManager.INDEFINITE)
+         {
+            executor.executeBlocking(wrapper);
+         }
+         else
+         {
+            executor.executeBlocking(wrapper, startTimeout, TimeUnit.MILLISECONDS);
+         }
+
+         startedLatch.await();
+
+         return System.currentTimeMillis() - started;
+      }
+      catch (ExecutionTimedOutException etoe)
+      {
+         exception = new WorkRejectedException(etoe);
+         exception.setErrorCode(WorkRejectedException.START_TIMED_OUT);  
+      }
+      catch (RejectedExecutionException ree)
+      {
+         exception = new WorkRejectedException(ree);
+      }
+      catch (WorkException we)
+      {
+         exception = we;
+      }
+      catch (InterruptedException ie)
+      {
+         Thread.currentThread().interrupt();
+         exception = new WorkRejectedException(bundle.interruptedWhileRequestingPermit());
+      }
+      finally
+      {
+         if (exception != null)
+         {
+            if (workListener != null)
+            {
+               WorkEvent event = new WorkEvent(this, WorkEvent.WORK_REJECTED, work, exception);
+               workListener.workRejected(event);
+            }
+
+            if (trace)
+               log.tracef("Exception %s for %s", exception, this);
+
+            throw exception;
+         }
+
+         if (wrapper != null)
+            checkWorkCompletionException(wrapper);
+      }
+
+      return WorkManager.UNKNOWN;
+   }
+   
+   /**
+    * {@inheritDoc}
+    */
+   public void scheduleWork(Work work) throws WorkException
+   {
+      scheduleWork(work, WorkManager.INDEFINITE, null, null);
+   }
+   
+   /**
+    * {@inheritDoc}
+    */
+   public void scheduleWork(Work work,
+                            long startTimeout, 
+                            ExecutionContext execContext, 
+                            WorkListener workListener) 
+      throws WorkException
+   {
+      log.tracef("scheduleWork(%s, %s, %s, %s)", work, startTimeout, execContext, workListener);
+
+      WorkException exception = null;
+      WorkWrapper wrapper = null;
+      try
+      {
+         if (work == null)
+            throw new WorkRejectedException(bundle.workIsNull());
+
+         if (startTimeout < 0)
+            throw new WorkRejectedException(bundle.startTimeoutIsNegative(startTimeout));
+
+         checkAndVerifyWork(work, execContext);
+      
+         if (execContext == null)
+         {
+            execContext = new ExecutionContext();  
+         }
+
+         wrapper = new WorkWrapper(this, work, execContext, workListener, null, null);
+
+         setup(wrapper);
+
+         if (workListener != null)
+         {
+            WorkEvent event = new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null);
+            workListener.workAccepted(event);
+         }
+
+         BlockingExecutor executor = getExecutor(work);
+
+         if (startTimeout == WorkManager.INDEFINITE)
+         {
+            executor.executeBlocking(wrapper);
+         }
+         else
+         {
+            executor.executeBlocking(wrapper, startTimeout, TimeUnit.MILLISECONDS);
+         }
+      }
+      catch (ExecutionTimedOutException etoe)
+      {
+         exception = new WorkRejectedException(etoe);
+         exception.setErrorCode(WorkRejectedException.START_TIMED_OUT);  
+      }
+      catch (RejectedExecutionException ree)
+      {
+         exception = new WorkRejectedException(ree);
+      }
+      catch (WorkException we)
+      {
+         exception = we;
+      }
+      catch (InterruptedException ie)
+      {
+         Thread.currentThread().interrupt();
+         exception = new WorkRejectedException(bundle.interruptedWhileRequestingPermit());
+      }
+      finally
+      {
+         if (exception != null)
+         {
+            if (workListener != null)
+            {
+               WorkEvent event = new WorkEvent(this, WorkEvent.WORK_REJECTED, work, exception);
+               workListener.workRejected(event);
+            }
+
+            if (trace)
+               log.tracef("Exception %s for %s", exception, this);
+
+            throw exception;
+         }
+
+         if (wrapper != null)
+            checkWorkCompletionException(wrapper);
+      }
+   }
+
+   /**
+    * Get the executor
+    * @param work The work instance
+    * @return The executor
+    */
+   private BlockingExecutor getExecutor(Work work)
+   {
+      BlockingExecutor executor = shortRunningExecutor;
+      if (work instanceof WorkContextProvider)
+      {
+         WorkContextProvider wcProvider = (WorkContextProvider)work;
+         List<WorkContext> contexts = wcProvider.getWorkContexts();
+
+         if (contexts != null && contexts.size() > 0)
+         {
+            boolean found = false;
+            Iterator<WorkContext> it = contexts.iterator();
+            while (!found && it.hasNext())
+            {
+               WorkContext wc = it.next();
+               if (wc instanceof HintsContext)
+               {
+                  HintsContext hc = (HintsContext)wc;
+                  if (hc.getHints().containsKey(HintsContext.LONGRUNNING_HINT))
+                  {
+                     executor = longRunningExecutor;
+                     found = true;
+                  }
+               }
+            }
+         }
+      }
+
+      return executor;
+   }
+
+
+
+   /**
+    * Check and verify work before submitting.
+    * @param work the work instance
+    * @param executionContext any execution context that is passed by apadater
+    * @throws WorkException if any exception occurs
+    */
+   private void checkAndVerifyWork(Work work, ExecutionContext executionContext) throws WorkException
+   {
+      if (specCompliant)
+      {
+         verifyWork(work);  
+      }   
+      
+      if (work instanceof WorkContextProvider)
+      {
+          //Implements WorkContextProvider and not-null ExecutionContext
+         if (executionContext != null)
+         {
+            throw new WorkRejectedException(bundle.workExecutionContextMustNullImplementsWorkContextProvider());
+         }          
+      }      
+   }
+   
+   /**
+    * Verify the given work instance.
+    * @param work The work
+    * @throws WorkException Thrown if a spec compliant issue is found
+    */
+   private void verifyWork(Work work) throws WorkException
+   {     
+      if (!validatedWork.contains(work.getClass().getName()))
+      {
+         Class<?> workClass = work.getClass();
+         boolean result = false;
+      
+         result = verifyWorkMethods(workClass, RUN_METHOD_NAME, null, workClass.getName() + 
+                                    ": Run method is not defined");
+     
+         if (!result)
+         {
+            throw new WorkException(bundle.runMethodIsSynchronized(workClass.getName()));
+         }
+      
+         result = verifyWorkMethods(workClass, RELEASE_METHOD_NAME, null, workClass.getName() + 
+                                    ": Release method is not defined");
+      
+         if (!result)
+         {
+            throw new WorkException(bundle.releaseMethodIsSynchronized(workClass.getName()));
+         }
+
+         validatedWork.add(work.getClass().getName());
+      }
+   }
+   
+   private boolean verifyWorkMethods(Class<?> workClass, String methodName, 
+                                     Class<?>[] parameterTypes, String errorMessage) throws WorkException
+   {
+      Method method = null;
+      try
+      {
+         method = ClassUtil.getClassMethod(workClass, methodName, null);
+         
+         if (ClassUtil.modifiersHasSynchronizedKeyword(method.getModifiers()))
+         {
+            return false;  
+         }
+      }
+      catch (NoSuchMethodException nsme)
+      {
+         throw new WorkException(errorMessage);
+      }
+      
+      return true;
+   }
+
+   /**
+    * Checks work completed status. 
+    * @param wrapper work wrapper instance
+    * @throws {@link WorkException} if work is completed with an exception
+    */
+   private void checkWorkCompletionException(WorkWrapper wrapper) throws WorkException
+   {
+      if (wrapper.getWorkException() != null)
+      {
+         if (trace)
+            log.tracef("Exception %s for %s", wrapper.getWorkException(), this);
+
+         throw wrapper.getWorkException();  
+      }
+   }
+
+   /**
+    * Setup work context's of the given work instance.
+    * 
+    * @param wrapper The work wrapper instance
+    * @throws WorkException if any exception occurs
+    */
+   private void setup(WorkWrapper wrapper) throws WorkException
+   {
+      if (trace)
+      {
+         log.trace("Setting up work contexts " + wrapper);  
+      }
+
+      Work work = wrapper.getWork();
+      
+      //If work is an instanceof WorkContextProvider
+      if (work instanceof WorkContextProvider)
+      {
+         WorkContextProvider wcProvider = (WorkContextProvider)work;
+         List<WorkContext> contexts = wcProvider.getWorkContexts();
+
+         if (contexts != null && contexts.size() > 0)
+         {
+            boolean isTransactionContext = false;
+            boolean isSecurityContext = false;
+            boolean isHintcontext = false;
+
+            for (WorkContext context : contexts)
+            {
+               Class<? extends WorkContext> contextType = null;
+
+               // Get supported work context class
+               contextType = getSupportedWorkContextClass(context.getClass());
+
+               // Not supported
+               if (contextType == null)
+               {
+                  if (trace)
+                  {
+                     log.trace("Not supported work context class : " + context.getClass().getName());
+                  }
+                  
+                  fireWorkContextSetupFailed(context, WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
+                  
+                  throw new WorkCompletedException(bundle.unsupportedWorkContextClass(context.getClass().getName()), 
+                      WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
+               }
+               // Duplicate checks
+               else
+               {
+                  // TransactionContext duplicate
+                  if (isTransactionContext(contextType))
+                  {
+                     if (isTransactionContext)
+                     {
+                        if (trace)
+                        {
+                           log.trace("Duplicate transaction work context : " + context.getClass().getName());
+                        }
+
+                        fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
+                        
+                        throw new WorkCompletedException(bundle.duplicateTransactionWorkContextClass(
+                              context.getClass().getName()), WorkContextErrorCodes.DUPLICATE_CONTEXTS);
+                     }
+                     else
+                     {
+                        isTransactionContext = true;
+                     }
+                  }
+                  // SecurityContext duplicate
+                  else if (isSecurityContext(contextType))
+                  {
+                     if (isSecurityContext)
+                     {
+                        if (trace)
+                        {
+                           log.trace("Duplicate security work context : " + context.getClass().getName());
+                        }
+                        
+                        fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
+
+                        throw new WorkCompletedException(bundle.duplicateSecurityWorkContextClass(
+                              context.getClass().getName()), WorkContextErrorCodes.DUPLICATE_CONTEXTS);
+                     }
+                     else
+                     {
+                        isSecurityContext = true;
+                     }
+                  }
+                  // HintContext duplicate
+                  else if (isHintContext(contextType))
+                  {
+                     if (isHintcontext)
+                     {
+                        if (trace)
+                        {
+                           log.trace("Duplicate hint work context : " + context.getClass().getName());
+                        }
+
+                        fireWorkContextSetupFailed(context, WorkContextErrorCodes.DUPLICATE_CONTEXTS);
+                        
+                        throw new WorkCompletedException(bundle.duplicateHintWorkContextClass(
+                              context.getClass().getName()), WorkContextErrorCodes.DUPLICATE_CONTEXTS);
+                     }
+                     else
+                     {
+                        isHintcontext = true;
+                     }
+                  }
+                  // Normally, this must not be happened!i just safe check!
+                  else
+                  {
+                     fireWorkContextSetupFailed(context, WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
+                     
+                     throw new WorkCompletedException(bundle.unsupportedWorkContextClass(context.getClass().getName()), 
+                                                      WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE);
+                  }
+               }
+
+               // Add workcontext instance to the work
+               wrapper.addWorkContext(contextType, context);
+            }
+         }         
+      }      
+
+      if (trace)
+      {
+         log.trace("Setted up work contexts " + wrapper);  
+      }      
+   }
+
+   /**
+    * Calls listener with given error code.
+    * @param listener work context listener
+    * @param errorCode error code
+    */
+   private void fireWorkContextSetupFailed(Object workContext, String errorCode)
+   {
+      if (workContext instanceof WorkContextLifecycleListener)
+      {
+         WorkContextLifecycleListener listener = (WorkContextLifecycleListener)workContext;
+         listener.contextSetupFailed(errorCode);   
+      }
+      
+   }
+
+   /**
+    * Returns true if contexts is a transaction context.
+    * 
+    * @param workContextType context type
+    * @return true if contexts is a transaction context
+    */
+   private boolean isTransactionContext(Class<? extends WorkContext> workContextType)
+   {
+      if (workContextType.isAssignableFrom(TransactionContext.class))
+      {
+         return true;
+      }
+
+      return false;
+   }
+
+   /**
+    * Returns true if contexts is a security context.
+    * 
+    * @param workContextType context type
+    * @return true if contexts is a security context
+    */
+   private boolean isSecurityContext(Class<? extends WorkContext> workContextType)
+   {
+      if (workContextType.isAssignableFrom(SecurityContext.class))
+      {
+         return true;
+      }
+
+      return false;
+   }
+
+   /**
+    * Returns true if contexts is a hint context.
+    * 
+    * @param workContextType context type
+    * @return true if contexts is a hint context
+    */
+   private boolean isHintContext(Class<? extends WorkContext> workContextType)
+   {
+      if (workContextType.isAssignableFrom(HintsContext.class))
+      {
+         return true;
+      }
+
+      return false;
+   }
+
+   /**
+    * Returns work context class if given work context is supported by server,
+    * returns null instance otherwise.
+    * 
+    * @param <T> work context class
+    * @param adaptorWorkContext adaptor supplied work context class
+    * @return work context class
+    */
+   @SuppressWarnings("unchecked")
+   private <T extends WorkContext> Class<T> getSupportedWorkContextClass(Class<T> adaptorWorkContext)
+   {
+      for (Class<? extends WorkContext> supportedWorkContext : SUPPORTED_WORK_CONTEXT_CLASSES)
+      {
+         // Assignable or not
+         if (supportedWorkContext.isAssignableFrom(adaptorWorkContext))
+         {
+            Class clz = adaptorWorkContext;
+
+            while (clz != null)
+            {
+               // Supported by the server
+               if (clz.equals(supportedWorkContext))
+               {
+                  return clz;
+               }
+
+               clz = clz.getSuperclass();
+            }
+         }
+      }
+
+      return null;
+   }
+}

Deleted: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java
===================================================================
--- projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java	2011-06-10 14:17:48 UTC (rev 111581)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -1,517 +0,0 @@
-/*
- * 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.core.workmanager;
-
-import org.jboss.jca.core.CoreBundle;
-import org.jboss.jca.core.CoreLogger;
-
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-
-import javax.resource.spi.work.ExecutionContext;
-import javax.resource.spi.work.TransactionContext;
-import javax.resource.spi.work.Work;
-import javax.resource.spi.work.WorkCompletedException;
-import javax.resource.spi.work.WorkContext;
-import javax.resource.spi.work.WorkContextErrorCodes;
-import javax.resource.spi.work.WorkContextLifecycleListener;
-import javax.resource.spi.work.WorkEvent;
-import javax.resource.spi.work.WorkException;
-import javax.resource.spi.work.WorkListener;
-import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.message.callback.CallerPrincipalCallback;
-import javax.security.auth.message.callback.GroupPrincipalCallback;
-import javax.security.auth.message.callback.PasswordValidationCallback;
-import javax.transaction.xa.Xid;
-
-import org.jboss.logging.Logger;
-import org.jboss.logging.Messages;
-
-import org.jboss.security.SecurityContextAssociation;
-import org.jboss.security.SecurityContextFactory;
-import org.jboss.security.SimplePrincipal;
-import org.jboss.security.auth.callback.JASPICallbackHandler;
-
-/**
- * Wraps the resource adapter's work.
- *
- * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
- * @version $Revision: 71538 $
- */
-public class WorkWrapper implements Runnable
-{
-   /** The log */
-   private static CoreLogger log = Logger.getMessageLogger(CoreLogger.class, 
-      WorkWrapper.class.getName());
-
-   /** Whether we are tracing */
-   private static boolean trace = log.isTraceEnabled();
-   
-   /** The bundle */
-   private static CoreBundle bundle = Messages.getBundle(CoreBundle.class);
-   
-   /** The work */
-   private Work work;
-
-   /** The execution context */
-   private ExecutionContext executionContext;
-   
-   /**If work is an instance of WorkContextProvider, it may contain WorkContext instances */
-   private Map<Class<? extends WorkContext>, WorkContext> workContexts;
-
-   /** the work listener */
-   private WorkListener workListener;   
-
-   /** The work manager */
-   private org.jboss.jca.core.api.workmanager.WorkManager workManager;
-
-   /** The blocked time */
-   private long blockedTime;
-
-   /** Any exception */
-   private WorkException exception;
-
-   /** Started latch */
-   private CountDownLatch startedLatch;
-
-   /** Completed latch */
-   private CountDownLatch completedLatch;
-
-   /**
-    * Create a new WorkWrapper
-    *
-    * @param workManager the work manager
-    * @param work the work
-    * @param executionContext the execution context
-    * @param workListener the WorkListener
-    * @param startedLatch The latch for when work has started
-    * @param completedLatch The latch for when work has completed
-    * @throws IllegalArgumentException for null work, execution context or a negative start timeout
-    */
-   public WorkWrapper(org.jboss.jca.core.api.workmanager.WorkManager workManager, 
-                      Work work, 
-                      ExecutionContext executionContext, 
-                      WorkListener workListener,
-                      CountDownLatch startedLatch,
-                      CountDownLatch completedLatch)
-   {
-      super();
-
-      if (work == null)
-         throw new IllegalArgumentException("Null work");
-      if (executionContext == null)
-         throw new IllegalArgumentException("Null execution context");
-
-      this.workManager = workManager;
-      this.work = work;
-      this.executionContext = executionContext;
-      this.workListener = workListener;
-      this.startedLatch = startedLatch;
-      this.completedLatch = completedLatch;
-      this.workContexts = null;
-   }
-   
-   /**
-    * Get the work manager
-    *
-    * @return the work manager
-    */
-   public org.jboss.jca.core.api.workmanager.WorkManager getWorkManager()
-   {
-      return workManager;
-   }
-
-   /**
-    * Retrieve the work
-    *
-    * @return the work
-    */
-   public Work getWork()
-   {
-      return work;
-   }
-
-   /**
-    * Retrieve the exection context
-    *
-    * @return the execution context
-    */
-   public ExecutionContext getExecutionContext()
-   {
-      return executionContext;
-   }
-
-   /**
-    * Retrieve the work listener
-    *
-    * @return the WorkListener
-    */
-   public WorkListener getWorkListener()
-   {
-      return workListener;
-   }
-   
-   /**
-    * Get any exception
-    * 
-    * @return the exception or null if there is none
-    */
-   public WorkException getWorkException()
-   {
-      return exception;
-   }
-
-   /**
-    * Run
-    */
-   public void run()
-   {
-      if (trace)
-         log.trace("Starting work " + this);  
-
-      org.jboss.security.SecurityContext oldSC = SecurityContextAssociation.getSecurityContext();
-
-      try
-      {
-         start();
-
-         if (startedLatch != null)
-            startedLatch.countDown();
-
-         work.run();
-
-         end();
-      }
-      catch (Exception e)
-      {
-         exception = new WorkCompletedException(e);
-
-         cancel();
-      } 
-      finally
-      {
-         work.release();
-
-         if (workListener != null)
-         {
-            WorkEvent event = new WorkEvent(workManager, WorkEvent.WORK_COMPLETED, work, exception);
-            workListener.workCompleted(event);
-         }
-
-         SecurityContextAssociation.setSecurityContext(oldSC);
-
-         if (startedLatch != null)
-         {
-            while (startedLatch.getCount() != 0)
-               startedLatch.countDown();
-         }
-
-         if (completedLatch != null)
-            completedLatch.countDown();
-
-         if (trace)
-            log.trace("Executed work " + this);  
-      }
-   }
-
-   /**
-    * Start
-    * @throws WorkException for any error 
-    */
-   protected void start() throws WorkException
-   {
-      if (trace)
-      {
-         log.trace("Starting work " + this);  
-      }
-
-      // Transaction setup
-      ExecutionContext ctx = getWorkContext(TransactionContext.class);
-      if (ctx == null)
-      {
-         ctx = getExecutionContext();
-      }
-      
-      if (ctx != null)
-      {
-         Xid xid = ctx.getXid();
-         if (xid != null)
-         {
-            //JBAS-4002 base value is in seconds as per the API, here we convert to millis
-            long timeout = (ctx.getTransactionTimeout() * 1000);
-            workManager.getXATerminator().registerWork(work, xid, timeout);
-         }
-      }
-
-      // Security setup
-      javax.resource.spi.work.SecurityContext securityContext = 
-         getWorkContext(javax.resource.spi.work.SecurityContext.class);
-      if (securityContext != null && workManager.getCallbackSecurity() != null)
-      {
-         try
-         {
-            org.jboss.security.SecurityContext sc = SecurityContextFactory.createSecurityContext("work");  
-            SecurityContextAssociation.setSecurityContext(sc);
-
-            // Setup callbacks
-            CallbackHandler cbh = new JASPICallbackHandler();
-            List<Callback> callbacks = new ArrayList<Callback>();
-
-            Set<String> users = workManager.getCallbackSecurity().getUsers();
-
-            if (users != null && users.size() > 0)
-            {
-               for (String user : users)
-               {
-                  Subject subject = new Subject();
-                  Principal principal = new SimplePrincipal(user);
-                  char[] cred = workManager.getCallbackSecurity().getCredential(user);
-                  String[] roles = workManager.getCallbackSecurity().getRoles(user);
-
-                  GroupPrincipalCallback gpc = new GroupPrincipalCallback(subject, roles);
-                  CallerPrincipalCallback cpc = new CallerPrincipalCallback(subject, principal);
-                  PasswordValidationCallback pvc = new PasswordValidationCallback(subject, principal.getName(), cred);
-
-                  callbacks.add(gpc);
-                  callbacks.add(cpc);
-                  callbacks.add(pvc);
-               }
-            }
-            else
-            {
-               if (log.isDebugEnabled())
-                  log.debug("No users defined");
-            }
-
-            Callback[] cb = new Callback[callbacks.size()];
-            cbh.handle(callbacks.toArray(cb));
-
-            // Subjects for execution environment
-            Subject executionSubject = new Subject();
-            Subject serviceSubject = null;
-         
-            // Resource adapter callback
-            securityContext.setupSecurityContext(cbh, executionSubject, serviceSubject);
-
-            // Set the authenticated subject
-            sc.getSubjectInfo().setAuthenticatedSubject(executionSubject);
-         }
-         catch (Throwable t)
-         {
-            log.securityContextSetupFailed(t.getMessage(), t);
-            fireWorkContextSetupFailed(ctx);
-            throw new WorkException(bundle.securityContextSetupFailed(t.getMessage()), t);
-         }
-      }
-      else if (securityContext != null && workManager.getCallbackSecurity() == null)
-      {
-         log.securityContextSetupFailedCallbackSecurityNull();
-         fireWorkContextSetupFailed(ctx);
-         throw new WorkException(bundle.securityContextSetupFailedSinceCallbackSecurityWasNull());
-      }
-      
-      //Fires Context setup complete
-      fireWorkContextSetupComplete(ctx);
-      
-      if (ctx != null)
-      {
-         Xid xid = ctx.getXid();
-         if (xid != null)
-         {
-            workManager.getXATerminator().startWork(work, xid);
-         }
-      }
-
-      if (workListener != null)
-      {
-         WorkEvent event = new WorkEvent(workManager, WorkEvent.WORK_STARTED, work, null);
-         workListener.workStarted(event);
-      }
-
-      if (trace)
-      {
-         log.trace("Started work " + this);  
-      }
-   }
-
-   /**
-    * End
-    */
-   protected void end()
-   {
-      if (trace)
-      {
-         log.trace("Ending work " + this);  
-      }
-
-      ExecutionContext ctx = getWorkContext(TransactionContext.class);
-      if (ctx == null)
-      {
-         ctx = getExecutionContext();
-      }
-
-      if (ctx != null)
-      {
-         Xid xid = ctx.getXid();
-         if (xid != null)
-         {
-            workManager.getXATerminator().endWork(work, xid);
-         }
-      }
-
-      if (trace)
-      {
-         log.trace("Ended work " + this);  
-      }
-   }
-
-   /**
-    * Cancel
-    */
-   protected void cancel()
-   {
-      if (trace)
-         log.trace("Cancel work " + this);  
-
-      ExecutionContext ctx = getWorkContext(TransactionContext.class);
-      if (ctx == null)
-      {
-         ctx = getExecutionContext();
-      }
-
-      if (ctx != null)
-      {
-         Xid xid = ctx.getXid();
-         if (xid != null)
-         {
-            workManager.getXATerminator().cancelWork(work, xid);
-         }
-      }
-
-      if (trace)
-         log.trace("Canceled work " + this);  
-   }
-
-   /**
-    * Returns work context instance.
-    * 
-    * @param <T> class type info
-    * @param workContextClass work context type
-    * @return work context instance
-    */
-   public <T> T getWorkContext(Class<T> workContextClass)
-   {
-      T instance = null;
-
-      if (workContexts != null && workContexts.containsKey(workContextClass))
-      {
-         instance = workContextClass.cast(workContexts.get(workContextClass));
-      }
-
-      return instance;
-   }
-
-   /**
-    * Adds new work context.
-    * 
-    * @param workContext new work context
-    * @param workContextClass work context class
-    */
-   public void addWorkContext(Class<? extends WorkContext> workContextClass, WorkContext workContext)
-   {
-      if (workContextClass == null)
-      {
-         throw new IllegalArgumentException("Work context class is null");
-      }
-
-      if (workContext == null)
-      {
-         throw new IllegalArgumentException("Work context is null");
-      }
-
-      if (workContexts == null)
-      {
-         workContexts = new HashMap<Class<? extends WorkContext>, WorkContext>(1);
-      }
-
-      workContexts.put(workContextClass, workContext);
-   }
-   
-   /**
-    * Calls listener after work context is setted up.
-    * @param listener work context listener
-    */
-   private void fireWorkContextSetupComplete(Object workContext)
-   {
-      if (workContext != null && workContext instanceof WorkContextLifecycleListener)
-      {
-         WorkContextLifecycleListener listener = (WorkContextLifecycleListener)workContext;
-         listener.contextSetupComplete();   
-      }
-   }
-   
-   /**
-    * Calls listener if setup failed
-    * @param listener work context listener
-    */
-   private void fireWorkContextSetupFailed(Object workContext)
-   {
-      if (workContext != null && workContext instanceof WorkContextLifecycleListener)
-      {
-         WorkContextLifecycleListener listener = (WorkContextLifecycleListener)workContext;
-         listener.contextSetupFailed(WorkContextErrorCodes.CONTEXT_SETUP_FAILED);   
-      }
-   }
-   
-   /**
-    * String representation
-    * @return The string
-    */
-   public String toString()
-   {
-      StringBuilder buffer = new StringBuilder(100);
-      buffer.append("WorkWrapper@").append(Integer.toHexString(System.identityHashCode(this)));
-      buffer.append("[workManger=").append(workManager);
-      buffer.append(" work=").append(work);
-
-      if (executionContext != null && executionContext.getXid() != null)
-      {
-         buffer.append(" xid=").append(executionContext.getXid());
-         buffer.append(" txTimeout=").append(executionContext.getTransactionTimeout());
-      }
-
-      if (workListener != null)
-         buffer.append(" workListener=").append(workListener);
-      if (exception != null)
-         buffer.append(" exception=").append(exception);
-      buffer.append("]");
-      return buffer.toString();
-   }
-}

Copied: projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java (from rev 111583, projects/jboss-jca/branches/Branch_1_0/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java)
===================================================================
--- projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java	                        (rev 0)
+++ projects/jboss-jca/tags/IRONJACAMAR_1_0_0_CR2/core/src/main/java/org/jboss/jca/core/workmanager/WorkWrapper.java	2011-06-11 00:12:52 UTC (rev 111586)
@@ -0,0 +1,534 @@
+/*
+ * 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.core.workmanager;
+
+import org.jboss.jca.core.CoreBundle;
+import org.jboss.jca.core.CoreLogger;
+
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+
+import javax.resource.spi.work.ExecutionContext;
+import javax.resource.spi.work.TransactionContext;
+import javax.resource.spi.work.Work;
+import javax.resource.spi.work.WorkCompletedException;
+import javax.resource.spi.work.WorkContext;
+import javax.resource.spi.work.WorkContextErrorCodes;
+import javax.resource.spi.work.WorkContextLifecycleListener;
+import javax.resource.spi.work.WorkEvent;
+import javax.resource.spi.work.WorkException;
+import javax.resource.spi.work.WorkListener;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.message.callback.CallerPrincipalCallback;
+import javax.security.auth.message.callback.GroupPrincipalCallback;
+import javax.security.auth.message.callback.PasswordValidationCallback;
+import javax.transaction.xa.Xid;
+
+import org.jboss.logging.Logger;
+import org.jboss.logging.Messages;
+
+import org.jboss.security.SecurityContextAssociation;
+import org.jboss.security.SecurityContextFactory;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.security.auth.callback.JASPICallbackHandler;
+
+/**
+ * Wraps the resource adapter's work.
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: 71538 $
+ */
+public class WorkWrapper implements Runnable
+{
+   /** The log */
+   private static CoreLogger log = Logger.getMessageLogger(CoreLogger.class, 
+      WorkWrapper.class.getName());
+
+   /** Whether we are tracing */
+   private static boolean trace = log.isTraceEnabled();
+   
+   /** The bundle */
+   private static CoreBundle bundle = Messages.getBundle(CoreBundle.class);
+   
+   /** The work */
+   private Work work;
+
+   /** The execution context */
+   private ExecutionContext executionContext;
+   
+   /**If work is an instance of WorkContextProvider, it may contain WorkContext instances */
+   private Map<Class<? extends WorkContext>, WorkContext> workContexts;
+
+   /** the work listener */
+   private WorkListener workListener;   
+
+   /** The work manager */
+   private org.jboss.jca.core.api.workmanager.WorkManager workManager;
+
+   /** The blocked time */
+   private long blockedTime;
+
+   /** Any exception */
+   private WorkException exception;
+
+   /** Started latch */
+   private CountDownLatch startedLatch;
+
+   /** Completed latch */
+   private CountDownLatch completedLatch;
+
+   /**
+    * Create a new WorkWrapper
+    *
+    * @param workManager the work manager
+    * @param work the work
+    * @param executionContext the execution context
+    * @param workListener the WorkListener
+    * @param startedLatch The latch for when work has started
+    * @param completedLatch The latch for when work has completed
+    * @throws IllegalArgumentException for null work, execution context or a negative start timeout
+    */
+   public WorkWrapper(org.jboss.jca.core.api.workmanager.WorkManager workManager, 
+                      Work work, 
+                      ExecutionContext executionContext, 
+                      WorkListener workListener,
+                      CountDownLatch startedLatch,
+                      CountDownLatch completedLatch)
+   {
+      super();
+
+      if (work == null)
+         throw new IllegalArgumentException("Null work");
+      if (executionContext == null)
+         throw new IllegalArgumentException("Null execution context");
+
+      this.workManager = workManager;
+      this.work = work;
+      this.executionContext = executionContext;
+      this.workListener = workListener;
+      this.startedLatch = startedLatch;
+      this.completedLatch = completedLatch;
+      this.workContexts = null;
+   }
+   
+   /**
+    * Get the work manager
+    *
+    * @return the work manager
+    */
+   public org.jboss.jca.core.api.workmanager.WorkManager getWorkManager()
+   {
+      return workManager;
+   }
+
+   /**
+    * Retrieve the work
+    *
+    * @return the work
+    */
+   public Work getWork()
+   {
+      return work;
+   }
+
+   /**
+    * Retrieve the exection context
+    *
+    * @return the execution context
+    */
+   public ExecutionContext getExecutionContext()
+   {
+      return executionContext;
+   }
+
+   /**
+    * Retrieve the work listener
+    *
+    * @return the WorkListener
+    */
+   public WorkListener getWorkListener()
+   {
+      return workListener;
+   }
+   
+   /**
+    * Get any exception
+    * 
+    * @return the exception or null if there is none
+    */
+   public WorkException getWorkException()
+   {
+      return exception;
+   }
+
+   /**
+    * Run
+    */
+   public void run()
+   {
+      if (trace)
+         log.trace("Starting work " + this);  
+
+      ClassLoader oldCL = SecurityActions.getThreadContextClassLoader();
+      SecurityActions.setThreadContextClassLoader(work.getClass().getClassLoader());
+
+      org.jboss.security.SecurityContext oldSC = SecurityContextAssociation.getSecurityContext();
+
+      try
+      {
+         start();
+
+         if (startedLatch != null)
+            startedLatch.countDown();
+
+         work.run();
+
+         end();
+      }
+      catch (Exception e)
+      {
+         exception = new WorkCompletedException(e);
+
+         cancel();
+      } 
+      finally
+      {
+         work.release();
+
+         if (workListener != null)
+         {
+            WorkEvent event = new WorkEvent(workManager, WorkEvent.WORK_COMPLETED, work, exception);
+            workListener.workCompleted(event);
+         }
+
+         SecurityContextAssociation.setSecurityContext(oldSC);
+         SecurityActions.setThreadContextClassLoader(oldCL);
+
+         if (startedLatch != null)
+         {
+            while (startedLatch.getCount() != 0)
+               startedLatch.countDown();
+         }
+
+         if (completedLatch != null)
+            completedLatch.countDown();
+
+         if (trace)
+            log.trace("Executed work " + this);
+      }
+   }
+
+   /**
+    * Start
+    * @throws WorkException for any error 
+    */
+   protected void start() throws WorkException
+   {
+      if (trace)
+      {
+         log.trace("Starting work " + this);  
+      }
+
+      // Transaction setup
+      ExecutionContext ctx = getWorkContext(TransactionContext.class);
+      if (ctx == null)
+      {
+         ctx = getExecutionContext();
+      }
+      
+      if (ctx != null)
+      {
+         Xid xid = ctx.getXid();
+         if (xid != null)
+         {
+            //JBAS-4002 base value is in seconds as per the API, here we convert to millis
+            long timeout = (ctx.getTransactionTimeout() * 1000);
+            workManager.getXATerminator().registerWork(work, xid, timeout);
+         }
+      }
+
+      // Security setup
+      javax.resource.spi.work.SecurityContext securityContext = 
+         getWorkContext(javax.resource.spi.work.SecurityContext.class);
+      if (securityContext != null && workManager.getCallbackSecurity() != null)
+      {
+         try
+         {
+            org.jboss.security.SecurityContext sc = 
+               SecurityContextFactory.createSecurityContext(workManager.getCallbackSecurity().getDomain());
+            SecurityContextAssociation.setSecurityContext(sc);
+
+            // Setup callbacks
+            CallbackHandler cbh = new JASPICallbackHandler();
+            List<Callback> callbacks = new ArrayList<Callback>();
+
+            Set<String> users = workManager.getCallbackSecurity().getUsers();
+
+            if (users != null && users.size() > 0)
+            {
+               for (String user : users)
+               {
+                  Subject subject = new Subject();
+                  Principal principal = new SimplePrincipal(user);
+                  char[] cred = workManager.getCallbackSecurity().getCredential(user);
+                  String[] roles = workManager.getCallbackSecurity().getRoles(user);
+
+                  GroupPrincipalCallback gpc = new GroupPrincipalCallback(subject, roles);
+                  CallerPrincipalCallback cpc = new CallerPrincipalCallback(subject, principal);
+                  PasswordValidationCallback pvc = new PasswordValidationCallback(subject, principal.getName(), cred);
+
+                  callbacks.add(gpc);
+                  callbacks.add(cpc);
+                  callbacks.add(pvc);
+               }
+            }
+            else
+            {
+               if (log.isDebugEnabled())
+                  log.debug("No users defined");
+            }
+
+            Callback[] cb = new Callback[callbacks.size()];
+            cbh.handle(callbacks.toArray(cb));
+
+            // Subjects for execution environment
+            Subject executionSubject = new Subject();
+            Subject serviceSubject = null;
+         
+            // Resource adapter callback
+            securityContext.setupSecurityContext(cbh, executionSubject, serviceSubject);
+
+            // Set the authenticated subject
+            sc.getSubjectInfo().setAuthenticatedSubject(executionSubject);
+         }
+         catch (Throwable t)
+         {
+            log.securityContextSetupFailed(t.getMessage(), t);
+            fireWorkContextSetupFailed(ctx);
+            throw new WorkException(bundle.securityContextSetupFailed(t.getMessage()), t);
+         }
+      }
+      else if (securityContext != null && workManager.getCallbackSecurity() == null)
+      {
+         log.securityContextSetupFailedCallbackSecurityNull();
+         fireWorkContextSetupFailed(ctx);
+         throw new WorkException(bundle.securityContextSetupFailedSinceCallbackSecurityWasNull());
+      }
+      
+      //Fires Context setup complete
+      fireWorkContextSetupComplete(ctx);
+      
+      if (ctx != null)
+      {
+         Xid xid = ctx.getXid();
+         if (xid != null)
+         {
+            workManager.getXATerminator().startWork(work, xid);
+         }
+      }
+
+      if (workListener != null)
+      {
+         WorkEvent event = new WorkEvent(workManager, WorkEvent.WORK_STARTED, work, null);
+         workListener.workStarted(event);
+      }
+
+      if (trace)
+      {
+         log.trace("Started work " + this);  
+      }
+   }
+
+   /**
+    * End
+    */
+   protected void end()
+   {
+      if (trace)
+      {
+         log.trace("Ending work " + this);  
+      }
+
+      ExecutionContext ctx = getWorkContext(TransactionContext.class);
+      if (ctx == null)
+      {
+         ctx = getExecutionContext();
+      }
+
+      if (ctx != null)
+      {
+         Xid xid = ctx.getXid();
+         if (xid != null)
+         {
+            workManager.getXATerminator().endWork(work, xid);
+         }
+      }
+
+      if (trace)
+      {
+         log.trace("Ended work " + this);  
+      }
+   }
+
+   /**
+    * Cancel
+    */
+   protected void cancel()
+   {
+      if (trace)
+         log.trace("Cancel work " + this);  
+
+      ExecutionContext ctx = getWorkContext(TransactionContext.class);
+      if (ctx == null)
+      {
+         ctx = getExecutionContext();
+      }
+
+      if (ctx != null)
+      {
+         Xid xid = ctx.getXid();
+         if (xid != null)
+         {
+            workManager.getXATerminator().cancelWork(work, xid);
+         }
+      }
+
+      if (trace)
+         log.trace("Canceled work " + this);  
+   }
+
+   /**
+    * Returns work context instance.
+    * 
+    * @param <T> class type info
+    * @param workContextClass work context type
+    * @return work context instance
+    */
+   public <T> T getWorkContext(Class<T> workContextClass)
+   {
+      T instance = null;
+
+      if (workContexts != null && workContexts.containsKey(workContextClass))
+      {
+         instance = workContextClass.cast(workContexts.get(workContextClass));
+      }
+
+      return instance;
+   }
+
+   /**
+    * Adds new work context.
+    * 
+    * @param workContext new work context
+    * @param workContextClass work context class
+    */
+   public void addWorkContext(Class<? extends WorkContext> workContextClass, WorkContext workContext)
+   {
+      if (workContextClass == null)
+      {
+         throw new IllegalArgumentException("Work context class is null");
+      }
+
+      if (workContext == null)
+      {
+         throw new IllegalArgumentException("Work context is null");
+      }
+
+      if (workContexts == null)
+      {
+         workContexts = new HashMap<Class<? extends WorkContext>, WorkContext>(1);
+      }
+
+      if (trace)
+         log.tracef("Adding work context %s for %s", workContextClass, this);  
+
+      workContexts.put(workContextClass, workContext);
+   }
+   
+   /**
+    * Calls listener after work context is setted up.
+    * @param listener work context listener
+    */
+   private void fireWorkContextSetupComplete(Object workContext)
+   {
+      if (workContext != null && workContext instanceof WorkContextLifecycleListener)
+      {
+         if (trace)
+            log.tracef("WorkContextSetupComplete(%s) for %s", workContext, this);  
+
+         WorkContextLifecycleListener listener = (WorkContextLifecycleListener)workContext;
+         listener.contextSetupComplete();   
+      }
+   }
+   
+   /**
+    * Calls listener if setup failed
+    * @param listener work context listener
+    */
+   private void fireWorkContextSetupFailed(Object workContext)
+   {
+      if (workContext != null && workContext instanceof WorkContextLifecycleListener)
+      {
+         if (trace)
+            log.tracef("WorkContextSetupFailed(%s) for %s", workContext, this);  
+
+         WorkContextLifecycleListener listener = (WorkContextLifecycleListener)workContext;
+         listener.contextSetupFailed(WorkContextErrorCodes.CONTEXT_SETUP_FAILED);   
+      }
+   }
+   
+   /**
+    * String representation
+    * @return The string
+    */
+   public String toString()
+   {
+      StringBuilder buffer = new StringBuilder(100);
+      buffer.append("WorkWrapper@").append(Integer.toHexString(System.identityHashCode(this)));
+      buffer.append("[workManger=").append(workManager);
+      buffer.append(" work=").append(work);
+
+      if (executionContext != null && executionContext.getXid() != null)
+      {
+         buffer.append(" xid=").append(executionContext.getXid());
+         buffer.append(" txTimeout=").append(executionContext.getTransactionTimeout());
+      }
+
+      buffer.append(" workListener=").append(workListener);
+
+      buffer.append(" workContexts=").append(workContexts);
+
+      buffer.append(" exception=").append(exception);
+
+      buffer.append("]");
+
+      return buffer.toString();
+   }
+}



More information about the jboss-cvs-commits mailing list