[jboss-cvs] JBossAS SVN: r104370 - in branches/JBPAPP_5_1_hornetq-int: build and 21 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Apr 30 05:37:05 EDT 2010


Author: ataylor
Date: 2010-04-30 05:37:03 -0400 (Fri, 30 Apr 2010)
New Revision: 104370

Added:
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.bat
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.sh
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/jboss-as-hornetq-int.iml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/pom.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/etc/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/etc/switch.sh
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/DeploymentFactory.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/DestinationFactoryDeployerPlugin.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQConfigParserDeployer.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQCoreConfigRealDeployer.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSParserDeployer.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSRealDeployer.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/AbstractHornetQControlReferenceDeployment.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQConnectionFactoryDeployment.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQCoreDeployment.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQJMSDeployment.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQQueueDeployment.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQTopicDeployment.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/HornetQControlRuntimeDispatchPlugin.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryManageMO.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryMapper.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSManageMO.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSServerMO.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageMO.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/SubscriptionInfoMapper.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicManageMO.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntry.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntryAdapter.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplate.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplateInfo.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSConfiguration.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSQueueConfiguration.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSTopicConfiguration.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/package-info.java
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-configuration.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-jboss-beans.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-jms.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/jms-ds.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-configuration.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-jboss-beans.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-jms.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/jms-ds.xml
   branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
Modified:
   branches/JBPAPP_5_1_hornetq-int/build/build-distr.xml
   branches/JBPAPP_5_1_hornetq-int/build/build.xml
   branches/JBPAPP_5_1_hornetq-int/component-matrix/pom.xml
   branches/JBPAPP_5_1_hornetq-int/thirdparty/pom.xml
Log:
first pass hornetq integration

Modified: branches/JBPAPP_5_1_hornetq-int/build/build-distr.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/build/build-distr.xml	2010-04-30 09:14:36 UTC (rev 104369)
+++ branches/JBPAPP_5_1_hornetq-int/build/build-distr.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -785,6 +785,48 @@
       </copy>
    </target>
 
+
+   <!-- ========= -->
+   <!-- hornetq-int -->
+   <!-- ========= -->
+
+   <target name="_module-hornetq-int-most">
+     <property name="_module.name" value="hornetq-int" override="true"/>
+     <property name="_module.output" override="true" value="${project.root}/${_module.name}/output"/>
+      <mkdir dir="${install.root}"/>
+      <mkdir dir="${install.root}/extras"/>
+      <mkdir dir="${install.root}/extras/hornetq"/>
+      <copy todir="${install.root}/extras/hornetq">
+         <fileset dir="${_module.output}/">
+             <include name="resources/**/*"/>
+             <include name="lib/**/*"/>
+         </fileset>
+      </copy>
+      <copy todir="${install.root}/extras/hornetq/">
+         <fileset dir="${_module.output}/etc">
+             <include name="switch.sh"/>
+         </fileset>
+      </copy>
+      <copy todir="${install.root}/extras/hornetq/resources">
+         <fileset dir="${_module.output}/etc">
+             <include name="ra.xml"/>
+         </fileset>
+      </copy>
+      <copy todir="${install.root}/extras/hornetq/lib">
+         <fileset dir="${org.hornetq.lib}">
+         </fileset>
+      </copy>
+
+    <chmod perm="+x">
+      <fileset dir="${install.root}/extras/hornetq/">
+        <include name="**/*.sh"/>
+      </fileset>
+    </chmod>
+
+   </target>
+
+   <target name="_module-hornetq-int-all"></target>
+   
   <!-- ==== -->
   <!-- J2SE -->
   <!-- ==== -->

Modified: branches/JBPAPP_5_1_hornetq-int/build/build.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/build/build.xml	2010-04-30 09:14:36 UTC (rev 104369)
+++ branches/JBPAPP_5_1_hornetq-int/build/build.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -131,6 +131,7 @@
       <module name="management"/>
       <module name="mbeans"/>
       <module name="messaging"/>
+      <module name="hornetq-int"/>
       <module name="jbossas/remoting"/>
       <module name="jmx-remoting"/>
       <module name="jbossas/jmx-remoting"/>
@@ -170,6 +171,7 @@
                           jmx-remoting,
                           jbossas/jmx-remoting,
                           messaging,
+                          hornetq-int,
                           cluster,
                           varia,
                           iiop,
@@ -538,7 +540,18 @@
      <ant antfile="build-distr.xml" target="_module-messaging-all"/>
   </target>
 
+   <!-- ========= -->
+  <!-- HornetQ -->
+  <!-- ========= -->
 
+  <target name="_module-hornetq-int-most">
+     <ant antfile="build-distr.xml" target="_module-hornetq-int-most"/>
+  </target>
+
+  <target name="_module-hornetq-int-all" depends="_module-hornetq-int-most">
+     <ant antfile="build-distr.xml" target="_module-hornetq-int-all"/>
+  </target>
+
   <!-- ==== -->
   <!-- J2SE -->
   <!-- ==== -->

Modified: branches/JBPAPP_5_1_hornetq-int/component-matrix/pom.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/component-matrix/pom.xml	2010-04-30 09:14:36 UTC (rev 104369)
+++ branches/JBPAPP_5_1_hornetq-int/component-matrix/pom.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -41,6 +41,7 @@
     <version.jboss.jbossws>3.1.2.SP3_CP01</version.jboss.jbossws>
     <version.jboss.jms-integration-tests>1.0.1.GA</version.jboss.jms-integration-tests>
     <version.jboss.messaging>1.4.6.GA</version.jboss.messaging>
+    <version.hornetq>2.1.0.BETA3</version.hornetq>
     <version.jboss.web>2.1.7.GA</version.jboss.web>
     <version.jgroups>2.6.13.GA</version.jgroups>
     <version.junit>3.8.2</version.junit>
@@ -930,6 +931,73 @@
         <artifactId>resources</artifactId>
         <version>${version.jboss.messaging}</version>
       </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-resources</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-bootstrap</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-core-client</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-core</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-jboss-as-integration</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-jms-client</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-jms</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-logging</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-ra</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.hornetq</groupId>
+        <artifactId>hornetq-resources</artifactId>
+        <version>${version.hornetq}</version>
+      </dependency>
+
+
+       <dependency>
+         <groupId>org.jboss.netty</groupId>
+         <artifactId>netty</artifactId>
+         <version>3.2.0.BETA1</version>
+       </dependency>
       
       <dependency>
         <groupId>jboss.profiler.jvmti</groupId>

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.bat
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.bat	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.bat	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,90 @@
+ at echo off
+REM  ======================================================================
+REM
+REM  This is the main entry point for the build system.
+REM
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
+REM  the correct version is being used with the correct configuration.
+REM
+REM  ======================================================================
+REM
+REM $Id: build.bat 85700 2009-03-10 22:06:28Z pgier $
+REM
+REM Authors:
+REM     Jason Dillon <jason at planet57.com>
+REM     Sacha Labourey <sacha.labourey at cogito-info.ch>
+REM
+
+REM ******************************************************
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
+REM ******************************************************
+REM Ignore the users classpath, cause it might mess
+REM things up
+REM ******************************************************
+
+SETLOCAL
+
+set CLASSPATH=
+set MAVEN_HOME=
+
+REM ******************************************************
+REM - "for" loops have been unrolled for compatibility
+REM   with some WIN32 systems.
+REM ******************************************************
+
+set NAMES=tools;tools\maven;tools\apache\maven
+set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
+
+REM ******************************************************
+REM ******************************************************
+
+SET EXECUTED=FALSE
+for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6
+
+goto :EOF
+
+
+REM ******************************************************
+REM ********* Search for names in the subfolders *********
+REM ******************************************************
+
+:subLoop
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
+
+goto :EOF
+
+
+REM ******************************************************
+REM ************ Test if Maven Batch file exists ***********
+REM ******************************************************
+
+:testIfExists
+if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8
+
+goto :EOF
+
+
+REM ******************************************************
+REM ************** Batch file has been found *************
+REM ******************************************************
+
+:BatchFound
+if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
+set EXECUTED=TRUE
+
+goto :EOF
+
+REM ******************************************************
+REM ************* Execute Batch file only once ***********
+REM ******************************************************
+
+:ExecuteBatch
+echo Calling %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
+
+:end
+
+if "%NOPAUSE%" == "" pause

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.sh
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.sh	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.sh	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,175 @@
+#!/bin/sh
+### ====================================================================== ###
+##                                                                          ##
+##  This is the main entry point for the build system.                      ##
+##                                                                          ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
+##  the correct version is being used with the correct configuration.       ##
+##                                                                          ##
+### ====================================================================== ###
+
+# $Id: build.sh 85700 2009-03-10 22:06:28Z pgier $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+GREP="grep"
+ROOT="/"
+
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
+
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
+    tools
+    tools/maven \
+    tools/apache/maven \
+    maven"
+
+# the default arguments
+MVN_OPTIONS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that
+MAX_FD="maximum"
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false;
+darwin=false;
+case "`uname`" in
+    CYGWIN*)
+        cygwin=true
+        ;;
+
+    Darwin*)
+        darwin=true
+        ;;
+esac
+
+#
+# Helper to complain.
+#
+die() {
+    echo "${PROGNAME}: $*"
+    exit 1
+}
+
+#
+# Helper to complain.
+#
+warn() {
+    echo "${PROGNAME}: $*"
+}
+
+#
+# Helper to source a file if it exists.
+#
+maybe_source() {
+    for file in $*; do
+	if [ -f "$file" ]; then
+	    . $file
+	fi
+    done
+}
+
+search() {
+    search="$*"
+    for d in $search; do
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
+	    # found one
+	    echo $MAVEN_HOME
+	    break
+	fi
+    done
+}
+
+#
+# Main function.
+#
+main() {
+    # if there is a build config file. then source it
+    maybe_source "$DIRNAME/build.conf" "$HOME/.build.conf"
+
+    # Increase the maximum file descriptors if we can
+    if [ $cygwin = "false" ]; then
+	MAX_FD_LIMIT=`ulimit -H -n`
+	if [ $? -eq 0 ]; then
+	    if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
+		# use the system max
+		MAX_FD="$MAX_FD_LIMIT"
+	    fi
+
+	    ulimit -n $MAX_FD
+	    if [ $? -ne 0 ]; then
+		warn "Could not set maximum file descriptor limit: $MAX_FD"
+	    fi
+	else
+	    warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
+	fi
+    fi
+
+    # try the search path
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
+
+    # try looking up to root
+    if [ "x$MAVEN_HOME" = "x" ]; then
+	target="build"
+	_cwd=`pwd`
+
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	    cd ..
+	    cwd=`pwd`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
+	done
+
+	# make sure we get back
+	cd $_cwd
+
+	if [ "$cwd" != "$ROOT" ]; then
+	    found="true"
+	fi
+
+	# complain if we did not find anything
+	if [ "$found" != "true" ]; then
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
+	fi
+    fi
+
+    # make sure we have one
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
+    fi
+
+    # need to specify planet57/buildmagic protocol handler package
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+
+    # setup some build properties
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
+
+    # change to the directory where the script lives so users are not forced
+    # to be in the same directory as build.xml
+    cd $DIRNAME
+
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
+
+    
+    # execute in debug mode, or simply execute
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
+    else
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
+    fi
+}
+
+##
+## Bootstrap
+##
+
+main "$@"


Property changes on: branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/build.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+   <!ENTITY buildmagic SYSTEM "../tools/etc/buildmagic/buildmagic.ent">
+   <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+   <!ENTITY modules SYSTEM "../tools/etc/buildmagic/modules.ent">
+   <!ENTITY targets SYSTEM "../tools/etc/buildmagic/targets.ent">
+]>
+
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--  JBoss, the OpenSource J2EE webOS                                      -->
+<!--                                                                        -->
+<!--  Distributable under LGPL license.                                     -->
+<!--  See terms of license at http://www.gnu.org.                           -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<project default="main" name="JBoss/HornetQ Integration">
+
+  <!-- ================================================================== -->
+  <!-- Setup                                                              -->
+  <!-- ================================================================== -->
+
+  <!--
+     | Include the common Buildmagic elements.
+     |
+     | This defines several different targets, properties and paths.
+     | It also sets up the basic extention tasks amoung other things.
+   -->
+
+    <property name="javac.target" value="1.5"/>
+    <property name="javac.source" value="1.5"/>
+
+	&buildmagic;
+
+  <!--
+     | Include the normal targets.
+   -->
+  &targets;
+
+  <!-- ================================================================== -->
+  <!-- Configuration                                                      -->
+  <!-- ================================================================== -->
+
+  <!--
+     | Configure the build system.
+     |
+     | This target is invoked by the Buildmagic initialization logic and
+     | should contain module specific configuration elements.
+   -->
+
+  <target name="configure" unless="configure.disable">
+
+    <!-- =================== -->
+    <!-- Basic Configuration -->
+    <!-- =================== -->
+    <property name="module.name" value="hornetq-int"/>
+    <property name="module.Name" value="HornetQ Integration"/>
+
+     <!-- The combined thirdparty classpath -->
+    <path id="thirdparty.classpath">
+      <path refid="library.classpath"/>
+      <path refid="dependentmodule.classpath"/>
+    </path>
+
+    <!-- classpath and local.classpath must have a value using with a path -->
+    <property name="classpath" value=""/>
+    <property name="local.classpath" value=""/>
+
+    <!-- The classpath required to build classes. -->
+    <path id="javac.classpath">
+      <pathelement path="${classpath}"/>
+      <pathelement path="${local.classpath}"/>
+      <path refid="thirdparty.classpath"/>
+    </path>
+
+    <!-- ========= -->
+    <!-- Libraries -->
+    <!-- ========= -->
+    &libraries;
+
+     <!-- The combined library classpath -->
+    <path id="library.classpath">
+      <path refid="jboss.common.logging.spi.classpath"/>
+      <path refid="org.hornetq.classpath"/>
+      <path refid="jboss.jboss.man.classpath"/>
+      <path refid="jboss.jboss.deployers.classpath"/>
+      <path refid="jboss.microcontainer.classpath"/>
+      <path refid="org.jboss.javaee.classpath"/>
+      <path refid="jboss.metadata.classpath"/>
+      <path  refid="jboss.common.core.classpath"/>
+      <path  refid="jboss.microcontainer.classpath"/>
+      <path  refid="jboss.profileservice.spi.classpath"/>
+      <path  refid="jboss.jboss.vfs.classpath"/>
+      <path  refid="jboss.jboss.mdr.classpath"/>
+
+      <path refid="jboss.server.classpath"/>
+    </path>
+
+    <!-- ======= -->
+    <!-- Modules -->
+    <!-- ======= -->
+    &modules;
+
+    <!-- Specify modules upon which this build depends -->
+    <path id="dependentmodule.classpath">
+    </path>
+    <!-- ======= -->
+    <!-- Modules -->
+    <!-- ======= -->
+    &modules;
+    <call target="_default:task-init"/>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Compile                                                            -->
+  <!-- ================================================================== -->
+
+  <!--
+     |  Compile everything.
+     |
+     |  This target should depend on other compile-* targets for each
+     |  different type of compile that needs to be performed, short of
+     |  documentation compiles.
+    -->
+  <target name="compile"
+    description="Compile all source files."
+    depends="compile-classes, compile-resources"/>
+
+  <!-- Compile all class files -->
+  <target name="compile-classes" depends="init">
+     <property name="myclasspath" refid="javac.classpath"/>
+         <echo message="classpath= ${myclasspath}"/>
+
+    <mkdir dir="${build.classes}"/>
+    <javac destdir="${build.classes}"
+      optimize="${javac.optimize}"
+      target="${javac.target}"
+      source="${javac.source}"
+      debug="${javac.debug}"
+      depend="${javac.depend}"
+      verbose="${javac.verbose}"
+      deprecation="${javac.deprecation}"
+      includeAntRuntime="${javac.include.ant.runtime}"
+      includeJavaRuntime="${javac.include.java.runtime}"
+      includes="${javac.includes}"
+      excludes="${javac.excludes}"
+      failonerror="${javac.fail.onerror}">
+      <src path="${source.java}"/>
+      <classpath refid="javac.classpath"/>
+    </javac>
+  </target>
+
+   <!-- Compile resource files -->
+  <target name="compile-resources" depends="init">
+    <mkdir dir="${build.resources}"/>
+    <copy todir="${build.resources}" filtering="yes">
+      <fileset dir="${source.resources}">
+        <include name="**/*"/>
+      </fileset>
+    </copy>
+     
+    <unzip dest="output/etc" src="${org.hornetq.lib}/hornetq-resources.jar"/>
+
+     <copy todir="output/etc">
+        <fileset dir="${source.etc}">
+          <include name="switch.sh"/>
+        </fileset>
+     </copy>
+  </target>
+
+  <!-- ================================================================== -->
+  <!-- Archives                                                           -->
+  <!-- ================================================================== -->
+  <target name="module-jars"
+    description="Builds hornetq jar files.">
+    <!-- Generate a jar containing all the compiled sources -->
+    <jar destfile="${build.lib}/${module.name}.jar">
+      <fileset dir="${build.classes}"/>
+    </jar>
+  </target>
+
+</project>

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/jboss-as-hornetq-int.iml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/jboss-as-hornetq-int.iml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/jboss-as-hornetq-int.iml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/resources" isTestSource="false" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.mx:jboss-j2se:6.0.0.Beta5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss:jboss-common-core:2.2.17.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.integration:jboss-classloading-spi:6.0.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-system-jmx:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: apache-xerces:xml-apis:2.9.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.logging:jboss-logging:3.0.0.Beta2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss:jboss-vfs:3.0.0.CR5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss:jbossxb:2.0.2.Beta7" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss:jboss-reflect:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.activation:activation:1.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: sun-jaxb:jaxb-api:2.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-core-spi:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-impl:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-spi:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-structure-spi:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-client-spi:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.man:jboss-managed:2.1.1.SP1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.man:jboss-metatype:2.1.1.SP1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss:jboss-mdr:2.2.0.Alpha2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.mcann:mcann-core:1.0.0.Alpha2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.cl:jboss-classloading-vfs:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.cl:jboss-classloader:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javassist:javassist:3.11.0.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.cl:jboss-classloading:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.kernel:jboss-kernel:2.2.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.kernel:jboss-dependency:2.2.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.inject:javax.inject:1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-vfs:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-vfs-spi:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: stax:stax-api:1.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-core:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-client:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.bootstrap:jboss-bootstrap-spi-as:2.1.0-alpha-4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.bootstrap:jboss-bootstrap-spi-mc:2.1.0-alpha-4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.bootstrap:jboss-bootstrap-spi:2.1.0-alpha-4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.bootstrap:jboss-bootstrap-api:2.1.0-alpha-4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.bootstrap:jboss-bootstrap-api-mc:2.1.0-alpha-4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.bootstrap:jboss-bootstrap-api-as:2.1.0-alpha-4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-system:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aop:jboss-aop:2.2.0.Final" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.apache.ant:ant:1.7.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.apache.ant:ant-launcher:1.7.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.classpool:jboss-classpool-scoped:1.0.0.Alpha5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.classpool:jboss-classpool:1.0.0.Alpha5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: qdox:qdox:1.6.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: trove:trove:1.0.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: log4j:log4j:1.2.14" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aop:jboss-aop-deployers:2.2.0.Final" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aop:jboss-aop-asintegration-mc:2.2.0.Final" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.classpool:jboss-classpool-jbosscl:1.0.0.Alpha5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.classpool:jboss-classpool:test-jar:tests:1.0.0.Alpha5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aop:pluggable-instrumentor:2.2.0.Final" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aop:jboss-aop-asintegration-core:2.2.0.Final" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.jboss.test:jboss-test:1.1.6.GA" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: jboss.profiler.jvmti:jboss-profiler-jvmti:1.0.0.CR5" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.6" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.jboss.jbossas:jboss-server-manager:1.0.3.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.naming:jnp-client:5.0.5.Final" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.security:jbosssx-client:3.0.0.Beta4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.security:jboss-security-spi:3.0.0.Beta4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.kernel:jboss-aop-mc-int:2.2.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.integration:jboss-profileservice-spi:6.0.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.picketbox:picketbox-bare:3.0.0.Beta4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.security:jbosssx:3.0.0.Beta4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.mx:jboss-jmx:6.0.0.Beta5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.mx:jboss-mbeans:6.0.0.Beta5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.mx:jboss-jmx-annotations:6.0.0.Beta5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: bcel:bcel:5.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.kernel:jboss-jmx-mc-int:2.2.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.mx:jboss-mbeanserver:6.0.0.Beta5" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.deployers:jboss-deployers-jmx:2.2.0.Alpha4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.metadata:jboss-metadata-common:2.0.0.Alpha14" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ws:jbossws-spi:1.3.0.CR1.SP1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: gnu-getopt:getopt:1.0.12-brew" level="project" />
+    <orderEntry type="library" exported="" name="Maven: jboss.jbossws:jboss-jaxws:3.0.1-native-2.0.4.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.metadata:jboss-metadata-client:2.0.0.Alpha2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.metadata:jboss-metadata-ejb:2.0.0-alpha-10" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:1.0.0.Beta2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.0.Beta1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ws.native:jbossws-native-jaxrpc:3.2.2.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ws.native:jbossws-native-saaj:3.2.2.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-ext-api:1.1.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-ejb3:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: cglib:cglib:2.1.3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hibernate:hibernate-core:3.5.0-CR-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: antlr:antlr:2.7.6-brew" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-collections:commons-collections:3.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.slf4j:slf4j-api:1.5.6" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hibernate:hibernate-annotations:3.5.0-CR-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hibernate:hibernate-commons-annotations:3.2.0.Beta1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.0-CR-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: jacorb:jacorb:2.3.1jboss.patch01-brew" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.remoting:jboss-remoting:2.5.2.SP2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hibernate:hibernate-entitymanager:3.5.0-CR-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.cluster:jboss-ha-client:1.1.1.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3_1:1.0.7" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-cache:1.0.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: jboss:jboss-serialization:1.0.3.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-common:1.0.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-core:1.3.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.integration:jboss-jca-spi:5.0.3.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aspects:jboss-remoting-aspects:1.0.1.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aspects:jboss-transaction-aspects:1.0.0.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aspects:jboss-security-aspects:1.0.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.cluster:jboss-ha-server-api:1.1.1.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-endpoint:0.1.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-jpa-int:2.0.0-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-security:1.0.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.aspects:jboss-current-invocation-aspects:1.0.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-interceptors:1.0.6" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-metadata:1.0.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-ext-api-impl:1.1.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-timerservice-spi:1.0.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-proxy-impl:1.0.6" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-proxy-spi:1.0.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.naming:jnpserver:5.0.5.Final" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-proxy-clustered:1.0.3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-transactions:1.0.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.integration:jboss-transaction-spi:6.0.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: oswego-concurrent:concurrent:1.3.4-jboss-update1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.context:jboss-ejb3-context-base:0.1.1" level="project" />
+    <orderEntry type="library" exported="" scope="RUNTIME" name="Maven: org.jboss.ejb3.context:jboss-ejb3-context-naming:0.1.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.timeout:jboss-ejb3-timeout-spi:0.1.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.vfs:jboss-ejb3-vfs-spi:1.0.0-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jpa:jboss-jpa-deployers:1.0.2-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jpa:jboss-jpa-impl:2.0.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.validation:validation-api:1.0.0.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jpa:jboss-jpa-spi:1.0.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: quartz:quartz:1.6.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: sun-jaxws:jaxws-api:2.1.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: sun-jaxws:jsr181-api:2.1.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-deployers:1.1.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-server:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-deployment:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.enterprise.deploy:jboss-jad-api_1.2_spec:1.0.0.Beta1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.metadata:jboss-metadata-ear:2.0.0.Alpha3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.metadata:jboss-metadata-rar:2.0.0.Alpha" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.metadata:jboss-metadata-war:2.0.0.Alpha14" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.0.Beta2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Beta2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.resource:jboss-connector-api_1.5_spec:1.0.0.Beta1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.jms:jboss-jms-api_1.1_spec:1.0.0.Beta1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-security:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.security.auth.message:jboss-jaspi-api_1.0_spec:1.0.0.Beta1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.security:jbossxacml:2.0.5.CR1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.apache:xmlsec:1.4.3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.integration:jboss-deployment-spi:6.0.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jpa:jboss-jpa-vfs3:1.0.2-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.reloaded:jboss-reloaded-naming:0.1.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.reloaded:jboss-reloaded-naming-deployers:0.1.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:1.0.0.Beta1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:1.0.0.Beta2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.xml.soap:saaj-api:1.3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.xml.ws:jaxws-api:2.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.service.binding:jboss-service-binding-core:1.1.0.CR1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.service.binding:jboss-service-binding-mgmt:1.1.0.CR1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-metadata-deployers:1.0.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.nointerface:jboss-ejb3-nointerface-impl:1.0.0-alpha-6" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.nointerface:jboss-ejb3-nointerface-spi:1.0.0-alpha-6" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.proxy:proxy-javassist:1.0.0-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.proxy:proxy-spi:1.0.0-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.singleton:jboss-ejb3-singleton-aop-impl:1.0.0-alpha-2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.singleton:jboss-ejb3-singleton-impl:1.0.0-alpha-2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.singleton:jboss-ejb3-singleton-spi:1.0.0-alpha-2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.container:jboss-ejb3-container-spi:1.0.0-alpha-2" level="project" />
+    <orderEntry type="library" exported="" scope="RUNTIME" name="Maven: org.jboss.ejb3.concurrency:jboss-ejb3-concurrency-aop:1.0.0-alpha-1" level="project" />
+    <orderEntry type="library" exported="" scope="RUNTIME" name="Maven: org.jboss.ejb3.concurrency:jboss-ejb3-concurrency-impl:1.0.0-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.singleton:jboss-ejb3-singleton-deployer:1.0.0-alpha-2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.singleton:jboss-ejb3-singleton-proxy-impl:1.0.0-alpha-2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.proxy:proxy-reflect:1.0.0-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3:jboss-ejb3-core:client:1.3.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.metadata:jboss-metadata:1.0.4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.cache:jbosscache-core:3.2.1.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: jgroups:jgroups:2.10.0.Alpha3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: commons-logging:commons-logging:1.1.0.jboss" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.vfs:jboss-ejb3-vfs-impl-vfs3:1.0.0-alpha-1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.ejb3.timeout:jboss-ejb3-timeout-3.1:0.1.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-connector:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.mail:mail:1.4.2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.integration:jboss-integration:6.0.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.stdio:jboss-stdio:1.0.0.CR3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.threads:jboss-threads:2.0.0.CR4" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.quartz-scheduler:quartz:1.7.3" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-iiop:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: jboss.jbossts:jbossjts:4.9.0.GA" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.integration:jboss-corba-ots-spi:6.0.0.Alpha9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.jboss.jbossas:jboss-as-main:6.0.0-SNAPSHOT" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hornetq:hornetq-resources:2.1.0.BETA2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hornetq:hornetq-core:2.1.0.BETA2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hornetq:hornetq-jms:2.1.0.BETA2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.rhq:rhq-core-domain:1.4.0.B01" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.rhq:rhq-core-util:1.4.0.B01" level="project" />
+    <orderEntry type="library" exported="" name="Maven: jdom:jdom:1.0" level="project" />
+    <orderEntry type="library" exported="" name="Maven: i18nlog:i18nlog:1.0.9" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.xml.bind:jaxb-api:2.1" level="project" />
+    <orderEntry type="library" exported="" name="Maven: javax.xml.stream:stax-api:1.0-2" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.rhq:rhq-core-plugin-api:1.4.0.B01" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.rhq:rhq-core-native-system:1.4.0.B01" level="project" />
+    <orderEntry type="library" exported="" name="Maven: org.hyperic:sigar:1.6.3.82" level="project" />
+    <orderEntry type="library" exported="" name="Maven: com.sun.xml.bind:jaxb-impl:2.2" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.rhq:rhq-jmx-plugin:1.4.0.B01" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: mc4j:org-mc4j-ems:1.2.11" level="project" />
+    <orderEntry type="library" name="Maven: com.sun:tools:1.4.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: org.apache.ant:ant-junit:1.7.0" level="project" />
+  </component>
+</module>
+

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/pom.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/pom.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/pom.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,186 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  
+  <parent>
+    <groupId>org.jboss.jbossas</groupId>
+    <artifactId>jboss-as-parent</artifactId>
+    <version>6.0.0-SNAPSHOT</version>
+  </parent>
+  
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.jbossas</groupId>
+  <artifactId>jboss-as-hornetq-int</artifactId>
+  <packaging>jar</packaging>
+  <name>JBoss Application Server HornetQ Integration</name>
+  <url>http://www.jboss.org/jbossas</url>
+  <description>JBoss Application Server (messaging module)</description>
+  
+  <build>
+    <finalName>${artifactId}</finalName>
+    <resources>
+      <resource>
+        <directory>src/resources</directory>
+      </resource>
+    </resources>
+    <plugins>
+       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <excludes>
+             <exclude>org/jboss/as/integration/hornetq/jopr/**</exclude>
+             <exclude>**/rhq-plugin.xml</exclude>
+             <exclude>**/hornetq-deployers-beans.xml</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>create-output</id>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <phase>package</phase>
+             <configuration>
+              <tasks>
+
+                <mkdir dir="target/resources"/>
+                <copy todir="target/resources" filtering="yes">
+                  <fileset dir="src/resources">
+                    <include name="**"/>
+                  </fileset>
+                </copy>
+             </tasks>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <dependencies>
+    <!-- Compile (global dependencies) -->
+    <dependency>
+      <groupId>org.jboss.mx</groupId>
+      <artifactId>jboss-j2se</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.jbossas</groupId>
+      <artifactId>jboss-as-system-jmx</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.metadata</groupId>
+      <artifactId>jboss-metadata-common</artifactId>
+      <exclusions>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-ejb-api</artifactId>
+         </exclusion>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-transaction-api</artifactId>
+         </exclusion>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-jms-api</artifactId>
+         </exclusion>
+       </exclusions>
+
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.metadata</groupId>
+      <artifactId>jboss-metadata-client</artifactId>
+      <exclusions>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-ejb-api</artifactId>
+         </exclusion>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-transaction-api</artifactId>
+         </exclusion>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-jms-api</artifactId>
+         </exclusion>
+       </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.metadata</groupId>
+      <artifactId>jboss-metadata-ejb</artifactId>
+      <exclusions>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-ejb-api</artifactId>
+         </exclusion>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-transaction-api</artifactId>
+         </exclusion>
+         <exclusion>
+            <groupId>org.jboss.javaee</groupId>
+            <artifactId>jboss-jms-api</artifactId>
+         </exclusion>
+       </exclusions>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss.jbossas</groupId>
+      <artifactId>jboss-as-ejb3</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.hornetq</groupId>
+      <artifactId>hornetq-resources</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.hornetq</groupId>
+      <artifactId>hornetq-core</artifactId>
+    </dependency>
+    <dependency>
+       <groupId>org.hornetq</groupId>
+      <artifactId>hornetq-jms</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>apache-xerces</groupId>
+      <artifactId>xml-apis</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.spec.javax.jms</groupId>
+      <artifactId>jboss-jms-api_1.1_spec</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.security</groupId>
+      <artifactId>jboss-security-spi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.security</groupId>
+      <artifactId>jbosssx-client</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.rhq</groupId>
+      <artifactId>rhq-core-domain</artifactId>
+       <scope>compile</scope>
+     </dependency>
+     <dependency>
+      <groupId>org.rhq</groupId>
+      <artifactId>rhq-core-plugin-api</artifactId>
+      <scope>compile</scope>
+     </dependency>
+      <dependency>
+         <groupId>org.rhq</groupId>
+         <artifactId>rhq-jmx-plugin</artifactId>
+         <scope>provided</scope>
+      </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  
+</project>

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/etc/switch.sh
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/etc/switch.sh	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/etc/switch.sh	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,40 @@
+#!/bin/sh
+### ====================================================================== ###
+##                                                                          ##
+##  This script will switch the default messaging provider to HornetQ       ##
+##                                                                          ##
+### ====================================================================== ###
+
+JBOSS_HOME=../../
+
+rm $JBOSS_HOME/common/lib/jboss-messaging.jar
+rm $JBOSS_HOME/common/lib/jboss-messaging-int.jar
+
+cp lib/hornetq-bootstrap.jar $JBOSS_HOME/common/lib
+cp lib/hornetq-core.jar $JBOSS_HOME/common/lib
+cp lib/hornetq-jboss-as-integration.jar $JBOSS_HOME/common/lib
+cp lib/hornetq-jms.jar $JBOSS_HOME/common/lib
+cp lib/hornetq-logging.jar $JBOSS_HOME/common/lib
+cp lib/hornetq-int.jar $JBOSS_HOME/common/lib
+
+rm $JBOSS_HOME/client/jboss-messaging-client.jar
+
+cp lib/hornetq-core-client.jar $JBOSS_HOME/client
+cp lib/hornetq-jms-client.jar $JBOSS_HOME/client
+
+rm -r $JBOSS_HOME/server/default/deploy/messaging
+
+mkdir $JBOSS_HOME/server/default/deploy/hornetq
+
+cp resources/config/non-clustered/hornetq-configuration.xml $JBOSS_HOME/server/default/deploy/hornetq
+cp resources/config/non-clustered/hornetq-jboss-beans.xml $JBOSS_HOME/server/default/deploy/hornetq
+cp resources/config/non-clustered/hornetq-jms.xml $JBOSS_HOME/server/default/deploy/hornetq
+cp resources/config/non-clustered/jms-ds.xml $JBOSS_HOME/server/default/deploy/hornetq
+
+rm $JBOSS_HOME/server/default/deploy/jms-ra.rar
+
+mkdir $JBOSS_HOME/server/default/deploy/jms-ra.rar
+mkdir $JBOSS_HOME/server/default/deploy/jms-ra.rar/META-INF
+
+cp lib/hornetq-ra.jar $JBOSS_HOME/server/default/deploy/jms-ra.rar/
+cp resources/ra.xml $JBOSS_HOME/server/default/deploy/jms-ra.rar/META-INF
\ No newline at end of file

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/DeploymentFactory.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/DeploymentFactory.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/DeploymentFactory.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers;
+
+import java.util.Map;
+
+import org.hornetq.api.core.management.ObjectNameBuilder;
+import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
+import org.hornetq.jms.server.config.JMSConfiguration;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.jms.server.config.TopicConfiguration;
+import org.jboss.as.integration.hornetq.deployers.pojo.HornetQConnectionFactoryDeployment;
+import org.jboss.as.integration.hornetq.deployers.pojo.HornetQCoreDeployment;
+import org.jboss.as.integration.hornetq.deployers.pojo.HornetQQueueDeployment;
+import org.jboss.as.integration.hornetq.deployers.pojo.HornetQTopicDeployment;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
+import org.jboss.logging.Logger;
+
+/**
+ * 
+ * @author <mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ *
+ */
+public class DeploymentFactory
+{
+
+   private static final Logger log = Logger.getLogger(DeploymentFactory.class);
+
+   private static DeploymentFactory instance = new DeploymentFactory();
+   
+   public static DeploymentFactory getInstance()
+   {
+      return instance;
+   }
+   
+   public void deployJMS(DeploymentUnit unit, JMSConfiguration mainConfig) throws DeploymentException
+   {
+      
+      try
+      {
+
+         for (JMSQueueConfiguration config : mainConfig.getQueueConfigurations())
+         {
+            String name = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(config.getName()).toString();
+            unit.addAttachment(name, createJMSBasicBean(unit, HornetQQueueDeployment.class.getName(), name, config));
+         }
+   
+         for (TopicConfiguration config : mainConfig.getTopicConfigurations())
+         {
+            String name = ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(config.getName()).toString(); 
+            unit.addAttachment(name, createJMSBasicBean(unit, HornetQTopicDeployment.class.getName(), name, config));
+         }
+   
+         for (ConnectionFactoryConfiguration config : mainConfig.getConnectionFactoryConfigurations())
+         {
+            String name = "org.hornetq:module=JMS,name=\"" + config.getName() + "\",type=ConnectionFactory";
+            unit.addAttachment(name, createJMSBasicBean(unit, HornetQConnectionFactoryDeployment.class.getName(), name, config));
+         }
+      }
+      catch (Exception e)
+      {
+         throw new DeploymentException (e.getMessage(), e);
+      }
+   }
+
+   /**
+    * @param name
+    */
+   private static BeanMetaData createJMSBasicBean(DeploymentUnit unit, String configClass, String name, Object config)
+   {
+      BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(name, configClass);
+
+      builder.addPropertyMetaData("name", name);
+
+      builder.addPropertyMetaData("jmsServer", builder.createInject("JMSServerManager"));
+      
+      builder.addPropertyMetaData("config", config);
+
+      // runtime control registry
+      builder.addPropertyMetaData("kernel", builder.createInject(KernelConstants.KERNEL_NAME));
+      
+      builder.addPropertyMetaData("mbeanServer", builder.createInject("MBeanServer"));
+      
+      for (Map.Entry<String, Object> entry : unit.getAttachments().entrySet())
+      {
+         if (entry.getValue() instanceof BeanMetaData)
+         {
+            BeanMetaData checkBuilder = (BeanMetaData)entry.getValue();
+            if (checkBuilder.getBean().equals(HornetQCoreDeployment.class.getName()))
+            {
+               // If there is any core deployment on the same deployment unit, it needs to be deployed first.
+               // So we add a dependency here
+               builder.addDependency(entry.getKey());
+            }
+         }
+      }
+      
+      return builder.getBeanMetaData();
+   }
+
+   
+}
+

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/DestinationFactoryDeployerPlugin.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/DestinationFactoryDeployerPlugin.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/DestinationFactoryDeployerPlugin.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.jms.Queue;
+import javax.jms.Topic;
+
+import org.hornetq.api.core.management.ObjectNameBuilder;
+import org.hornetq.jms.server.JMSServerManager;
+import org.hornetq.jms.server.config.JMSConfiguration;
+import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;
+import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
+import org.hornetq.jms.server.config.impl.TopicConfigurationImpl;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.ejb.deployers.CreateDestinationFactory;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigPropertiesMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData;
+
+/**
+ * An integration point for the EJB deployers on creating destinations
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="clebert.suconic at jboss.com">Clebert Suconic</a>
+ * @version $Revision: 82920 $
+ */
+public class DestinationFactoryDeployerPlugin implements
+      CreateDestinationFactory
+{
+
+   private static final Logger log = Logger
+         .getLogger(DestinationFactoryDeployerPlugin.class);
+
+   private JMSServerManager jmsManager;
+
+   private AtomicInteger counter = new AtomicInteger(0);
+
+   public JMSServerManager getJmsManager()
+   {
+      return jmsManager;
+   }
+
+   public void setJmsManager(JMSServerManager jmsManager)
+   {
+      this.jmsManager = jmsManager;
+   }
+
+   public Object create(DeploymentUnit unit, JBossMessageDrivenBeanMetaData mdb)
+         throws DeploymentException
+   {
+      String destinationName = null;
+      String destinationType = null;
+
+      ActivationConfigMetaData activationConfig = mdb.getActivationConfig();
+      if (activationConfig != null)
+      {
+         ActivationConfigPropertiesMetaData properties = activationConfig
+               .getActivationConfigProperties();
+         if (properties != null)
+         {
+            destinationName = getActivationConfigProperty(properties,
+                  "destination");
+            destinationType = getActivationConfigProperty(properties,
+                  "destinationType");
+         }
+      }
+      
+      if (destinationName == null)
+      {
+         destinationName = mdb.getDestinationJndiName();
+      }
+      
+      // TODO message-destination-link?
+
+      log.info("Deploying destination " + destinationName);
+
+      if (destinationName == null || destinationName.trim().length() == 0)
+      {
+         log.warn("Unable to determine destination for " + mdb.getName());
+         return false;
+      }
+      boolean isTopic = false;
+      JMSConfiguration config = new JMSConfigurationImpl();
+      
+      String noSlashesName = destinationName.substring(destinationName.lastIndexOf('/') + 1);
+      
+
+      if (destinationType == null)
+      {
+         log.warn("Unable to determine destination type for " + mdb.getName());
+         return false;
+      } else if (destinationType.equals(Queue.class.getName()))
+      {
+         config.getQueueConfigurations().add(
+               new JMSQueueConfigurationImpl(noSlashesName, null, true,
+                     "queue/" + noSlashesName, destinationName));
+      } else if (destinationType.equals(Topic.class.getName()))
+      {
+         config.getTopicConfigurations().add(
+               new TopicConfigurationImpl(noSlashesName, "topic/"+ noSlashesName, destinationName));
+         isTopic = true;
+      } else
+      {
+         log.warn("Unknown destination type '" + destinationType + "' for "
+               + mdb.getName());
+         return false;
+      }
+
+      Set<String> mdbDependencies = mdb.getDepends();
+      if (mdbDependencies == null)
+      {
+         mdbDependencies = new HashSet<String>();
+         mdb.setDepends(mdbDependencies);
+      }
+
+      try
+      {
+         if (isTopic)
+         {
+            mdbDependencies.add(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(
+                  noSlashesName).toString());
+         } else
+         {
+            mdbDependencies.add(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(
+                  noSlashesName).toString());
+         }
+      } catch (Exception e)
+      {
+         log.warn(e.getMessage(), e);
+      }
+
+      DeploymentFactory.getInstance().deployJMS(unit, config);
+
+      //todo what should we return
+      return unit;
+   }
+
+   /**
+    * Get an activation config property
+    * 
+    * @param properties
+    *           the properties
+    * @param name
+    *           the name
+    * @return the property or null if not found
+    */
+   protected static String getActivationConfigProperty(
+         ActivationConfigPropertiesMetaData properties, String name)
+   {
+      ActivationConfigPropertyMetaData property = properties.get(name);
+      if (property == null)
+         return null;
+      return property.getValue();
+   }
+
+   public Class<?> getOutput()
+   {
+      return JMSConfiguration.class;
+   }
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQConfigParserDeployer.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQConfigParserDeployer.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQConfigParserDeployer.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers;
+
+import java.io.InputStream;
+
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.deployers.impl.FileConfigurationParser;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * This Deployer will take either {@code hornetq-configuration.xml} or {@code horneq-queues.xml}, parse it, create a Configuration object,
+ * and attach the Configuration output into the deployment unit.
+ * 
+ * Another deployer, {@code HornetQCoreConfigRealDeployer}, which takes Configuration as an input will then take over and deploy the resources.
+
+ * @see HornetQCoreConfigRealDeployer
+ * 
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * 
+ */
+public class HornetQConfigParserDeployer extends AbstractVFSParsingDeployer<Configuration>
+{
+
+   private static final Logger log = Logger.getLogger(HornetQConfigParserDeployer.class);
+
+   private final FileConfigurationParser parser;
+
+   public HornetQConfigParserDeployer(final String name)
+   {
+      super(Configuration.class);
+
+      this.parser = new FileConfigurationParser();
+      
+      this.setSuffix(name);
+   }
+   
+   
+
+   @Override
+   protected Configuration parse(VFSDeploymentUnit unit, VirtualFile file, Configuration root) throws Exception
+   {
+
+      InputStream deploymentStream = null;
+
+      try
+      {
+         deploymentStream = file.openStream();
+         Configuration config = parser.parseMainConfig(deploymentStream);
+        
+         if (log.isTraceEnabled())
+         {
+            log.trace("Parser parsed Main Config = " + config);
+         }
+
+         return config;
+      } finally
+      {
+         try
+         {
+            deploymentStream.close();
+         } catch (Exception ignored)
+         {
+         }
+      }
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQCoreConfigRealDeployer.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQCoreConfigRealDeployer.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQCoreConfigRealDeployer.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.hornetq.core.config.Configuration;
+import org.jboss.as.integration.hornetq.deployers.pojo.HornetQCoreDeployment;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+
+/**
+ * This deployer is called directly by the VFS Deployment Framework, as the Input object
+ * for this is a Configuration class.
+ * 
+ * In regular flow, {@code HornetQConfigParserDeployer} will have parse HornetQ XML configuration files and created {@code Configuration} outputs.
+ * <br>
+ * In an alternate flow, other deployers (e.g. TorqueBox) may instantiate a Configuration object directly and this deployer will take over after.
+ * <p>
+ * The <strong>only resources deployed by this deployer</strong> are:
+ * <ul>
+ *   <li>core queues ({@link Configuration#getQueueConfigurations()}</li> 
+ *   <li>address settings ({@link Configuration#getAddressesSettings()}</li> 
+ *   <li>security roles ({@link Configuration#getSecurityRoles()}</li> 
+ * </ul>
+ * Other attributes of the Configuration are not deployed by these deployers.
+ * 
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * 
+ */
+public class HornetQCoreConfigRealDeployer extends AbstractSimpleRealDeployer<Configuration>
+{
+
+    private final AtomicInteger idGenerator = new AtomicInteger(1);
+
+    public HornetQCoreConfigRealDeployer()
+    {
+        super(Configuration.class);
+        addOutput(BeanMetaData.class);
+        
+        // This is just to guarantee the order. JBossMetaData deployment should happen before
+        addInput(JBossMetaData.class);
+    }
+
+    /** 
+     * Actual deployment to HornetQ is done in {@link HornetQCoreDeployment#start()}
+     */
+    @Override
+    public void deploy(DeploymentUnit unit, Configuration config) throws DeploymentException
+    {
+       if (log.isTraceEnabled())
+       {
+          log.trace("Deploying unit: " + unit + " with config " + config);
+       }
+        String name = "HornetQCoreDeployment::" + idGenerator.incrementAndGet();
+        
+        BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(name, HornetQCoreDeployment.class.getName());
+
+        builder.addPropertyMetaData("name", name);
+
+        builder.addPropertyMetaData("server", builder.createInject("HornetQServer"));
+        
+        builder.addPropertyMetaData("config", config);
+
+        BeanMetaData bean = builder.getBeanMetaData();
+
+        unit.addAttachment(name, bean);
+    }
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSParserDeployer.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSParserDeployer.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSParserDeployer.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers;
+
+import org.hornetq.jms.server.JMSServerConfigParser;
+import org.hornetq.jms.server.config.JMSConfiguration;
+import org.hornetq.jms.server.impl.JMSServerConfigParserImpl;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
+
+import java.io.InputStream;
+
+
+/**
+ * This deployer will take a {@code hornetq-jms.xml} configuration file, parse it, create a {@code JMSConfiguration} object and
+ * attach it to the deployment unit.
+ * 
+ * Another deployer, {@code HornetQJMSRealDeployer}, which takes JMSConfiguration as an input will then take over and deploy the
+ * JMS resources.
+ * 
+ * @see HornetQJMSRealDeployer
+ * 
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * 
+ */
+public class HornetQJMSParserDeployer extends AbstractVFSParsingDeployer<JMSConfiguration>
+{
+
+    private static final Logger log = Logger.getLogger(HornetQJMSParserDeployer.class);
+
+    public static final String FILENAME = "hornetq-jms.xml";
+
+    private final JMSServerConfigParser jmsConfigParser;
+
+    public HornetQJMSParserDeployer()
+    {
+        super(JMSConfiguration.class);
+
+        this.jmsConfigParser = new JMSServerConfigParserImpl();
+        
+        setSuffix(FILENAME);
+    }
+    
+    @Override
+    protected JMSConfiguration parse(VFSDeploymentUnit unit, VirtualFile file, JMSConfiguration root) throws Exception
+    {
+
+        InputStream deploymentStream = null;
+
+        try
+        {
+            deploymentStream = file.openStream();
+            JMSConfiguration config = jmsConfigParser.parseConfiguration(deploymentStream);
+            if (log.isTraceEnabled())
+            {
+               log.trace("JMS config parser parsed config = " + config);
+            }
+            return config;
+        } finally
+        {
+            try
+            {
+                deploymentStream.close();
+            } catch (Exception ignored)
+            {
+            }
+        }
+    }
+    
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSRealDeployer.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSRealDeployer.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/HornetQJMSRealDeployer.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers;
+
+import org.hornetq.jms.server.config.JMSConfiguration;
+import org.jboss.as.integration.hornetq.deployers.pojo.HornetQCoreDeployment;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+
+/**
+ * This deployer is called directly by the VFS Deployment Framework, as the Input object for this is a JMSConfiguration class.
+ * 
+ * In regular flow, {@code HornetQJMSParserDeployerr} will have parse hornetq-jms.xml configuration files and created {@code JMSConfiguration} outputs.
+ * <br>
+ * In an alternate flow, other deployers (e.g. TorqueBox) may instantiate a JMSConfiguration object directly and this deployer will take over after.
+ * 
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ */
+public class HornetQJMSRealDeployer extends AbstractSimpleRealDeployer<JMSConfiguration>
+{
+   public HornetQJMSRealDeployer()
+   {
+      super(JMSConfiguration.class);
+
+      // This is just to guarantee the order. The CoreDeployments should happen before
+      addInput(HornetQCoreDeployment.class);
+      // This is just to guarantee the order. JBossMetaData deployment should happen before
+      addInput(JBossMetaData.class);
+
+      addOutput(BeanMetaData.class);
+   }
+   
+   @Override
+   public void deploy(DeploymentUnit unit, JMSConfiguration mainConfig) throws DeploymentException
+   {
+      if (log.isTraceEnabled())
+      {
+         log.trace("Deploying unit " + unit + " with config " + mainConfig);
+      }
+      DeploymentFactory.getInstance().deployJMS(unit, mainConfig);
+   }
+   
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/AbstractHornetQControlReferenceDeployment.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/AbstractHornetQControlReferenceDeployment.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/AbstractHornetQControlReferenceDeployment.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,108 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.deployers.pojo;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.as.integration.hornetq.management.HornetQControlRuntimeDispatchPlugin;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.logging.Logger;
+
+/**
+ * The abstract control reference deployment. This registers a {@code KernelRegistryEntry}
+ * based on the deployment name, which is used to handle runtime dispatching from the 
+ * ProfileService {@code RuntimeComponentDispatcher}.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+ at SuppressWarnings("deprecation")
+public class AbstractHornetQControlReferenceDeployment
+{
+
+   /** The logger. */
+   private static final Logger log = Logger.getLogger("org.jboss.as.integration.hornetq.management");
+   
+   /** The jboss kernel. */
+   private Kernel kernel;
+   
+   /** The mbean server. */
+   private MBeanServer mbeanServer;
+   
+   public Kernel getKernel()
+   {
+      return kernel;
+   }
+   
+   public void setKernel(Kernel kernel)
+   {
+      this.kernel = kernel;
+   }
+   
+   public MBeanServer getMbeanServer()
+   {
+      return mbeanServer;
+   }
+   
+   public void setMbeanServer(MBeanServer mbeanServer)
+   {
+      this.mbeanServer = mbeanServer;
+   }
+   
+   protected void registerControlReference(ObjectName objectName)
+   {
+      try
+      {
+         getKernelRegistry().registerEntry(objectName, 
+               new HornetQControlRuntimeDispatchPlugin(objectName, mbeanServer));
+      }
+      catch(Exception e)
+      {
+         log.debug("failed to register hornetQ control runtime dispatcher plugin", e);
+      }
+   }
+   
+   protected void unregisterControlReference(ObjectName objectName)
+   {
+      try
+      {
+         getKernelRegistry().unregisterEntry(objectName);
+      }
+      catch(Exception e)
+      {
+         log.debug("failed to unregister hornetQ control runtime dispatcher plugin", e);
+      }
+   }
+   
+   protected KernelRegistry getKernelRegistry()
+   {
+      if(kernel == null)
+      {
+         throw new IllegalStateException("null kernel");
+      }
+      return kernel.getRegistry();
+   }
+   
+}
+

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQConnectionFactoryDeployment.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQConnectionFactoryDeployment.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQConnectionFactoryDeployment.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.as.integration.hornetq.deployers.pojo;
+
+import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
+import org.jboss.logging.Logger;
+
+import javax.management.ObjectName;
+
+public class HornetQConnectionFactoryDeployment extends HornetQJMSDeployment<ConnectionFactoryConfiguration>
+{
+   private static final Logger log = Logger.getLogger(HornetQConnectionFactoryDeployment.class);
+
+   @Override
+   public void start() throws Exception
+   {
+      log.debug("Deploying ConnectionFactory " + config.getName());
+      try
+      {
+         jmsServer.createConnectionFactory(false, config, config.getBindings());
+         
+         // Register the Control MBean in MC
+         registerControlReference(new ObjectName("org.hornetq:module=JMS,name=\"" + config.getName() + "\",type=ConnectionFactory"));
+         
+      } catch (Exception e)
+      {
+         log.warn("Error deploying ConnectionFactory: " + config.getName(), e);
+         throw e;
+      }
+   }
+
+   @Override
+   public void stop() throws Exception
+   {
+      log.debug("Destroying ConnectionFactory " + config.getName());
+      try
+      {
+         unregisterControlReference(new ObjectName("org.hornetq:module=JMS,name=\"" + config.getName() + "\",type=ConnectionFactory"));
+         
+         jmsServer.destroyConnectionFactory(config.getName());
+      } 
+      catch (Exception e)
+      {
+         log.warn("Error destroying ConnectionFactory: " + config.getName(), e);
+      }
+   }
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQCoreDeployment.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQCoreDeployment.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQCoreDeployment.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers.pojo;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.CoreQueueConfiguration;
+import org.hornetq.core.security.Role;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.settings.impl.AddressSettings;
+import org.jboss.as.integration.hornetq.deployers.HornetQJMSRealDeployer;
+import org.jboss.beans.metadata.api.annotations.Start;
+import org.jboss.beans.metadata.api.annotations.Stop;
+import org.jboss.logging.Logger;
+
+/**
+ * 
+ * Objects of this class are created by the MicroContainer through
+ * BeanMetadataClass at {@link HornetQCoreRealDeployer}
+ * 
+ * @see HornetQJMSRealDeployer
+ * */
+public class HornetQCoreDeployment
+{
+
+   private static final Logger log = Logger.getLogger(HornetQCoreDeployment.class);
+
+   private HornetQServer server;
+
+   private String name;
+
+   private Configuration config;
+
+   public Configuration getJmsConfig()
+   {
+      return config;
+   }
+
+   public void setConfig(Configuration config)
+   {
+      this.config = config;
+   }
+
+   public HornetQServer getServer()
+   {
+      return server;
+   }
+
+   public void setServer(HornetQServer server)
+   {
+      this.server = server;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   /**
+    * AS6 deployers will deploy HornetQ Core resources from hornetq-configuration and hornetq-queues.xml files.
+    * The deployed resources are:
+    * <ul>
+    *   <li>core queues ({@link Configuration#getQueueConfigurations()}</li> 
+    *   <li>address settings ({@link Configuration#getAddressesSettings()}</li> 
+    *   <li>security roles ({@link Configuration#getSecurityRoles()}</li> 
+    * </ul>
+    * Other attributes of the Configuration are not deployed by these deployers.
+    * 
+    */
+   @Start
+   public void start()
+   {
+      if (log.isTraceEnabled())
+      {
+         log.trace(this.name + " is being started");
+      }
+
+      for (Map.Entry<String, AddressSettings> entry : config.getAddressesSettings().entrySet())
+      {
+         server.getAddressSettingsRepository().addMatch(entry.getKey(), entry.getValue());
+      }
+
+      for (Map.Entry<String, Set<Role>> entry : config.getSecurityRoles().entrySet())
+      {
+         server.getSecurityRepository().addMatch(entry.getKey(), entry.getValue());
+      }
+
+      for (CoreQueueConfiguration coreQueue : config.getQueueConfigurations())
+      {
+         try
+         {
+            server.deployQueue(new SimpleString(coreQueue.getAddress()),
+            				   new SimpleString(coreQueue.getName()),
+            				   SimpleString.toSimpleString(coreQueue.getFilterString()),
+            				   coreQueue.isDurable(),
+            				   false);
+         }
+         catch (Exception e)
+         {
+            log.warn("Error on creating queue " + coreQueue.getName() + " address = " + coreQueue.getAddress(), e);
+         }
+      }
+   }
+
+   @Stop
+   public void stop()
+   {
+      if (log.isTraceEnabled())
+      {
+         log.trace(this.name + " is being stopped");
+      }
+
+      for (String entry : config.getAddressesSettings().keySet())
+      {
+         server.getAddressSettingsRepository().removeMatch(entry);
+      }
+
+      for (String entry : config.getSecurityRoles().keySet())
+      {
+         server.getSecurityRepository().removeMatch(entry);
+      }
+      
+      
+      // Undeploy core queues means nothing on core queues, so no need to do anything here
+   }
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQJMSDeployment.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQJMSDeployment.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQJMSDeployment.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers.pojo;
+
+import org.hornetq.jms.server.JMSServerManager;
+import org.jboss.as.integration.hornetq.deployers.HornetQJMSRealDeployer;
+import org.jboss.logging.Logger;
+
+/**
+ * 
+ * Objects of this class are created by the MicroContainer through
+ * BeanMetadataClass at {@link HornetQJMSRealDeployer}
+ * 
+ * @see HornetQJMSRealDeployer
+ * */
+public abstract class HornetQJMSDeployment<T> extends AbstractHornetQControlReferenceDeployment
+{
+
+   private static final Logger log = Logger.getLogger(HornetQJMSDeployment.class);
+
+   protected JMSServerManager jmsServer;
+
+   protected String name;
+   
+   protected T config;
+   
+   public T getConfig()
+   {
+      return config;
+   }
+   
+   public void setConfig(T config)
+   {
+      this.config = config;
+   }
+
+   public JMSServerManager getJmsServer()
+   {
+      return jmsServer;
+   }
+
+   public void setJmsServer(JMSServerManager jmsServer)
+   {
+      this.jmsServer = jmsServer;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public abstract void start() throws Exception;
+
+   public abstract void stop() throws Exception;
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQQueueDeployment.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQQueueDeployment.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQQueueDeployment.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers.pojo;
+
+import org.hornetq.api.core.management.ObjectNameBuilder;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.jboss.logging.Logger;
+
+import javax.management.ObjectName;
+
+public class HornetQQueueDeployment extends HornetQJMSDeployment<JMSQueueConfiguration>
+{
+   private static final Logger log = Logger.getLogger(HornetQQueueDeployment.class);
+
+   @Override
+   public void start() throws Exception
+   {
+      try
+      {
+         
+         log.debug("Deploying Queue " + config.getName());
+         jmsServer.createQueue(false, config.getName(), config.getSelector(), config.isDurable(), config.getBindings());
+         
+         // Register the Control MBean in MC
+         registerControlReference(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(config.getName()));
+         
+      } catch (Exception e)
+      {
+         log.warn("Error deploying Queue: " + config.getName(), e);
+         throw e;
+      }
+   }
+
+   @Override
+   public void stop() throws Exception
+   {
+      log.debug("Undeploying queue " + config.getName());
+      
+      unregisterControlReference(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(config.getName()));
+      
+      jmsServer.removeQueueFromJNDI(config.getName());
+      
+   }
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQTopicDeployment.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQTopicDeployment.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/deployers/pojo/HornetQTopicDeployment.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.deployers.pojo;
+
+import org.hornetq.api.core.management.ObjectNameBuilder;
+import org.hornetq.jms.server.config.TopicConfiguration;
+import org.jboss.logging.Logger;
+
+import javax.management.ObjectName;
+
+public class HornetQTopicDeployment extends HornetQJMSDeployment<TopicConfiguration>
+{
+   private static final Logger log = Logger.getLogger(HornetQTopicDeployment.class);
+
+   @Override
+   public void start() throws Exception
+   {
+      log.debug("Deploying Topic " + config.getName());
+      try
+      {
+         jmsServer.createTopic(false, config.getName(), config.getBindings());
+         registerControlReference(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(config.getName()));
+      }
+      catch (Exception e)
+      {
+         log.warn("Error deploying Topic: " + config.getName(), e);
+         throw e;
+      }
+   }
+
+   @Override
+   public void stop() throws Exception
+   {
+      log.debug("Undeploying Topic " + config.getName());
+      try
+      {
+         unregisterControlReference(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(config.getName()));
+         
+         jmsServer.removeTopicFromJNDI(config.getName());
+      }
+      catch (Exception e)
+      {
+         log.warn("Error destroying Topic: " + config.getName(), e);
+      }
+   }
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/HornetQControlRuntimeDispatchPlugin.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/HornetQControlRuntimeDispatchPlugin.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/HornetQControlRuntimeDispatchPlugin.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,221 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.management;
+
+import java.util.Collections;
+import java.util.Set;
+
+import javax.management.Attribute;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.dependency.plugins.AbstractScopeInfo;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.dependency.spi.ControllerMode;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.ErrorHandlingMode;
+import org.jboss.dependency.spi.ScopeInfo;
+import org.jboss.dependency.spi.dispatch.InvokeDispatchContext;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.util.JBossObject;
+import org.jboss.util.JBossStringBuilder;
+import org.jboss.util.NotImplementedException;
+
+/**
+ * A runtime dispatcher plugin, used to delegate requests from the ProfileService
+ * {@code RuntimeComponentDispatcher} to the MBeanServer. This is a needed when
+ * MBeans are directly installed using the MBeanServer, not using the mc-jmx-int. 
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class HornetQControlRuntimeDispatchPlugin extends JBossObject implements KernelRegistryEntry, InvokeDispatchContext
+{
+   
+   /** The object name. */
+   private final ObjectName objectName;
+   
+   /** The mbean server. */
+   private final MBeanServer mbeanServer;
+
+   public HornetQControlRuntimeDispatchPlugin(ObjectName objectName, MBeanServer mbeanServer)
+   {
+      if(objectName == null)
+      {
+         throw new IllegalArgumentException("null object name");
+      }
+      if(mbeanServer == null)
+      {
+         throw new IllegalArgumentException("null mbean server");
+      }
+      this.objectName = objectName;
+      this.mbeanServer = mbeanServer;
+   }
+   
+   public Object get(String name) throws Throwable
+   {
+      return mbeanServer.getAttribute(objectName, getAttributeName(name));
+   }
+   
+   public void set(String name, Object value) throws Throwable
+   {
+      Attribute attribute = new Attribute(getAttributeName(name), value);
+      mbeanServer.setAttribute(objectName, attribute);
+   }
+   
+   public Object invoke(String name, Object[] parameters, String[] signature) throws Throwable
+   {
+      return mbeanServer.invoke(objectName, name, parameters, signature);
+   }
+
+   public ClassLoader getClassLoader() throws Throwable
+   {
+      return mbeanServer.getClassLoader(objectName);
+   }
+   
+   public Object getName()
+   {
+      return this.objectName;
+   }
+   
+   public void setName(Object name)
+   {
+      // 
+   }
+
+   protected static String getAttributeName(String name)
+   {
+      if (name == null || name.length() == 0)
+         throw new IllegalArgumentException("Illegal name: " + name);
+
+      char firstCharacter = name.charAt(0);
+      if (Character.isLowerCase(firstCharacter))
+      {
+         String attributeName = String.valueOf(Character.toUpperCase(firstCharacter));
+         if (name.length() > 1)
+            attributeName += name.substring(1);
+         return attributeName;
+      }
+      return name;
+   }
+   
+   public Set<Object> getAliases()
+   {
+      return Collections.emptySet();
+   }
+   
+   public Controller getController()
+   {
+      throw new NotImplementedException("getController");
+   }
+
+   public DependencyInfo getDependencyInfo()
+   {
+      return null;
+   }
+
+   public ScopeInfo getScopeInfo()
+   {
+      return new AbstractScopeInfo(getName(), null);
+   }
+   
+   public Object getTarget()
+   {
+      return null;
+   }
+   
+   public Throwable getError()
+   {
+      throw new NotImplementedException("getError");
+   }
+
+   public ControllerState getState()
+   {
+      // Specify this for the runtime state mapping
+      boolean registered = mbeanServer.isRegistered(objectName);
+      return registered ? ControllerState.INSTALLED : ControllerState.NOT_INSTALLED;
+   }
+   
+   public void setState(ControllerState state)
+   {
+      throw new org.jboss.util.NotImplementedException("setState");
+   }
+
+   public ControllerState getRequiredState()
+   {
+      // Specify this for the runtime state mapping
+      return ControllerState.INSTALLED;
+   }
+
+   public void setRequiredState(ControllerState state)
+   {
+      throw new NotImplementedException("setRequiredState");
+   }
+   
+   public ControllerMode getMode()
+   {
+      return ControllerMode.MANUAL;
+   }
+   
+   public void setMode(ControllerMode mode)
+   {
+      throw new NotImplementedException("setMode");
+   }
+
+   public ErrorHandlingMode getErrorHandlingMode()
+   {
+      return ErrorHandlingMode.DISCARD;
+   }
+
+   public void install(ControllerState fromState, ControllerState toState) throws Throwable
+   {
+      throw new NotImplementedException("install");
+   }
+
+   public void setController(Controller controller)
+   {
+      throw new NotImplementedException("setController");
+   }
+
+   public void setError(Throwable error)
+   {
+      throw new NotImplementedException("NYI setError");
+   }
+
+   public void uninstall(ControllerState fromState, ControllerState toState)
+   {
+      throw new NotImplementedException("uninstall");
+   }
+
+   public void toString(JBossStringBuilder buffer)
+   {
+      buffer.append("target=").append(objectName);
+   }
+   
+   public void toShortString(JBossStringBuilder buffer)
+   {
+      buffer.append(objectName);
+   }
+   
+}
+

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/AddressSettingsMapper.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,216 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.hornetq.api.core.management.AddressSettingsInfo;
+import org.hornetq.api.core.management.RoleInfo;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.jms.server.config.TopicConfiguration;
+import org.jboss.metatype.api.types.*;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ * Created 15-Mar-2010
+ */
+public class AddressSettingsMapper extends MetaMapper<Object[]>
+{
+   public static final CompositeMetaType ADDRESS_SETTINGS_TYPE;
+   public static final CompositeMetaType SECURITY_TYPE;
+   public static final CollectionMetaType TYPE;
+
+   static
+   {
+      String[] securityNames = {
+         "name",
+            "send",
+            "consume",
+            "createDurableQueue",
+            "deleteDurableQueue",
+            "createNonDurableQueue",
+            "deleteNonDurableQueue",
+            "manage"
+      };
+      String[] securityDescription = {
+         "name",
+            "send",
+            "consume" ,
+            "createDurableQueue",
+            "deleteDurableQueue",
+            "createNonDurableQueue",
+            "deleteNonDurableQueue",
+            "manage"
+      };
+      MetaType[] securityTypes = {
+      SimpleMetaType.STRING,
+      SimpleMetaType.BOOLEAN_PRIMITIVE,
+      SimpleMetaType.BOOLEAN_PRIMITIVE,
+      SimpleMetaType.BOOLEAN_PRIMITIVE,
+      SimpleMetaType.BOOLEAN_PRIMITIVE,
+      SimpleMetaType.BOOLEAN_PRIMITIVE,
+      SimpleMetaType.BOOLEAN_PRIMITIVE,
+      SimpleMetaType.BOOLEAN_PRIMITIVE
+      };
+      SECURITY_TYPE = new ImmutableCompositeMetaType("org.hornetq.api.core.management.RoleInfo", "Roles", securityNames, securityDescription, securityTypes);
+
+      TYPE = new CollectionMetaType("java.util.List", SECURITY_TYPE);
+      String[] itemNames = {
+          "name",
+          "jndiBindings",
+          "dla",
+          "expiryAddress",
+          "maxSize",
+          "pageSize",
+          "maxDeliveryAttempts",
+          "redeliveryDelay",
+          "lastValueQueue",
+          "redistributionDelay",
+          "sendToDLAOnNoRoute",
+          "addressFullMessagePolicy",
+          "roles"
+      };
+      String[] itemDescriptions = {
+          "name",
+          "jndiBindings",
+          "dla",
+          "expiryAddress",
+          "maxSize",
+          "pageSize",
+          "maxDeliveryAttempts",
+          "redeliveryDelay",
+          "lastValueQueue",
+          "redistributionDelay",
+          "sendToDLAOnNoRoute",
+          "addressFullMessagePolicy",
+          "roles"
+      };
+      MetaType[] itemTypes = {
+          SimpleMetaType.STRING,
+          SimpleMetaType.STRING,
+          SimpleMetaType.STRING,
+          SimpleMetaType.STRING,
+          SimpleMetaType.INTEGER_PRIMITIVE,
+          SimpleMetaType.INTEGER_PRIMITIVE,
+          SimpleMetaType.INTEGER_PRIMITIVE,
+          SimpleMetaType.LONG_PRIMITIVE,
+          SimpleMetaType.BOOLEAN_PRIMITIVE,
+          SimpleMetaType.LONG_PRIMITIVE,
+          SimpleMetaType.BOOLEAN_PRIMITIVE,
+          SimpleMetaType.STRING,
+          TYPE
+      };
+      ADDRESS_SETTINGS_TYPE = new ImmutableCompositeMetaType("org.hornetq.api.core.management.AddressSettingsInfo", "Address Settings",
+          itemNames, itemDescriptions, itemTypes);
+   }
+
+   @Override
+   public MetaValue createMetaValue(MetaType metaType, Object[] val)
+   {
+      CompositeValueSupport cvs = new CompositeValueSupport(ADDRESS_SETTINGS_TYPE);
+      if (val[0] instanceof JMSQueueConfiguration)
+      {
+         JMSQueueConfiguration queueConfiguration = (JMSQueueConfiguration) val[0];
+         cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, queueConfiguration.getName()));
+         cvs.set("jndiBindings", new SimpleValueSupport(SimpleMetaType.STRING, getJndiString(queueConfiguration.getBindings())));
+      }
+      else
+      {
+         TopicConfiguration topicConfiguration = (TopicConfiguration) val[0];
+         cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, topicConfiguration.getName()));
+         cvs.set("jndiBindings", new SimpleValueSupport(SimpleMetaType.STRING, getJndiString(topicConfiguration.getBindings())));
+      }
+      AddressSettingsInfo addressSettings = (AddressSettingsInfo) val[1];
+      cvs.set("dla", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getDeadLetterAddress()));
+      cvs.set("expiryAddress", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getExpiryAddress()));
+      cvs.set("maxSize", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getMaxSizeBytes()));
+      cvs.set("pageSize", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getPageSizeBytes()));
+      cvs.set("maxDeliveryAttempts", new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, addressSettings.getMaxDeliveryAttempts()));
+      cvs.set("redeliveryDelay", new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, addressSettings.getRedeliveryDelay()));
+      cvs.set("lastValueQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, addressSettings.isLastValueQueue()));
+      cvs.set("redistributionDelay", new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, addressSettings.getRedistributionDelay()));
+      cvs.set("sendToDLAOnNoRoute", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, addressSettings.isSendToDLAOnNoRoute()));
+      cvs.set("addressFullMessagePolicy", new SimpleValueSupport(SimpleMetaType.STRING, addressSettings.getAddressFullMessagePolicy()));
+      if(val.length == 3)
+      {
+         ArrayList<MetaValue> tmp = new ArrayList<MetaValue>();
+         RoleInfo[] roles = (RoleInfo[]) val[2];
+         for (RoleInfo role : roles)
+         {
+            CompositeValueSupport cvs2 = new CompositeValueSupport(SECURITY_TYPE);
+            cvs2.set("name", new SimpleValueSupport(SimpleMetaType.STRING, role.getName()));
+            cvs2.set("send", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isSend()));
+            cvs2.set("consume", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isConsume()));
+            cvs2.set("createDurableQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isCreateDurableQueue()));
+            cvs2.set("deleteDurableQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isDeleteDurableQueue()));
+            cvs2.set("createNonDurableQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isCreateNonDurableQueue()));
+            cvs2.set("deleteNonDurableQueue", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isDeleteNonDurableQueue()));
+            cvs2.set("manage", new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, role.isManage()));
+            tmp.add(cvs2);
+         }
+         MetaValue[] elements = new MetaValue[tmp.size()];
+         tmp.toArray(elements);
+         CollectionValueSupport sec = new CollectionValueSupport(TYPE, elements);
+         cvs.set("roles", sec);
+      }
+      return cvs;
+   }
+
+   @Override
+   public Object[] unwrapMetaValue(MetaValue metaValue)
+   {
+      return null;
+   }
+
+   @Override
+   public Type mapToType()
+   {
+      return Object[].class;
+   }
+
+   @Override
+   public MetaType getMetaType()
+   {
+      return ADDRESS_SETTINGS_TYPE;
+   }
+
+   private String getJndiString(String[] array)
+   {
+      StringBuffer sb = new StringBuffer();
+      for (int i = 0, arrayLength = array.length; i < arrayLength; i++)
+      {
+         if (i > 0)
+         {
+            sb.append(",");
+         }
+         sb.append(array[i]);
+      }
+      return sb.toString();
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryManageMO.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryManageMO.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryManageMO.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,317 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2010, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.hornetq.api.core.management.ResourceNames;
+import org.hornetq.api.jms.management.ConnectionFactoryControl;
+import org.hornetq.api.jms.management.JMSServerControl;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.management.ManagementService;
+import org.jboss.managed.api.annotation.*;
+import org.jboss.metatype.api.annotations.MetaMapping;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ *         Created Mar 19, 2010
+ */
+ at ManagementObject(componentType = @ManagementComponent(type = "JMSManage", subtype = "ConnectionFactoryManage"),
+    properties = ManagementProperties.EXPLICIT, isRuntime = true)
+public class ConnectionFactoryManageMO extends JMSManageMO
+{
+   public ConnectionFactoryManageMO(HornetQServer server)
+   {
+      super(server);
+      this.server = server;
+   }
+
+   private JMSServerControl jmsServerControl;
+
+   private ManagementService managementService;
+
+   private HornetQServer server;
+
+   public void start()
+   {
+      managementService = server.getManagementService();
+      jmsServerControl = (JMSServerControl) managementService.getResource(ResourceNames.JMS_SERVER);
+   }
+
+   @ManagementOperation(name = "deleteConnectionFactory", description = "returns the JMS Connection Factory configuration",
+       params = {@ManagementParameter(name = "name", description = "the connection factory name")})
+   public void deleteConnectionFactory(String name) throws Exception
+   {
+      jmsServerControl.destroyConnectionFactory(name);
+   }
+
+   @ManagementOperation(name = "getConfiguration", description = "returns the JMS Connection Factory configuration",
+       params = {@ManagementParameter(name = "name", description = "the connection factory name")})
+   @MetaMapping(value = ConnectionFactoryMapper.class)
+   public ConnectionFactoryControl getConfiguration(String name)
+   {
+      return (ConnectionFactoryControl) managementService.getResource("jms.connectionfactory." + name);
+   }
+
+   @ManagementOperation(name = "getMeasurements", description = "gets a connection factories",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "names", description = "the measurement names")})
+   public String[] getMeasurements(String name, String[] names) throws Exception
+   {
+      ConnectionFactoryControl control = (ConnectionFactoryControl) managementService.getResource("jms.connectionfactory." + name);
+      String[] val = new String[names.length];
+      for (int i = 0, valLength = val.length; i < valLength; i++)
+      {
+         Object o = control.getClass().getMethod(names[i]).invoke(control);
+         if(o instanceof Object[])
+         {
+            val[i] = coomaSeparatedString((Object[]) o);
+         }
+         else
+         {
+            val[i] = o.toString();
+         }
+      }
+      return val;
+   }
+
+
+   @ManagementOperation(name = "getConnectionFactories", description = "returns the JMS Connection Factories")
+   public String[] getJMSConnectionFactories()
+   {
+      return jmsServerControl.getConnectionFactoryNames();
+   }
+
+   @ManagementOperation(name = "createConnectionFactory", description = "creates a connection factories",
+       params = {
+           @ManagementParameter(name = "name", description = "the connection factory name"),
+           @ManagementParameter(name = "liveTransportClassNames", description = "comma-separated list of class names for transport to live servers"),
+           @ManagementParameter(name = "liveTransportParams", description = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)"),
+           @ManagementParameter(name = "backupTransportClassNames", description = "comma-separated list of class names for transport to backup servers"),
+           @ManagementParameter(name = "backupTransportParams", description = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)"),
+           @ManagementParameter(name = "bindings", description = "comma-separated list of JNDI bindings"),
+           @ManagementParameter(name = "discoveryAddress", description = "a discovery address"),
+           @ManagementParameter(name = "discoveryPort", description = "a discovery port"),
+           @ManagementParameter(name = "discoveryRefreshTimeout", description = "the discovery refresh timeout"),
+           @ManagementParameter(name = "clientId", description = "the client id"),
+           @ManagementParameter(name = "dupsOkBatchSize", description = "the batch size for DUPS_OK acknowledge mode"),
+           @ManagementParameter(name = "transactionBatchSize", description = "the transaction batch size"),
+           @ManagementParameter(name = "clientFailureCheckPeriod", description = "the client failure check period"),
+           @ManagementParameter(name = "connectionTTL", description = "the connection time to live"),
+           @ManagementParameter(name = "callTimeout", description = "the remote call timeout"),
+           @ManagementParameter(name = "consumerWindowSize", description = "the consumer window size"),
+           @ManagementParameter(name = "confirmationWindowSize", description = "the confirmation window size"),
+           @ManagementParameter(name = "producerMaxRate", description = "the produxer max rate"),
+           @ManagementParameter(name = "producerWindowSize", description = "the producer window size"),
+           @ManagementParameter(name = "cacheLargeMessageClient", description = "do we cache large messages on the client"),
+           @ManagementParameter(name = "minLargeMessageSize", description = "the minimum large message size"),
+           @ManagementParameter(name = "blockOnNonDurableSend", description = "do we block on non durable send"),
+           @ManagementParameter(name = "blockOnAcknowledge", description = "do we block on acknowledge"),
+           @ManagementParameter(name = "blockOnDurableSend", description = "do we block on durable send"),
+           @ManagementParameter(name = "autoGroup", description = "do we use autogroup"),
+           @ManagementParameter(name = "preAcknowledge", description = "do we pre acknowledge messages"),
+           @ManagementParameter(name = "maxRetryInterval", description = "the max retry interval"),
+           @ManagementParameter(name = "retryIntervalMultiplier", description = "the max retry interval multiplier"),
+           @ManagementParameter(name = "reconnectAttempts", description = "the reconnect attempts"),
+           @ManagementParameter(name = "failoverOnShutdown", description = "do we failover on a clean shutdown"),
+           @ManagementParameter(name = "scheduledThreadPoolMaxSize", description = "the pool size for scheduled threads"),
+           @ManagementParameter(name = "threadPoolMaxSize", description = "the pool size for threads"),
+           @ManagementParameter(name = "groupId", description = "the group id"),
+           @ManagementParameter(name = "initialMessagePacketSize", description = "the initial message packet size"),
+           @ManagementParameter(name = "useGlobalPools", description = "do we use global pools"),
+           @ManagementParameter(name = "retryInterval", description = "the retry interval"),
+           @ManagementParameter(name = "connectionLoadBalancingPolicyClassName", description = "the load balancing class")})
+   public void createConnectionFactory(String name,
+                                        final String liveTransportClassNames,
+                                        final String liveTransportParams,
+                                        final String backupTransportClassNames,
+                                        final String backupTransportParams, 
+                                        String bindings,
+                                        String discoveryAddress,
+                                        int discoveryPort,
+                                        long discoveryRefreshTimeout,
+                                        String clientId,
+                                        int dupsOkBatchSize,
+                                        int transactionBatchSize,
+                                        long clientFailureCheckPeriod,
+                                        long connectionTTL,
+                                        long callTimeout,
+                                        int consumerWindowSize,
+                                        int confirmationWindowSize,
+                                        int producerMaxRate,
+                                        int producerWindowSize,
+                                        boolean cacheLargeMessageClient,
+                                        int minLargeMessageSize,
+                                        boolean blockOnNonDurableSend,
+                                        boolean blockOnAcknowledge,
+                                        boolean blockOnDurableSend,
+                                        boolean autoGroup,
+                                        boolean preAcknowledge,
+                                        long maxRetryInterval,
+                                        double retryIntervalMultiplier,
+                                        int reconnectAttempts,
+                                        boolean failoverOnShutdown,
+                                        int scheduledThreadPoolMaxSize,
+                                        int threadPoolMaxSize,
+                                        String groupId,
+                                        int initialMessagePacketSize,
+                                        boolean useGlobalPools,
+                                        long retryInterval,
+                                        String connectionLoadBalancingPolicyClassName)
+         throws Exception
+   {
+      if(liveTransportClassNames != null)
+      {
+         jmsServerControl.createConnectionFactory(name, liveTransportClassNames, liveTransportParams == null?"":liveTransportParams,
+               backupTransportClassNames == null?"":backupTransportClassNames, backupTransportParams == null?"":backupTransportParams, bindings);
+      }
+      else
+      {
+         jmsServerControl.createConnectionFactory(name, discoveryAddress, discoveryPort, bindings);
+      }
+      ConnectionFactoryControl control = (ConnectionFactoryControl) managementService.getResource("jms.connectionfactory." + name);
+      control.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
+      control.setClientID(clientId);
+      control.setDupsOKBatchSize(dupsOkBatchSize);
+      control.setTransactionBatchSize(transactionBatchSize);
+      control.setClientFailureCheckPeriod(clientFailureCheckPeriod);
+      control.setConnectionTTL(connectionTTL);
+      control.setCallTimeout(callTimeout);
+      control.setConsumerWindowSize(consumerWindowSize);
+      control.setConfirmationWindowSize(confirmationWindowSize);
+      control.setProducerMaxRate(producerMaxRate);
+      control.setProducerWindowSize(producerWindowSize);
+      control.setCacheLargeMessagesClient(cacheLargeMessageClient);
+      control.setMinLargeMessageSize(minLargeMessageSize);
+      control.setBlockOnDurableSend(blockOnNonDurableSend);
+      control.setBlockOnAcknowledge(blockOnAcknowledge);
+      control.setBlockOnDurableSend(blockOnDurableSend);
+      control.setAutoGroup(autoGroup);
+      control.setPreAcknowledge(preAcknowledge);
+      control.setMaxRetryInterval(maxRetryInterval);
+      control.setRetryIntervalMultiplier(retryIntervalMultiplier);
+      control.setReconnectAttempts(reconnectAttempts);
+      control.setFailoverOnServerShutdown(failoverOnShutdown);
+      control.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
+      control.setThreadPoolMaxSize(threadPoolMaxSize);
+      control.setGroupID(groupId);
+      control.setInitialMessagePacketSize(initialMessagePacketSize);
+      control.setUseGlobalPools(useGlobalPools);
+      control.setRetryInterval(retryInterval);
+      control.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
+   }
+
+   @ManagementOperation(name = "createConnectionFactory", description = "creates a connection factories",
+       params = {
+           @ManagementParameter(name = "name", description = "the connection factory name"),
+           @ManagementParameter(name = "discoveryRefreshTimeout", description = "the discovery refresh timeout"),
+           @ManagementParameter(name = "clientId", description = "the client id"),
+           @ManagementParameter(name = "dupsOkBatchSize", description = "the batch size for DUPS_OK acknowledge mode"),
+           @ManagementParameter(name = "transactionBatchSize", description = "the transaction batch size"),
+           @ManagementParameter(name = "clientFailureCheckPeriod", description = "the client failure check period"),
+           @ManagementParameter(name = "connectionTTL", description = "the connection time to live"),
+           @ManagementParameter(name = "callTimeout", description = "the remote call timeout"),
+           @ManagementParameter(name = "consumerWindowSize", description = "the consumer window size"),
+           @ManagementParameter(name = "confirmationWindowSize", description = "the confirmation window size"),
+           @ManagementParameter(name = "producerMaxRate", description = "the produxer max rate"),
+           @ManagementParameter(name = "producerWindowSize", description = "the producer window size"),
+           @ManagementParameter(name = "cacheLargeMessageClient", description = "do we cache large messages on the client"),
+           @ManagementParameter(name = "minLargeMessageSize", description = "the minimum large message size"),
+           @ManagementParameter(name = "blockOnNonDurableSend", description = "do we block on non durable send"),
+           @ManagementParameter(name = "blockOnAcknowledge", description = "do we block on acknowledge"),
+           @ManagementParameter(name = "blockOnDurableSend", description = "do we block on durable send"),
+           @ManagementParameter(name = "autoGroup", description = "do we use autogroup"),
+           @ManagementParameter(name = "preAcknowledge", description = "do we pre acknowledge messages"),
+           @ManagementParameter(name = "maxRetryInterval", description = "the max retry interval"),
+           @ManagementParameter(name = "retryIntervalMultiplier", description = "the max retry interval multiplier"),
+           @ManagementParameter(name = "reconnectAttempts", description = "the reconnect attempts"),
+           @ManagementParameter(name = "failoverOnShutdown", description = "do we failover on a clean shutdown"),
+           @ManagementParameter(name = "scheduledThreadPoolMaxSize", description = "the pool size for scheduled threads"),
+           @ManagementParameter(name = "threadPoolMaxSize", description = "the pool size for threads"),
+           @ManagementParameter(name = "groupId", description = "the group id"),
+           @ManagementParameter(name = "initialMessagePacketSize", description = "the initial message packet size"),
+           @ManagementParameter(name = "useGlobalPools", description = "do we use global pools"),
+           @ManagementParameter(name = "retryInterval", description = "the retry interval"),
+           @ManagementParameter(name = "connectionLoadBalancingPolicyClassName", description = "the load balancing class")})
+   public void updateConnectionFactory(String name,
+                                        long discoveryRefreshTimeout,
+                                        String clientId,
+                                        int dupsOkBatchSize,
+                                        int transactionBatchSize,
+                                        long clientFailureCheckPeriod,
+                                        long connectionTTL,
+                                        long callTimeout,
+                                        int consumerWindowSize,
+                                        int confirmationWindowSize,
+                                        int producerMaxRate,
+                                        int producerWindowSize,
+                                        boolean cacheLargeMessageClient,
+                                        int minLargeMessageSize,
+                                        boolean blockOnNonDurableSend,
+                                        boolean blockOnAcknowledge,
+                                        boolean blockOnDurableSend,
+                                        boolean autoGroup,
+                                        boolean preAcknowledge,
+                                        long maxRetryInterval,
+                                        double retryIntervalMultiplier,
+                                        int reconnectAttempts,
+                                        boolean failoverOnShutdown,
+                                        int scheduledThreadPoolMaxSize,
+                                        int threadPoolMaxSize,
+                                        String groupId,
+                                        int initialMessagePacketSize,
+                                        boolean useGlobalPools,
+                                        long retryInterval,
+                                        String connectionLoadBalancingPolicyClassName)
+         throws Exception
+   {
+      ConnectionFactoryControl control = (ConnectionFactoryControl) managementService.getResource("jms.connectionfactory." + name);
+      control.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
+      control.setClientID(clientId);
+      control.setDupsOKBatchSize(dupsOkBatchSize);
+      control.setTransactionBatchSize(transactionBatchSize);
+      control.setClientFailureCheckPeriod(clientFailureCheckPeriod);
+      control.setConnectionTTL(connectionTTL);
+      control.setCallTimeout(callTimeout);
+      control.setConsumerWindowSize(consumerWindowSize);
+      control.setConfirmationWindowSize(confirmationWindowSize);
+      control.setProducerMaxRate(producerMaxRate);
+      control.setProducerWindowSize(producerWindowSize);
+      control.setCacheLargeMessagesClient(cacheLargeMessageClient);
+      control.setMinLargeMessageSize(minLargeMessageSize);
+      control.setBlockOnDurableSend(blockOnNonDurableSend);
+      control.setBlockOnAcknowledge(blockOnAcknowledge);
+      control.setBlockOnDurableSend(blockOnDurableSend);
+      control.setAutoGroup(autoGroup);
+      control.setPreAcknowledge(preAcknowledge);
+      control.setMaxRetryInterval(maxRetryInterval);
+      control.setRetryIntervalMultiplier(retryIntervalMultiplier);
+      control.setReconnectAttempts(reconnectAttempts);
+      control.setFailoverOnServerShutdown(failoverOnShutdown);
+      control.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
+      control.setThreadPoolMaxSize(threadPoolMaxSize);
+      control.setGroupID(groupId);
+      control.setInitialMessagePacketSize(initialMessagePacketSize);
+      control.setUseGlobalPools(useGlobalPools);
+      control.setRetryInterval(retryInterval);
+      control.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryMapper.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryMapper.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/ConnectionFactoryMapper.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,305 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.hornetq.api.core.Pair;
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.jms.management.ConnectionFactoryControl;
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.types.ImmutableCompositeMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ *         Created Mar 19, 2010
+ */
+public class ConnectionFactoryMapper extends MetaMapper<ConnectionFactoryControl>
+{
+   public static final CompositeMetaType TYPE;
+   static
+   {
+      String[] itemNames = {
+            "name",
+            "liveTransportClassNames",
+            "liveTransportParams",
+            "backupTransportClassNames",
+            "backupTransportParams",
+            "Bindings",
+            "DiscoveryAddress",
+            "DiscoveryPort",
+            "DiscoveryRefreshTimeout",
+            "DiscoveryInitialWaitTimeout",
+            "ClientID",
+            "DupsOKBatchSize",
+            "TransactionBatchSize",
+            "ClientFailureCheckPeriod",
+            "ConnectionTTL",
+            "CallTimeout",
+            "ConsumerWindowSize",
+            "ConsumerMaxRate",
+            "ConfirmationWindowSize",
+            "ProducerMaxRate",
+            "ProducerWindowSize",
+            "CacheLargeMessagesClient",
+            "MinLargeMessageSize",
+            "BlockOnNonDurableSend",
+            "BlockOnAcknowledge",
+            "BlockOnDurableSend",
+            "AutoGroup",
+            "PreAcknowledge",
+            "MaxRetryInterval",
+            "RetryIntervalMultiplier",
+            "ReconnectAttempts",
+            "FailoverOnServerShutdown",
+            "ScheduledThreadPoolMaxSize",
+            "ThreadPoolMaxSize",
+            "GroupID",
+            "InitialMessagePacketSize",
+            "UseGlobalPools",
+            "RetryInterval",
+            "ConnectionLoadBalancingPolicyClassName"
+      };
+      String[] itemDescriptions = {
+            "name",
+            "liveTransportClassNames",
+            "liveTransportParams",
+            "backupTransportClassNames",
+            "backupTransportParams",
+            "Bindings",
+            "DiscoveryAddress",
+            "DiscoveryPort",
+            "DiscoveryRefreshTimeout",
+            "DiscoveryInitialWaitTimeout",
+            "ClientID",
+            "DupsOKBatchSize",
+            "TransactionBatchSize",
+            "ClientFailureCheckPeriod",
+            "ConnectionTTL",
+            "CallTimeout",
+            "ConsumerWindowSize",
+            "ConsumerMaxRate",
+            "ConfirmationWindowSize",
+            "ProducerMaxRate",
+            "ProducerWindowSize",
+            "CacheLargeMessagesClient",
+            "MinLargeMessageSize",
+            "BlockOnNonDurableSend",
+            "BlockOnAcknowledge",
+            "BlockOnDurableSend",
+            "AutoGroup",
+            "PreAcknowledge",
+            "MaxRetryInterval",
+            "RetryIntervalMultiplier",
+            "ReconnectAttempts",
+            "FailoverOnServerShutdown",
+            "ScheduledThreadPoolMaxSize",
+            "ThreadPoolMaxSize",
+            "GroupID",
+            "InitialMessagePacketSize",
+            "UseGlobalPools",
+            "RetryInterval",
+            "ConnectionLoadBalancingPolicyClassName"
+      };
+      MetaType[] itemTypes = {
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING
+      };
+      TYPE = new ImmutableCompositeMetaType("javax.jms.ConnectionFactory", "Connection Factory Settings",
+            itemNames, itemDescriptions, itemTypes);
+   }
+
+   @Override
+   public MetaValue createMetaValue(MetaType metaType, ConnectionFactoryControl control)
+   {
+      CompositeValueSupport cvs = new CompositeValueSupport(TYPE);
+      cvs.set("name", new SimpleValueSupport(SimpleMetaType.STRING, control.getName()));
+      List<org.hornetq.api.core.Pair<TransportConfiguration, TransportConfiguration>> pairs = control.getStaticConnectors();
+      StringBuffer liveTransportClassNames = new StringBuffer();
+      StringBuffer liveTransportParams = new StringBuffer();
+      StringBuffer backupTransportClassNames = new StringBuffer();
+      StringBuffer backupTransportParams = new StringBuffer();
+      for (Pair<TransportConfiguration, TransportConfiguration> pair : pairs)
+      {
+         if (pair.a != null)
+         {
+            TransportConfiguration live = pair.a;
+            if(liveTransportClassNames.length() > 0)
+            {
+               liveTransportClassNames.append(",");
+            }
+            liveTransportClassNames.append(live.getFactoryClassName());
+
+            Map<String, Object> params = live.getParams();
+            liveTransportParams.append("{");
+            for (Map.Entry<String, Object> stringObjectEntry : params.entrySet())
+            {
+               if(liveTransportParams.length() > 1)
+               {
+                  liveTransportParams.append(",");
+               }
+               liveTransportParams.append(stringObjectEntry.getKey()).append("=").append(stringObjectEntry.getValue());
+            }
+            liveTransportParams.append("}");
+         }
+
+         if (pair.b != null)
+         {
+            TransportConfiguration backUp = pair.b;
+            if(backupTransportClassNames.length() > 0)
+            {
+               backupTransportClassNames.append(",");
+            }
+            backupTransportClassNames.append(backUp.getFactoryClassName());
+
+            Map<String, Object> params = backUp.getParams();
+            backupTransportParams.append("{");
+            for (Map.Entry<String, Object> stringObjectEntry : params.entrySet())
+            {
+               if(backupTransportParams.length() > 1)
+               {
+                  backupTransportParams.append(",");
+               }
+               backupTransportParams.append(stringObjectEntry.getKey()).append("=").append(stringObjectEntry.getValue());
+            }
+            backupTransportParams.append("}");
+         }
+
+      }
+      cvs.set("liveTransportClassNames", new SimpleValueSupport(SimpleMetaType.STRING, liveTransportClassNames));
+      cvs.set("liveTransportParams", new SimpleValueSupport(SimpleMetaType.STRING, liveTransportParams));
+      cvs.set("backupTransportClassNames", new SimpleValueSupport(SimpleMetaType.STRING, backupTransportClassNames));
+      cvs.set("backupTransportParams", new SimpleValueSupport(SimpleMetaType.STRING, backupTransportParams));
+      cvs.set("Bindings", new SimpleValueSupport(SimpleMetaType.STRING, getJndiString(control.getJNDIBindings())));
+      cvs.set("DiscoveryAddress", new SimpleValueSupport(SimpleMetaType.STRING, control.getDiscoveryAddress()));
+      cvs.set("DiscoveryPort", new SimpleValueSupport(SimpleMetaType.STRING, control.getDiscoveryPort()));
+      cvs.set("DiscoveryRefreshTimeout", new SimpleValueSupport(SimpleMetaType.STRING, control.getDiscoveryRefreshTimeout()));
+      cvs.set("DiscoveryInitialWaitTimeout", new SimpleValueSupport(SimpleMetaType.STRING, control.getDiscoveryInitialWaitTimeout()));
+      cvs.set("ClientID", new SimpleValueSupport(SimpleMetaType.STRING, control.getClientID()));
+      cvs.set("DupsOKBatchSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getDupsOKBatchSize()));
+      cvs.set("TransactionBatchSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getTransactionBatchSize()));
+      cvs.set("ClientFailureCheckPeriod", new SimpleValueSupport(SimpleMetaType.STRING, control.getClientFailureCheckPeriod()));
+      cvs.set("ConnectionTTL", new SimpleValueSupport(SimpleMetaType.STRING, control.getConnectionTTL()));
+      cvs.set("CallTimeout", new SimpleValueSupport(SimpleMetaType.STRING, control.getCallTimeout()));
+      cvs.set("ConsumerWindowSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getConfirmationWindowSize()));
+      cvs.set("ConsumerMaxRate", new SimpleValueSupport(SimpleMetaType.STRING, control.getConsumerMaxRate()));
+      cvs.set("ConfirmationWindowSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getConfirmationWindowSize()));
+      cvs.set("ProducerMaxRate", new SimpleValueSupport(SimpleMetaType.STRING, control.getProducerMaxRate()));
+      cvs.set("ProducerWindowSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getProducerWindowSize()));
+      cvs.set("CacheLargeMessagesClient", new SimpleValueSupport(SimpleMetaType.STRING, control.isCacheLargeMessagesClient()));
+      cvs.set("MinLargeMessageSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getMinLargeMessageSize()));
+      cvs.set("BlockOnNonDurableSend", new SimpleValueSupport(SimpleMetaType.STRING, control.isBlockOnNonDurableSend()));
+      cvs.set("BlockOnAcknowledge", new SimpleValueSupport(SimpleMetaType.STRING, control.isBlockOnAcknowledge()));
+      cvs.set("BlockOnDurableSend", new SimpleValueSupport(SimpleMetaType.STRING, control.isBlockOnDurableSend()));
+      cvs.set("AutoGroup", new SimpleValueSupport(SimpleMetaType.STRING, control.isAutoGroup()));
+      cvs.set("PreAcknowledge", new SimpleValueSupport(SimpleMetaType.STRING, control.isPreAcknowledge()));
+      cvs.set("MaxRetryInterval", new SimpleValueSupport(SimpleMetaType.STRING, control.getMaxRetryInterval()));
+      cvs.set("RetryIntervalMultiplier", new SimpleValueSupport(SimpleMetaType.STRING, control.getRetryIntervalMultiplier()));
+      cvs.set("ReconnectAttempts", new SimpleValueSupport(SimpleMetaType.STRING, control.getReconnectAttempts()));
+      cvs.set("FailoverOnServerShutdown", new SimpleValueSupport(SimpleMetaType.STRING, control.isFailoverOnServerShutdown()));
+      cvs.set("ScheduledThreadPoolMaxSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getScheduledThreadPoolMaxSize()));
+      cvs.set("ThreadPoolMaxSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getThreadPoolMaxSize()));
+      cvs.set("GroupID", new SimpleValueSupport(SimpleMetaType.STRING, control.getGroupID()));
+      cvs.set("InitialMessagePacketSize", new SimpleValueSupport(SimpleMetaType.STRING, control.getInitialMessagePacketSize()));
+      cvs.set("UseGlobalPools", new SimpleValueSupport(SimpleMetaType.STRING, control.isUseGlobalPools()));
+      cvs.set("RetryInterval", new SimpleValueSupport(SimpleMetaType.STRING, control.getRetryInterval()));
+      cvs.set("ConnectionLoadBalancingPolicyClassName", new SimpleValueSupport(SimpleMetaType.STRING, control.getConnectionLoadBalancingPolicyClassName()));
+      return cvs;
+   }
+
+   @Override
+   public ConnectionFactoryControl unwrapMetaValue(MetaValue metaValue)
+   {
+      return null;
+   }
+
+   @Override
+   public Type mapToType()
+   {
+      return ConnectionFactoryControl.class;
+   }
+
+   @Override
+   public MetaType getMetaType()
+   {
+      return TYPE;
+   }
+
+   private String getJndiString(String[] array)
+   {
+      StringBuffer sb = new StringBuffer();
+      for (String o : array)
+      {
+         if (sb.length() > 0)
+         {
+            sb.append(",");
+         }
+         sb.append(o);
+      }
+      return sb.toString();
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSManageMO.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSManageMO.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSManageMO.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.hornetq.api.core.management.HornetQServerControl;
+import org.hornetq.api.core.management.ResourceNames;
+import org.hornetq.api.jms.management.JMSServerControl;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.management.ManagementService;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ *         Created: 17-Mar-2010
+ */
+public class JMSManageMO
+{
+   protected JMSServerControl jmsServerControl;
+
+   protected ManagementService managementService;
+
+   protected HornetQServerControl hornetQServerControl;
+
+   private HornetQServer server;
+
+
+   public JMSManageMO(HornetQServer server)
+   {
+      this.server = server;
+   }
+
+   public void start()
+   {
+      managementService = server.getManagementService();
+      jmsServerControl = (JMSServerControl) managementService.getResource(ResourceNames.JMS_SERVER);
+      hornetQServerControl = (HornetQServerControl) managementService.getResource(ResourceNames.CORE_SERVER);
+   }
+
+   protected String coomaSeparatedString(Object[] objects)
+   {
+      StringBuffer sb = new StringBuffer("");
+      for (Object object : objects)
+      {
+         if (sb.length() > 0)
+         {
+            sb.append(",");
+         }
+         sb.append(object.toString());
+      }
+      return sb.toString();
+   }
+
+
+   protected Object[] getParams(String[] params, Class[] classes)
+   {
+      Object[] objects = new Object[params.length];
+      for (int i = 0, objectsLength = objects.length; i < objectsLength; i++)
+      {
+         if ("null".equalsIgnoreCase(params[i]))
+         {
+            objects[i] = null;
+         }
+         else if (classes[i] == String.class)
+         {
+            objects[i] = params[i];
+         }
+         else if (classes[i] == Double.class)
+         {
+            objects[i] = Double.valueOf(params[i]);
+         }
+         else if (classes[i] == double.class)
+         {
+            objects[i] = Double.valueOf(params[i]);
+         }
+         else if (classes[i] == Long.class)
+         {
+            objects[i] = Long.valueOf(params[i]);
+         }
+         else if (classes[i] == long.class)
+         {
+            objects[i] = Long.valueOf(params[i]);
+         }
+         else if (classes[i] == Integer.class)
+         {
+            objects[i] = Integer.valueOf(params[i]);
+         }
+         else if (classes[i] == int.class)
+         {
+            objects[i] = Integer.valueOf(params[i]);
+         }
+         else if (classes[i] == Float.class)
+         {
+            objects[i] = Float.valueOf(params[i]);
+         }
+         else if (classes[i] == float.class)
+         {
+            objects[i] = Float.valueOf(params[i]);
+         }
+      }
+      return objects;
+   }
+
+   protected Class[] getClassTypes(String[] type) throws Exception
+   {
+      Class[] classes = new Class[type.length];
+      for (int i = 0, typeLength = type.length; i < typeLength; i++)
+      {
+         classes[i] = Class.forName(type[i]);
+      }
+      return classes;
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSServerMO.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSServerMO.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/JMSServerMO.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.hornetq.core.server.HornetQServer;
+import org.jboss.managed.api.annotation.*;
+
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ *         Created Mar 26, 2010
+ */
+ at ManagementObject(componentType = @ManagementComponent(type = "JMSManage", subtype = "ServerManage"),
+    properties = ManagementProperties.EXPLICIT, isRuntime = true)
+public class JMSServerMO extends JMSManageMO
+{
+   public JMSServerMO(HornetQServer server)
+   {
+      super(server);   
+   }
+
+   @ManagementOperation(name = "getVersion", description = "returns the servers version")
+   public String getVersion()
+   {
+      return jmsServerControl.getVersion();
+   }
+
+   @ManagementOperation(name = "getVersion", description = "returns the servers status")
+   public boolean isStarted()
+   {
+      return jmsServerControl.isStarted();
+   }
+
+   @ManagementOperation(name = "invokeManagerOperation", description = "invokes a queues method",
+       params = {
+           @ManagementParameter(name = "name", description = "the name"),
+           @ManagementParameter(name = "method", description = "the method"),
+           @ManagementParameter(name = "params", description = "the method params")})
+   public Object invokeManagerOperation(String name, String method, String[] params, String[] type) throws Exception
+   {
+      Class[] classes = getClassTypes(type);
+      Method m = null;
+      try
+      {
+         m = jmsServerControl.getClass().getMethod(method, classes);
+         return m.invoke(jmsServerControl, getParams(params, classes));
+      }
+      catch (NoSuchMethodException e)
+      {
+         m = hornetQServerControl.getClass().getMethod(method, classes);
+         return m.invoke(hornetQServerControl, getParams(params, classes));
+      }
+
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/MessageListMapper.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.jms;
+
+import java.io.Serializable;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.jms.Message;
+
+import org.jboss.logging.Logger;
+import org.jboss.metatype.api.types.CollectionMetaType;
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.types.ImmutableCompositeMetaType;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+/**
+ * Maps a List<JBossMessage> into a CollectMetaType of CompositeValues.
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 90349 $
+ */
+public class MessageListMapper extends MetaMapper<List>
+{
+   private static final Logger log = Logger.getLogger(MessageListMapper.class);
+   public static final CollectionMetaType TYPE;
+   public static final CompositeMetaType MSG_TYPE;
+
+   static
+   {
+      String[] itemNames = {
+            "JMSMessageID",
+            "JMSTimestamp",
+            "JMSPriority",
+            "JMSDeliveryMode",
+            "JMSExpiration"
+      };
+      String[] itemDescriptions = {
+            "JMSMessageID",
+            "JMSTimestamp",
+            "JMSPriority",
+            "JMSDeliveryMode",
+            "JMSExpiration"
+      };
+      MetaType[] itemTypes = {
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING
+      };
+      MSG_TYPE = new ImmutableCompositeMetaType("javax.jms.Message", "JMS Message",
+            itemNames, itemDescriptions, itemTypes);
+      TYPE = new CollectionMetaType("java.util.List", MSG_TYPE);
+   }
+
+   @Override
+   public MetaValue createMetaValue(MetaType metaType, List object)
+   {
+      ArrayList<MetaValue> tmp = new ArrayList<MetaValue>();
+      if(object != null)
+      {
+         for(Object o : object)
+         {
+            Map m = (Map) o;
+            try
+            {
+               CompositeValueSupport cvs = new CompositeValueSupport(MSG_TYPE);
+               cvs.set("JMSMessageID", SimpleValueSupport.wrap((Serializable) m.get("JMSMessageID").toString()));
+               cvs.set("JMSTimestamp", SimpleValueSupport.wrap((Serializable) m.get("JMSTimestamp").toString()));
+               cvs.set("JMSPriority", SimpleValueSupport.wrap((Serializable) m.get("JMSPriority").toString()));
+               cvs.set("JMSDeliveryMode", SimpleValueSupport.wrap((Serializable) m.get("JMSDeliveryMode").toString()));
+               cvs.set("JMSExpiration", SimpleValueSupport.wrap((Serializable) m.get("JMSExpiration").toString()));
+               tmp.add(cvs);
+            }
+            catch(Exception e)
+            {
+               log.warn("Skipping msg: "+m, e);
+            }
+         }
+      }
+      MetaValue[] elements = new MetaValue[tmp.size()];
+      tmp.toArray(elements);
+      CollectionValueSupport msgs = new CollectionValueSupport(TYPE, elements);
+      return msgs;
+   }
+
+   @Override
+   public MetaType getMetaType()
+   {
+      return TYPE;
+   }
+
+   @Override
+   public Type mapToType()
+   {
+      return List.class;
+   }
+
+   /**
+    * This always returns null as Messages cannot be created from a meta value
+    */
+   @Override
+   public List unwrapMetaValue(MetaValue metaValue)
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageMO.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageMO.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/QueueManageMO.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,244 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.hornetq.api.core.management.AddressSettingsInfo;
+import org.hornetq.api.core.management.RoleInfo;
+import org.hornetq.api.jms.management.JMSQueueControl;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.jms.server.config.impl.JMSQueueConfigurationImpl;
+import org.jboss.managed.api.annotation.*;
+import org.jboss.metatype.api.annotations.MetaMapping;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.*;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ * Created 10-Mar-2010
+ */
+ at ManagementObject(componentType = @ManagementComponent(type = "JMSDestinationManage", subtype = "QueueManage"),
+    properties = ManagementProperties.EXPLICIT, isRuntime = true)
+public class QueueManageMO extends JMSManageMO
+{
+   public QueueManageMO(HornetQServer server)
+   {
+      super(server);
+   }
+
+
+   @ManagementOperation(name = "createQueue", description = "Creates a new Queue",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "jndiName", description = "The JNDI Name of the queue"),
+           @ManagementParameter(name = "dla", description = "Dead Letter Address"),
+           @ManagementParameter(name = "expiryAddress", description = "Expiry Address"),
+           @ManagementParameter(name = "maxSizeBytes", description = "Max Size of Address"),
+           @ManagementParameter(name = "pageSizeBytes", description = "Page Size"),
+           @ManagementParameter(name = "deliveryAttempts", description = "Max Delivery Attempts"),
+           @ManagementParameter(name = "redeliveryDelay", description = "Redelivery Delay"),
+           @ManagementParameter(name = "lastValueQueue", description = "Last Value Queue"),
+           @ManagementParameter(name = "redistributionDelay", description = "Redistribution Delay"),
+           @ManagementParameter(name = "sendToDLAOnNoRoute", description = "Send To DLA on no route"),
+           @ManagementParameter(name = "addressFullMessagePolicy", description = "Address Full Message Policy"),
+           @ManagementParameter(name = "sendRoles", description = "Send roles for a queue"),
+           @ManagementParameter(name = "consumeRoles", description = "consume roles for a queue")
+       })
+   public void createQueue(String name,
+                           String jndiName,
+                           String DLA,
+                           String expiryAddress,
+                           long maxSizeBytes,
+                           int pageSizeBytes,
+                           int deliveryAttempts,
+                           long redeliveryDelay,
+                           boolean lastValueQueue,
+                           long redistributionDelay,
+                           boolean sendToDLAOnNoRoute,
+                           String addressFullMessagePolicy,
+                           String sendRoles,
+                           String consumeRoles) throws Exception
+   {
+
+      //update the address settings
+      hornetQServerControl.addAddressSettings("jms.queue." + name,
+          DLA,
+          expiryAddress,
+          lastValueQueue,
+          deliveryAttempts,
+          maxSizeBytes,
+          pageSizeBytes,
+          redeliveryDelay,
+          redistributionDelay,
+          sendToDLAOnNoRoute,
+          addressFullMessagePolicy);
+      //create the queue
+      jmsServerControl.createQueue(name, jndiName);
+      //update security
+      hornetQServerControl.addSecuritySettings("jms.queue." + name, sendRoles, consumeRoles, "", "", "", "", "");
+   }
+
+   @ManagementOperation(name = "deleteQueue", description = "delete the queue",
+       params = {@ManagementParameter(name = "name", description = "the queue name")})
+   public void deleteQueue(String name) throws Exception
+   {
+      jmsServerControl.destroyQueue(name.replace("jms.queue.", ""));
+      hornetQServerControl.removeSecuritySettings(name);
+      hornetQServerControl.removeAddressSettings(name);
+   }
+
+   @ManagementOperation(name = "getQueueConfiguration", description = "Returns a queues configuration",
+       params = {@ManagementParameter(name = "name", description = "the queue name")})
+   @MetaMapping(value = AddressSettingsMapper.class)
+   public Object[] getQueueConfiguration(String name) throws Exception
+   {
+      Object[] config = new Object[3];
+      JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+      JMSQueueConfiguration queueConfiguration = new JMSQueueConfigurationImpl(control.getName(), control.getSelector(), !control.isTemporary(), control.getJNDIBindings());
+      config[0] = queueConfiguration;
+      String addressSettingsAsJSON = hornetQServerControl.getAddressSettingsAsJSON(name);
+      config[1] = AddressSettingsInfo.from(addressSettingsAsJSON);
+      String rolesAsJSON = hornetQServerControl.getRolesAsJSON(name);
+      RoleInfo[] roles = RoleInfo.from(rolesAsJSON);
+      config[2] = roles;
+      return config;
+   }
+
+   @ManagementOperation(name = "updateQueueConfiguration", description = "updates a queues configuration",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "jndiName", description = "The JNDI Name of the queue"),
+           @ManagementParameter(name = "dla", description = "Dead Letter Address"),
+           @ManagementParameter(name = "expiryAddress", description = "Expiry Address"),
+           @ManagementParameter(name = "maxSizeBytes", description = "Max Size of Address"),
+           @ManagementParameter(name = "pageSizeBytes", description = "Page Size"),
+           @ManagementParameter(name = "deliveryAttempts", description = "Max Delivery Attempts"),
+           @ManagementParameter(name = "redeliveryDelay", description = "Redelivery Delay"),
+           @ManagementParameter(name = "lastValueQueue", description = "Last Value Queue"),
+           @ManagementParameter(name = "redistributionDelay", description = "Redistribution Delay"),
+           @ManagementParameter(name = "sendToDLAOnNoRoute", description = "Send To DLA on no route"),
+           @ManagementParameter(name = "addressFullMessagePolicy", description = "Address Full Message Policy"),
+           @ManagementParameter(name = "sendRoles", description = "Send roles for a queue"),
+           @ManagementParameter(name = "consumeRoles", description = "consume roles for a queue")
+       })
+   public void updateQueueConfiguration(String name,
+                                        String jndiName,
+                                        String dla,
+                                        String expiryAddress,
+                                        long maxSizeBytes,
+                                        int pageSizeBytes,
+                                        int deliveryAttempts,
+                                        long redeliveryDelay,
+                                        boolean lastValueQueue,
+                                        long redistributionDelay,
+                                        boolean sendToDLAOnNoRoute,
+                                        String addressFullMessagePolicy,
+                                        String sendRoles,
+                                        String consumeRoles) throws Exception
+   {
+      //update the address settings
+      hornetQServerControl.addAddressSettings(name,
+          dla,
+          expiryAddress,
+          lastValueQueue,
+          deliveryAttempts,
+          maxSizeBytes,
+          pageSizeBytes,
+          redeliveryDelay,
+          redistributionDelay,
+          sendToDLAOnNoRoute,
+          addressFullMessagePolicy);
+      //update security
+      hornetQServerControl.addSecuritySettings(name, sendRoles, consumeRoles, "", "", "", "", "");
+   }
+
+   @ManagementOperation(name = "getQueueMeasurements", description = "updates a queues configuration",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "names", description = "the measurement names")})
+   public String[] getQueueMeasurements(String name, String[] names) throws Exception
+   {
+      JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+      String[] val = new String[names.length];
+      for (int i = 0, valLength = val.length; i < valLength; i++)
+      {
+         Object o = control.getClass().getMethod(names[i]).invoke(control);
+         if(o instanceof Object[])
+         {
+            val[i] = coomaSeparatedString((Object[]) o);
+         }
+         else
+         {
+            val[i] = o.toString();
+         }
+      }
+      return val;
+   }
+
+   @ManagementOperation(name = "invokeQueueOperation", description = "invokes a queues method",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "method", description = "the method"),
+           @ManagementParameter(name = "params", description = "the method params")})
+   public Object invokeQueueOperation(String name, String method, String[] params, String[] type) throws Exception
+   {
+      JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+      Class[] classes = getClassTypes(type);
+      Method m = control.getClass().getMethod(method, classes);
+      return m.invoke(control, getParams(params, classes));
+   }
+
+   @ManagementOperation(name = "invokeQueueOperationMessageType", description = "invokes a queues method",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "method", description = "the method"),
+           @ManagementParameter(name = "params", description = "the method params")})
+   @MetaMapping(value = MessageListMapper.class)
+   public List invokeQueueOperationMessageType(String name, String method, String[] params, String[] type) throws Exception
+   {
+      JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+      Class[] classes = getClassTypes(type);
+      Method m = control.getClass().getMethod(method, classes);
+      Map<String, Serializable>[] maps = (Map<String, Serializable>[]) m.invoke(control, getParams(params, classes));
+      List list = new ArrayList();
+      list.addAll(Arrays.asList(maps));
+      return list;
+   }
+
+   @ManagementOperation(name = "getJMSQueues", description = "returns the JMS Queues")
+   public String[] getJMSQueues()
+   {
+      return jmsServerControl.getQueueNames();
+   }
+   
+   @ManagementOperation(name = "isPaused", description = "is the queue paused?",
+	       params = {
+           @ManagementParameter(name = "name", description = "the queue name")
+   })
+   public boolean isPaused(String name) throws Exception
+   {
+	   JMSQueueControl control = (JMSQueueControl) managementService.getResource(name);
+	   return control.isPaused();
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/SubscriptionInfoMapper.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/SubscriptionInfoMapper.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/SubscriptionInfoMapper.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.jboss.logging.Logger;
+import org.jboss.metatype.api.types.*;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.jboss.metatype.spi.values.MetaMapper;
+
+import java.io.Serializable;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ *         Created: 17-Mar-2010
+ */
+public class SubscriptionInfoMapper  extends MetaMapper<Object[]>
+{
+   private static final Logger log = Logger.getLogger(MessageListMapper.class);
+   public static final CollectionMetaType TYPE;
+   public static final CompositeMetaType MSG_TYPE;
+
+   static
+   {
+      String[] itemNames = {
+            "name",
+            "clientID",
+            "subName",
+            "durable",
+            "messageCount",
+            "filter"
+      };
+      String[] itemDescriptions = {
+            "name",
+            "clientID",
+            "subName",
+            "durable",
+            "messageCount",
+            "filter"
+      };
+      MetaType[] itemTypes = {
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING,
+            SimpleMetaType.STRING
+      };
+      MSG_TYPE = new ImmutableCompositeMetaType("javax.jms.Message", "JMS Message",
+            itemNames, itemDescriptions, itemTypes);
+      TYPE = new CollectionMetaType("java.util.List", MSG_TYPE);
+   }
+
+   @Override
+   public MetaValue createMetaValue(MetaType metaType, Object[] object)
+   {
+      ArrayList<MetaValue> tmp = new ArrayList<MetaValue>();
+      if(object != null)
+      {
+         for(Object o : object)
+         {
+            Object[] m = (Object[]) o;
+            try
+            {
+               CompositeValueSupport cvs = new CompositeValueSupport(MSG_TYPE);
+               if(m[0] != null)
+                  cvs.set("name", SimpleValueSupport.wrap((Serializable) m[0].toString()));
+               if(m[1] != null)
+                  cvs.set("clientID", SimpleValueSupport.wrap((Serializable) m[1].toString()));
+               if(m[2] != null)
+                  cvs.set("subName", SimpleValueSupport.wrap((Serializable) m[2].toString()));
+               if(m[3] != null)
+                  cvs.set("durable", SimpleValueSupport.wrap((Serializable) m[3].toString()));
+               if(m[4] != null)
+                  cvs.set("messageCount", SimpleValueSupport.wrap((Serializable) m[4].toString()));
+               if(m[5] != null)
+                  cvs.set("filter", SimpleValueSupport.wrap((Serializable) m[5].toString()));
+               tmp.add(cvs);
+            }
+            catch(Exception e)
+            {
+               log.warn("Skipping msg: "+m, e);
+            }
+         }
+      }
+      MetaValue[] elements = new MetaValue[tmp.size()];
+      tmp.toArray(elements);
+      CollectionValueSupport msgs = new CollectionValueSupport(TYPE, elements);
+      return msgs;
+   }
+
+   @Override
+   public MetaType getMetaType()
+   {
+      return TYPE;
+   }
+
+   @Override
+   public Type mapToType()
+   {
+      return Object[].class;
+   }
+
+   @Override
+   public Object[] unwrapMetaValue(MetaValue metaValue)
+   {
+      return null;  //To change body of implemented methods use File | Settings | File Templates.
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicManageMO.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicManageMO.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/jms/TopicManageMO.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,267 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.jms;
+
+import org.hornetq.api.core.management.AddressSettingsInfo;
+import org.hornetq.api.core.management.RoleInfo;
+import org.hornetq.api.jms.management.TopicControl;
+import org.hornetq.core.security.Role;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.jms.server.config.TopicConfiguration;
+import org.hornetq.jms.server.config.impl.TopicConfigurationImpl;
+import org.jboss.managed.api.annotation.*;
+import org.jboss.metatype.api.annotations.MetaMapping;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.util.*;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ *         Created: 17-Mar-2010
+ */
+ at ManagementObject(componentType = @ManagementComponent(type = "JMSDestinationManage", subtype = "TopicManage"),
+    properties = ManagementProperties.EXPLICIT, isRuntime = true)
+public class TopicManageMO extends JMSManageMO
+{
+
+   public TopicManageMO(HornetQServer server)
+   {
+      super(server);
+   }
+
+   @ManagementOperation(name = "deleteTopic", description = "delete the topic",
+       params = {@ManagementParameter(name = "name", description = "the queue name")})
+   public void deleteTopic(String name) throws Exception
+   {
+      jmsServerControl.destroyTopic(name.replace("jms.topic.", ""));
+      hornetQServerControl.removeSecuritySettings(name);
+      hornetQServerControl.removeAddressSettings(name);
+   }
+
+   @ManagementOperation(name = "getTopicConfiguration", description = "Returns a topics configuration",
+       params = {@ManagementParameter(name = "name", description = "the queue name")})
+   @MetaMapping(value = AddressSettingsMapper.class)
+   public Object[] getTopicConfiguration(String name) throws Exception 
+   {
+      Object[] config = new Object[3];
+      TopicControl control = (TopicControl) managementService.getResource(name);
+      TopicConfiguration topicConfiguration = new TopicConfigurationImpl(control.getName(), control.getJNDIBindings());
+      config[0] = topicConfiguration;
+      String jsonString = hornetQServerControl.getAddressSettingsAsJSON(name);
+      config[1] = AddressSettingsInfo.from(jsonString);
+      String rolesAsJSON = hornetQServerControl.getRolesAsJSON(name);
+      RoleInfo[] roles = RoleInfo.from(rolesAsJSON);
+      config[2] = roles;
+      return config;
+   }
+   @ManagementOperation(name = "createQueue", description = "Creates a new Queue",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "jndiName", description = "The JNDI Name of the queue"),
+           @ManagementParameter(name = "dla", description = "Dead Letter Address"),
+           @ManagementParameter(name = "expiryAddress", description = "Expiry Address"),
+           @ManagementParameter(name = "maxSizeBytes", description = "Max Size of Address"),
+           @ManagementParameter(name = "pageSizeBytes", description = "Page Size"),
+           @ManagementParameter(name = "deliveryAttempts", description = "Max Delivery Attempts"),
+           @ManagementParameter(name = "redeliveryDelay", description = "Redelivery Delay"),
+           @ManagementParameter(name = "lastValueQueue", description = "Last Value Queue"),
+           @ManagementParameter(name = "redistributionDelay", description = "Redistribution Delay"),
+           @ManagementParameter(name = "sendToDLAOnNoRoute", description = "Send To DLA on no route"),
+           @ManagementParameter(name = "addressFullMessagePolicy", description = "Address Full Message Policy"),
+           @ManagementParameter(name = "sendRoles", description = "Send roles for a queue"),
+           @ManagementParameter(name = "consumeRoles", description = "consume roles for a queue"),
+           @ManagementParameter(name = "createDurableQueueRoles", description = "Send roles for a queue"),
+           @ManagementParameter(name = "deleteDurableQueueRoles", description = "consume roles for a queue"),
+           @ManagementParameter(name = "createTempQueueRoles", description = "Send roles for a queue"),
+           @ManagementParameter(name = "deleteTempQueueRoles", description = "consume roles for a queue")
+       })
+   public void createTopic(String name,
+                           String jndiName,
+                           String DLA,
+                           String expiryAddress,
+                           long maxSizeBytes,
+                           int pageSizeBytes,
+                           int deliveryAttempts,
+                           long redeliveryDelay,
+                           boolean lastValueQueue,
+                           long redistributionDelay,
+                           boolean sendToDLAOnNoRoute,
+                           String addressFullMessagePolicy,
+                           String sendRoles,
+                           String consumeRoles,
+                           final String createDurableQueueRoles,
+                           final String deleteDurableQueueRoles,
+                           final String createTempQueueRoles,
+                           final String deleteTempQueueRoles) throws Exception
+   {
+
+      //update the address settings
+      hornetQServerControl.addAddressSettings("jms.queue." + name,
+          DLA,
+          expiryAddress,
+          lastValueQueue,
+          deliveryAttempts,
+          maxSizeBytes,
+          pageSizeBytes,
+          redeliveryDelay,
+          redistributionDelay,
+          sendToDLAOnNoRoute,
+          addressFullMessagePolicy);
+      //create the queue
+      jmsServerControl.createTopic(name, jndiName);
+      //update security
+      hornetQServerControl.addSecuritySettings(name, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createTempQueueRoles, deleteTempQueueRoles, "");
+   }
+
+   @ManagementOperation(name = "updateQueueConfiguration", description = "updates a queues configuration",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "jndiName", description = "The JNDI Name of the queue"),
+           @ManagementParameter(name = "dla", description = "Dead Letter Address"),
+           @ManagementParameter(name = "expiryAddress", description = "Expiry Address"),
+           @ManagementParameter(name = "maxSizeBytes", description = "Max Size of Address"),
+           @ManagementParameter(name = "pageSizeBytes", description = "Page Size"),
+           @ManagementParameter(name = "deliveryAttempts", description = "Max Delivery Attempts"),
+           @ManagementParameter(name = "redeliveryDelay", description = "Redelivery Delay"),
+           @ManagementParameter(name = "lastValueQueue", description = "Last Value Queue"),
+           @ManagementParameter(name = "redistributionDelay", description = "Redistribution Delay"),
+           @ManagementParameter(name = "sendToDLAOnNoRoute", description = "Send To DLA on no route"),
+           @ManagementParameter(name = "addressFullMessagePolicy", description = "Address Full Message Policy"),
+           @ManagementParameter(name = "sendRoles", description = "Send roles for a queue"),
+           @ManagementParameter(name = "consumeRoles", description = "consume roles for a queue")              ,
+           @ManagementParameter(name = "createDurableQueueRoles", description = "Send roles for a queue"),
+           @ManagementParameter(name = "deleteDurableQueueRoles", description = "consume roles for a queue"),
+           @ManagementParameter(name = "createTempQueueRoles", description = "Send roles for a queue"),
+           @ManagementParameter(name = "deleteTempQueueRoles", description = "consume roles for a queue")
+       })
+   public void updateTopicConfiguration(String name,
+                                        String jndiName,
+                                        String dla,
+                                        String expiryAddress,
+                                        long maxSizeBytes,
+                                        int pageSizeBytes,
+                                        int deliveryAttempts,
+                                        long redeliveryDelay,
+                                        boolean lastValueQueue,
+                                        long redistributionDelay,
+                                        boolean sendToDLAOnNoRoute,
+                                        String addressFullMessagePolicy,
+                                        String sendRoles,
+                                        String consumeRoles,
+                                         final String createDurableQueueRoles,
+                                         final String deleteDurableQueueRoles,
+                                         final String createTempQueueRoles,
+                                         final String deleteTempQueueRoles) throws Exception
+   {
+      //update the address settings
+      hornetQServerControl.addAddressSettings(name,
+          dla,
+          expiryAddress,
+          lastValueQueue,
+          deliveryAttempts,
+          maxSizeBytes,
+          pageSizeBytes,
+          redeliveryDelay,
+          redistributionDelay,
+          sendToDLAOnNoRoute,
+          addressFullMessagePolicy);
+      //update security
+      hornetQServerControl.addSecuritySettings(name, sendRoles, consumeRoles, createDurableQueueRoles, deleteDurableQueueRoles, createTempQueueRoles, deleteTempQueueRoles, "");
+   }
+
+   @ManagementOperation(name = "getTopicMeasurements", description = "updates a queues configuration",
+       params = {
+           @ManagementParameter(name = "name", description = "the queue name"),
+           @ManagementParameter(name = "names", description = "the measurement names")})
+   public String[] getTopicMeasurements(String name, String[] names) throws Exception
+   {
+      TopicControl control = (TopicControl) managementService.getResource(name);
+      String[] val = new String[names.length];
+      for (int i = 0, valLength = val.length; i < valLength; i++)
+      {
+         Object o = control.getClass().getMethod(names[i]).invoke(control);
+         if(o instanceof Object[])
+         {
+            val[i] = coomaSeparatedString((Object[]) o);
+         }
+         else
+         {
+            val[i] = o.toString();
+         }
+      }
+      return val;
+   }
+
+    @ManagementOperation(name = "invokeTopicOperation", description = "invokes a queues method",
+       params = {
+           @ManagementParameter(name = "name", description = "the topic name"),
+           @ManagementParameter(name = "method", description = "the method"),
+           @ManagementParameter(name = "params", description = "the method params")})
+   public Object invokeTopicOperation(String name, String method, String[] params, String[] type) throws Exception
+   {
+      TopicControl control = (TopicControl) managementService.getResource(name);
+      Class[] classes = getClassTypes(type);
+      Method m = control.getClass().getMethod(method, classes);
+      return m.invoke(control, getParams(params, classes));
+   }
+
+   @ManagementOperation(name = "invokeTopicOperationMessageType", description = "invokes a queues method",
+       params = {
+           @ManagementParameter(name = "name", description = "the topic name"),
+           @ManagementParameter(name = "method", description = "the method"),
+           @ManagementParameter(name = "params", description = "the method params")})
+   @MetaMapping(value = MessageListMapper.class)
+   public List invokeTopicOperationMessageType(String name, String method, String[] params, String[] type) throws Exception
+   {
+      TopicControl control = (TopicControl) managementService.getResource(name);
+      Class[] classes = getClassTypes(type);
+      Method m = control.getClass().getMethod(method, classes);
+
+      Map<String, Serializable>[] maps = (Map<String, Serializable>[]) m.invoke(control, getParams(params, classes));
+      List list = new ArrayList();
+      list.addAll(Arrays.asList(maps));
+      return list;
+   }
+
+   @ManagementOperation(name = "invokeTopicOperationSubscriptionType", description = "invokes a queues method",
+       params = {
+           @ManagementParameter(name = "name", description = "the topic name"),
+           @ManagementParameter(name = "method", description = "the method"),
+           @ManagementParameter(name = "params", description = "the method params")})
+   @MetaMapping(value = SubscriptionInfoMapper.class)
+   public Object[] invokeTopicOperationSubscriptionType(String name, String method, String[] params, String[] type) throws Exception
+   {
+      TopicControl control = (TopicControl) managementService.getResource(name);
+      Class[] classes = getClassTypes(type);
+      Method m = control.getClass().getMethod(method, classes);
+
+      Object[] maps = (Object[]) m.invoke(control, getParams(params, classes));
+      return maps;
+   }
+
+   @ManagementOperation(name = "getJMSTopics", description = "returns the JMS Topics")
+   public String[] getJMSTopics()
+   {
+      return jmsServerControl.getTopicNames();
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntry.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntry.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntry.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.template;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * A BindingEntry.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class BindingEntry
+{
+   @XmlAttribute()
+   public String name;
+   
+   public BindingEntry()
+   {
+   }
+   
+   public BindingEntry(String name)
+   {
+      this.name = name;
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntryAdapter.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntryAdapter.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/BindingEntryAdapter.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.template;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+/**
+ * A BindingEntryAdapter.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class BindingEntryAdapter extends XmlAdapter<BindingEntry, String>
+{
+   @Override
+   public BindingEntry marshal(String v) throws Exception
+   {
+      return v == null ? null : new BindingEntry(v);
+   }
+
+   @Override
+   public String unmarshal(BindingEntry v) throws Exception
+   {
+      return v == null ? null : v.name;
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplate.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplate.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplate.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,202 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.template;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
+import org.hornetq.jms.server.config.JMSConfiguration;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.jms.server.config.TopicConfiguration;
+import org.jboss.deployers.spi.management.DeploymentTemplate;
+import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+import org.jboss.metatype.api.types.CompositeMetaType;
+import org.jboss.metatype.api.values.CompositeValue;
+import org.jboss.metatype.api.values.MapCompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.metatype.plugins.values.MetaValueFactoryBuilder;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VFS;
+
+/**
+ * A HornetQDestinationTemplate.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class HornetQDestinationTemplate implements DeploymentTemplate
+{
+   /** The file suffix. */
+   private static final String FILE_SUFFIX = "hornetq-jms.xml";
+   
+   /** The role attributes. */
+   protected static final String[] attributes = new String[] { "read", "write", "create"};
+   
+   private static final MetaValueFactory mvf = MetaValueFactoryBuilder.create();
+   
+   private DeploymentTemplateInfo info;
+
+   public VirtualFile applyTemplate(DeploymentTemplateInfo info) throws Exception
+   {
+      // Create a temp file
+      File xml = File.createTempFile(getClass().getSimpleName(), FILE_SUFFIX);
+      // Write template
+      writeTemplate(xml, info);
+      // Return virtual file
+      //todo check this
+      //return VFS.getChild(xml.toURI());
+       return VFS.getRoot(xml.toURI());
+   }
+
+   public String getDeploymentName(String deploymentBaseName)
+   {
+      if(deploymentBaseName == null)
+         throw new IllegalArgumentException("Null base name.");
+      
+      if(deploymentBaseName.endsWith(FILE_SUFFIX) == false)
+         deploymentBaseName = deploymentBaseName + FILE_SUFFIX;
+      
+      return deploymentBaseName;
+   }
+
+   public DeploymentTemplateInfo getInfo()
+   {
+      return info;
+   }
+
+   public void setInfo(DeploymentTemplateInfo info)
+   {
+      this.info = info;
+   }
+   
+   private void writeTemplate(File xml, DeploymentTemplateInfo info) throws Exception
+   {
+      if (info == null)
+         throw new IllegalArgumentException("Null template info.");
+      if (info.getProperties() == null)
+         throw new IllegalArgumentException("Null template info.");
+
+      JAXBJMSConfiguration config = new JAXBJMSConfiguration();
+
+      // Look for the destination type using the destinationType ManagedProperty
+      ManagedProperty destTypeMP = info.getProperties().get("destinationType");
+      String destinationType = null;
+      if(destTypeMP == null)
+      {
+         // Try casting this to a DsDataSourceTemplateInfo
+         destinationType = ((HornetQDestinationTemplateInfo)info).getDestinationType();
+      }
+      else
+      {
+         SimpleValue dsTypeSV = (SimpleValue) destTypeMP.getValue();
+         destinationType = dsTypeSV.getValue().toString();
+      }
+
+      String destinationName = (String) getProperty(info, "name");
+      if(destinationName == null)
+         throw new IllegalStateException("Destination name has not been specified!");
+
+      String[] bindings = (String[]) getProperty(info, "bindings");
+      if(bindings == null)
+         throw new IllegalStateException("bindings have not been specified!");
+
+      if("QueueTemplate".equals(destinationType))
+      {
+         JAXBJMSQueueConfiguration queue = new JAXBJMSQueueConfiguration();
+         config.setQueueConfigurations(Arrays.asList(new JMSQueueConfiguration[]{queue}));
+         queue.setName(destinationName);
+         queue.setBindings(bindings);
+      }
+      else if("TopicTemplate".equals(destinationType))
+      {
+         JAXBJMSTopicConfiguration topic = new JAXBJMSTopicConfiguration();
+         config.setTopicConfigurations(Arrays.asList(new TopicConfiguration[]{topic}));
+         topic.setName(destinationName);
+         topic.setBindings(bindings);
+      }
+      else
+         throw new IllegalStateException("Unsupported destination type: " + destinationType);
+
+      JAXBContext context = JAXBContext.newInstance(JAXBJMSConfiguration.class);
+      Marshaller marshaller = context.createMarshaller();
+      marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE);
+
+      JAXBElement<JAXBJMSConfiguration> root = new JAXBElement<JAXBJMSConfiguration>(
+            new javax.xml.namespace.QName("urn:hornetq", "configuration"), JAXBJMSConfiguration.class, null, config);
+
+      Writer fw = null;
+      try
+      {
+         fw = new FileWriter(xml);
+         marshaller.marshal(root, fw);
+      }
+      finally
+      {
+         if (fw != null)
+         {
+            fw.close();
+         }
+      }
+   }
+   
+   /**
+    * Extract the value from the property MetaValue
+    * @param info - template info
+    * @param propName - the name of the property to return a value for
+    * @return the unwrapped property value
+    */
+   private Object getProperty(DeploymentTemplateInfo info, String propName)
+   {
+      Map<String, ManagedProperty> propsInfo = info.getProperties();
+      ManagedProperty prop = propsInfo.get(propName);
+      if(prop == null)
+      {
+         return null;
+      }
+      Object value = prop.getValue();
+      if(value instanceof MetaValue)
+      {
+         return mvf.unwrap((MetaValue) value);
+      }
+      return value;
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplateInfo.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplateInfo.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/HornetQDestinationTemplateInfo.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.integration.hornetq.management.template;
+
+import java.io.ObjectStreamException;
+import java.util.Map;
+
+import org.jboss.managed.api.Fields;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.managed.api.annotation.ViewUse;
+import org.jboss.managed.plugins.BasicDeploymentTemplateInfo;
+import org.jboss.managed.plugins.DefaultFieldsImpl;
+import org.jboss.managed.plugins.ManagedPropertyImpl;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+
+
+/**
+ * A HornetQDestinationTemplateInfo.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class HornetQDestinationTemplateInfo extends BasicDeploymentTemplateInfo
+{
+
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 1L;
+
+   private String destinationType = "QueueTemplate";
+
+   public HornetQDestinationTemplateInfo(String name, String description)
+   {
+      super(name, description);
+   }
+
+   public HornetQDestinationTemplateInfo(String name, String description, Map<String, ManagedProperty> properties)
+   {
+      super(name, description, properties);
+   }
+
+   public void setDestinationType(String destinationType)
+   {
+      this.destinationType = destinationType;
+   }
+   
+   public String getDestinationType()
+   {
+      return destinationType;
+   }
+
+   public void start()
+   {
+      populate();
+   }
+
+   @Override
+   public HornetQDestinationTemplateInfo copy()
+   {
+      HornetQDestinationTemplateInfo copy = new HornetQDestinationTemplateInfo(getName(), getDescription(), getProperties());
+      copy.setDestinationType(getDestinationType());
+      super.copy(copy);
+      copy.populate();
+      return copy;
+   }
+
+   private void populate()
+   {
+      // Add the destination type as a ManagedProperty 
+      DefaultFieldsImpl fields = new DefaultFieldsImpl("destinationType");
+      fields.setDescription("The destination type");
+      fields.setMetaType(SimpleMetaType.STRING);
+      fields.setValue(SimpleValueSupport.wrap(destinationType));
+      fields.setField(Fields.READ_ONLY, Boolean.TRUE);
+      ManagedPropertyImpl destTypeMP = new ManagedPropertyImpl(fields);
+      addProperty(destTypeMP);
+
+      if(getProperties() == null) return;
+      for(ManagedProperty property : getProperties().values())
+      {
+         // Create a new (non-writethrough) managed property
+         Fields f = property.getFields();
+         
+         ManagedPropertyImpl newProperty = new ManagedPropertyImpl(f);
+         
+         // Skip non configuration properties except clustered
+         if(newProperty.hasViewUse(ViewUse.CONFIGURATION) == false
+               && property.getName().equals("clustered") == false)
+            continue;
+         
+         // Override
+         addProperty(newProperty);
+      }
+   }
+
+   /**
+    * Expose only plain BasicDeploymentTemplateInfo to avoid leaking server types.
+    *
+    * @return simpler ManagedPropertyImpl
+    * @throws java.io.ObjectStreamException for any error
+    */
+   private Object writeReplace() throws ObjectStreamException
+   {
+      BasicDeploymentTemplateInfo info = new BasicDeploymentTemplateInfo(getName(), getDescription(), getProperties());
+      return info;
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSConfiguration.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSConfiguration.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSConfiguration.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,92 @@
+/*
+ * 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.as.integration.hornetq.management.template;
+
+import java.util.List;
+
+import javax.naming.Context;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;
+import org.hornetq.jms.server.config.JMSConfiguration;
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+import org.hornetq.jms.server.config.TopicConfiguration;
+
+/**
+ * A JAXBJMSConfiguration.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlRootElement(name="configuration", namespace="urn:hornetq")
+ at XmlType(propOrder={"queues", "topics"})
+public class JAXBJMSConfiguration implements JMSConfiguration, java.io.Serializable
+{   
+   @XmlElement(name="queue", type=JAXBJMSQueueConfiguration.class)
+   private List<JMSQueueConfiguration> queues;
+   
+   @XmlElement(name="topic", type=JAXBJMSTopicConfiguration.class)
+   private List<TopicConfiguration> topics;
+   
+   public List<ConnectionFactoryConfiguration> getConnectionFactoryConfigurations()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   public Context getContext()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   public void setContext(Context arg0)
+   {
+      // TODO Auto-generated method stub
+   }
+
+   public List<JMSQueueConfiguration> getQueueConfigurations()
+   {
+      return queues;
+   }
+
+   public void setQueueConfigurations(List<JMSQueueConfiguration> queues)
+   {
+      this.queues = queues;
+   }
+
+   public List<TopicConfiguration> getTopicConfigurations()
+   {
+      return topics;
+   }
+
+   public void setTopicConfigurations(List<TopicConfiguration> topics)
+   {
+      this.topics = topics;
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSQueueConfiguration.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSQueueConfiguration.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSQueueConfiguration.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,88 @@
+/*
+ * 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.as.integration.hornetq.management.template;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.hornetq.jms.server.config.JMSQueueConfiguration;
+
+/**
+ * A JAXBJMSQueueConfiguration.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(propOrder={"bindings", "selector"})
+public class JAXBJMSQueueConfiguration implements JMSQueueConfiguration
+{
+   @XmlAttribute
+   private String name;
+   
+   @XmlElement(name="entry")
+   @XmlJavaTypeAdapter(BindingEntryAdapter.class)
+   private String[] bindings;
+   
+   @XmlElement
+   private String selector;
+   
+   public String[] getBindings()
+   {
+      return bindings;
+   }
+
+   public void setBindings(String[] bindings)
+   {
+      this.bindings = bindings;
+   }
+   
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getSelector()
+   {
+      return selector;
+   }
+
+   public void setSelector(String selector)
+   {
+      this.selector = selector;
+   }
+
+   public boolean isDurable()
+   {
+      // TODO Auto-generated method stub
+      return false;
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSTopicConfiguration.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSTopicConfiguration.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/JAXBJMSTopicConfiguration.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,67 @@
+/*
+ * 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.as.integration.hornetq.management.template;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.hornetq.jms.server.config.TopicConfiguration;
+
+/**
+ * A JAXBJMSTopicConfiguration.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+public class JAXBJMSTopicConfiguration implements TopicConfiguration
+{
+   @XmlAttribute
+   private String name;
+   
+   @XmlElement(name="entry")
+   @XmlJavaTypeAdapter(BindingEntryAdapter.class)
+   private String[] bindings;
+
+   public String[] getBindings()
+   {
+      return bindings;
+   }
+
+   public void setBindings(String[] bindings)
+   {
+      this.bindings = bindings;
+   }
+   
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+}

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/package-info.java
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/package-info.java	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/main/java/org/jboss/as/integration/hornetq/management/template/package-info.java	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+ at XmlSchema(namespace = "urn:hornetq",
+      elementFormDefault = XmlNsForm.QUALIFIED)
+package org.jboss.as.integration.hornetq.management.template;
+
+import javax.xml.bind.annotation.XmlSchema;
+import javax.xml.bind.annotation.XmlNsForm;

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-configuration.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-configuration.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-configuration.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,105 @@
+<configuration xmlns="urn:hornetq"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+
+   <clustered>true</clustered>
+   
+   <log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
+
+   <bindings-directory>${jboss.server.data.dir}/hornetq/bindings</bindings-directory>
+
+   <journal-directory>${jboss.server.data.dir}/hornetq/journal</journal-directory>
+   
+   <journal-min-files>10</journal-min-files>
+
+   <large-messages-directory>${jboss.server.data.dir}/hornetq/largemessages</large-messages-directory>
+
+   <paging-directory>${jboss.server.data.dir}/hornetq/paging</paging-directory>
+
+   <connectors>
+      <connector name="netty">
+         <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
+         <param key="host"  value="${jboss.bind.address:localhost}"/>
+         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
+      </connector>
+      
+      <connector name="netty-throughput">
+         <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
+         <param key="host"  value="${jboss.bind.address:localhost}"/>
+         <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
+         <param key="batch-delay" value="50"/>
+      </connector>
+
+      <connector name="in-vm">
+         <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
+      </connector>
+
+   </connectors>
+
+   <acceptors>
+      <acceptor name="netty">
+         <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
+         <param key="host"  value="${jboss.bind.address:localhost}"/>
+         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
+      </acceptor>
+      
+      <acceptor name="netty-throughput">
+         <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
+         <param key="host"  value="${jboss.bind.address:localhost}"/>
+         <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
+         <param key="batch-delay" value="50"/>
+      </acceptor>
+
+      <acceptor name="in-vm">
+        <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
+        <param key="server-id" value="0"/>
+      </acceptor>
+
+   </acceptors>
+
+   <broadcast-groups>
+      <broadcast-group name="bg-group1">
+         <group-address>231.7.7.7</group-address>
+         <group-port>9876</group-port>
+         <broadcast-period>5000</broadcast-period>
+         <connector-ref connector-name="netty"/>
+      </broadcast-group>
+   </broadcast-groups>
+
+   <discovery-groups>
+      <discovery-group name="dg-group1">
+         <group-address>231.7.7.7</group-address>
+         <group-port>9876</group-port>
+         <refresh-timeout>10000</refresh-timeout>
+      </discovery-group>
+   </discovery-groups>
+   
+   <cluster-connections>
+      <cluster-connection name="my-cluster">
+         <address>jms</address>	 
+	      <discovery-group-ref discovery-group-name="dg-group1"/>
+      </cluster-connection>
+   </cluster-connections>
+   
+   <security-settings>
+      <security-setting match="#">
+         <permission type="createTempQueue" roles="guest"/>
+         <permission type="deleteTempQueue" roles="guest"/>
+         <permission type="consume" roles="guest"/>
+         <permission type="send" roles="guest"/>
+      </security-setting>
+   </security-settings>
+
+   <address-settings>
+      <!--default for catch all-->
+      <address-setting match="#">
+         <dead-letter-address>jms.queue.DLQ</dead-letter-address>
+         <expiry-address>jms.queue.ExpiryQueue</expiry-address>
+         <redelivery-delay>0</redelivery-delay>
+         <max-size-bytes>10485760</max-size-bytes>       
+         <message-counter-history-day-limit>10</message-counter-history-day-limit>
+         <address-full-policy>BLOCK</address-full-policy>
+      </address-setting>
+   </address-settings>
+
+</configuration>

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-jboss-beans.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-jboss-beans.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-jboss-beans.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- MBean server -->
+   <bean name="MBeanServer" class="javax.management.MBeanServer">
+      <constructor factoryClass="org.jboss.mx.util.MBeanServerLocator"
+                   factoryMethod="locateJBoss"/>
+   </bean>
+
+   <!-- The core configuration -->
+   <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration">
+      <property name="configurationUrl">${jboss.server.home.url}/deploy/hornetq/hornetq-configuration.xml</property>
+   </bean>
+
+	<!-- The security manager -->
+   <bean name="HornetQSecurityManager" class="org.hornetq.integration.jboss.security.JBossASSecurityManager">
+      <depends>JBossSecurityJNDIContextEstablishment</depends>
+      <start ignored="true"/>
+      <stop ignored="true"/>
+   </bean>
+
+	<!-- The core server -->
+   <bean name="HornetQServer" class="org.hornetq.core.server.impl.HornetQServerImpl">
+      <constructor>
+         <parameter>
+            <inject bean="Configuration"/>
+         </parameter>
+         <parameter>
+            <inject bean="MBeanServer"/>
+         </parameter>
+         <parameter>
+            <inject bean="HornetQSecurityManager"/>
+         </parameter>        
+      </constructor>
+      <start ignored="true"/>
+      <stop ignored="true"/>   
+   </bean>
+   
+   <!-- The JMS server -->
+   <bean name="JMSServerManager" class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
+      <constructor>         
+         <parameter>
+            <inject bean="HornetQServer"/>
+         </parameter>         
+      </constructor>
+   </bean>
+
+</deployment>

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-jms.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-jms.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/hornetq-jms.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,43 @@
+<configuration xmlns="urn:hornetq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
+
+   <connection-factory name="NettyConnectionFactory">
+      <connectors>
+         <connector-ref connector-name="netty"/>
+      </connectors>
+      <entries>
+         <entry name="/ConnectionFactory"/>
+         <entry name="/XAConnectionFactory"/>
+      </entries>
+   </connection-factory>
+   
+   <connection-factory name="NettyThroughputConnectionFactory">
+	   <connectors>
+         <connector-ref connector-name="netty-throughput"/>
+	   </connectors>
+		<entries>
+			<entry name="/ThroughputConnectionFactory"/>
+			<entry name="/XAThroughputConnectionFactory"/>
+		</entries>
+	</connection-factory>
+   
+   <connection-factory name="InVMConnectionFactory">
+      <connectors>
+         <connector-ref connector-name="in-vm"/>
+      </connectors>
+      <entries>
+         <entry name="java:/ConnectionFactory"/>
+         <entry name="java:/XAConnectionFactory"/>
+      </entries>
+   </connection-factory>
+
+   <queue name="DLQ">
+      <entry name="/queue/DLQ"/>
+   </queue>
+   
+   <queue name="ExpiryQueue">
+      <entry name="/queue/ExpiryQueue"/>
+   </queue>
+
+</configuration>
\ No newline at end of file

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/jms-ds.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/jms-ds.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/clustered/jms-ds.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,26 @@
+<connection-factories>
+   <!--
+    JMS Stuff
+   -->
+
+   <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="hornetq:service=JMSProviderLoader,name=JMSProvider">
+      <attribute name="ProviderName">DefaultJMSProvider</attribute>
+      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
+      <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
+      <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
+      <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
+   </mbean>
+   <!--
+    JMS XA Resource adapter, use this to get transacted JMS in beans
+   -->
+   <tx-connection-factory>
+      <jndi-name>JmsXA</jndi-name>
+      <xa-transaction/>
+      <rar-name>jms-ra.rar</rar-name>
+      <connection-definition>org.hornetq.ra.HornetQRAConnectionFactory</connection-definition>
+      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
+      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
+      <max-pool-size>20</max-pool-size>
+      <security-domain-and-application>JmsXARealm</security-domain-and-application>
+   </tx-connection-factory>
+</connection-factories>
\ No newline at end of file

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-configuration.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-configuration.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-configuration.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,79 @@
+<configuration xmlns="urn:hornetq"
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+               xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">
+
+   <log-delegate-factory-class-name>org.hornetq.integration.logging.Log4jLogDelegateFactory</log-delegate-factory-class-name>
+   
+   <bindings-directory>${jboss.server.data.dir}/hornetq/bindings</bindings-directory>
+
+   <journal-directory>${jboss.server.data.dir}/hornetq/journal</journal-directory>
+   
+   <journal-min-files>10</journal-min-files>
+
+   <large-messages-directory>${jboss.server.data.dir}/hornetq/largemessages</large-messages-directory>
+
+   <paging-directory>${jboss.server.data.dir}/hornetq/paging</paging-directory>
+
+   <connectors>
+      <connector name="netty">
+         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+         <param key="host"  value="${jboss.bind.address:localhost}"/>
+         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
+      </connector>
+      
+      <connector name="netty-throughput">
+         <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
+         <param key="host"  value="${jboss.bind.address:localhost}"/>
+         <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
+         <param key="batch-delay" value="50"/>
+      </connector>
+
+      <connector name="in-vm">
+         <factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
+      </connector>
+
+   </connectors>
+
+   <acceptors>   
+      <acceptor name="netty">
+         <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
+         <param key="host"  value="${jboss.bind.address:localhost}"/>
+         <param key="port"  value="${hornetq.remoting.netty.port:5445}"/>
+      </acceptor>
+      
+      <acceptor name="netty-throughput">
+         <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
+         <param key="host"  value="${jboss.bind.address:localhost}"/>
+         <param key="port"  value="${hornetq.remoting.netty.batch.port:5455}"/>
+         <param key="batch-delay" value="50"/>
+      </acceptor>
+
+      <acceptor name="in-vm">
+        <factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
+        <param key="server-id" value="0"/>
+      </acceptor>
+
+   </acceptors>
+
+   <security-settings>
+      <security-setting match="#">
+         <permission type="createTempQueue" roles="guest"/>
+         <permission type="deleteTempQueue" roles="guest"/>
+         <permission type="consume" roles="guest"/>
+         <permission type="send" roles="guest"/>
+      </security-setting>
+   </security-settings>
+
+   <address-settings>
+      <!--default for catch all-->
+      <address-setting match="#">
+         <dead-letter-address>jms.queue.DLQ</dead-letter-address>
+         <expiry-address>jms.queue.ExpiryQueue</expiry-address>
+         <redelivery-delay>0</redelivery-delay>
+         <max-size-bytes>10485760</max-size-bytes>       
+         <message-counter-history-day-limit>10</message-counter-history-day-limit>
+         <address-full-policy>BLOCK</address-full-policy>
+      </address-setting>
+   </address-settings>
+
+</configuration>

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-jboss-beans.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-jboss-beans.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-jboss-beans.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- MBean server -->
+   <bean name="MBeanServer" class="javax.management.MBeanServer">
+      <constructor factoryClass="org.jboss.mx.util.MBeanServerLocator"
+                   factoryMethod="locateJBoss"/>
+   </bean>
+
+   <!-- The core configuration -->
+   <bean name="Configuration" class="org.hornetq.core.config.impl.FileConfiguration">
+      <property name="configurationUrl">${jboss.server.home.url}/deploy/hornetq/hornetq-configuration.xml</property>
+   </bean>
+
+	<!-- The security manager -->
+   <bean name="HornetQSecurityManager" class="org.hornetq.integration.jboss.security.JBossASSecurityManager">
+      <depends>JBossSecurityJNDIContextEstablishment</depends>
+      <start ignored="true"/>
+      <stop ignored="true"/>
+   </bean>
+
+	<!-- The core server -->
+   <bean name="HornetQServer" class="org.hornetq.core.server.impl.HornetQServerImpl">
+      <constructor>
+         <parameter>
+            <inject bean="Configuration"/>
+         </parameter>
+         <parameter>
+            <inject bean="MBeanServer"/>
+         </parameter>
+         <parameter>
+            <inject bean="HornetQSecurityManager"/>
+         </parameter>        
+      </constructor>
+      <start ignored="true"/>
+      <stop ignored="true"/>          
+   </bean>
+   
+   <!-- The JMS server -->
+   <bean name="JMSServerManager" class="org.hornetq.jms.server.impl.JMSServerManagerImpl">
+      <constructor>         
+         <parameter>
+            <inject bean="HornetQServer"/>
+         </parameter>         
+      </constructor>
+   </bean>
+
+</deployment>

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-jms.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-jms.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/hornetq-jms.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,43 @@
+<configuration xmlns="urn:hornetq"
+            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
+
+   <connection-factory name="NettyConnectionFactory">
+      <connectors>
+         <connector-ref connector-name="netty"/>
+      </connectors>
+      <entries>
+         <entry name="/ConnectionFactory"/>
+         <entry name="/XAConnectionFactory"/>
+      </entries>
+   </connection-factory>
+   
+   <connection-factory name="NettyThroughputConnectionFactory">
+	   <connectors>
+         <connector-ref connector-name="netty-throughput"/>
+	   </connectors>
+		<entries>
+			<entry name="/ThroughputConnectionFactory"/>
+			<entry name="/XAThroughputConnectionFactory"/>
+		</entries>
+	</connection-factory>
+   
+   <connection-factory name="InVMConnectionFactory">
+      <connectors>
+         <connector-ref connector-name="in-vm"/>
+      </connectors>
+      <entries>
+         <entry name="java:/ConnectionFactory"/>
+         <entry name="java:/XAConnectionFactory"/>
+      </entries>
+   </connection-factory>
+   
+   <queue name="DLQ">
+      <entry name="/queue/DLQ"/>
+   </queue>
+   
+   <queue name="ExpiryQueue">
+      <entry name="/queue/ExpiryQueue"/>
+   </queue>
+
+</configuration>
\ No newline at end of file

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/jms-ds.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/jms-ds.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/config/non-clustered/jms-ds.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,26 @@
+<connection-factories>
+   <!--
+    JMS Stuff
+   -->
+
+   <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="hornetq:service=JMSProviderLoader,name=JMSProvider">
+      <attribute name="ProviderName">DefaultJMSProvider</attribute>
+      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
+      <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
+      <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
+      <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
+   </mbean>
+   <!--
+    JMS XA Resource adapter, use this to get transacted JMS in beans
+   -->
+   <tx-connection-factory>
+      <jndi-name>JmsXA</jndi-name>
+      <xa-transaction/>
+      <rar-name>jms-ra.rar</rar-name>
+      <connection-definition>org.hornetq.ra.HornetQRAConnectionFactory</connection-definition>
+      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
+      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
+      <max-pool-size>20</max-pool-size>
+      <security-domain-and-application>JmsXARealm</security-domain-and-application>
+   </tx-connection-factory>
+</connection-factories>
\ No newline at end of file

Added: branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml	                        (rev 0)
+++ branches/JBPAPP_5_1_hornetq-int/hornetq-int/src/resources/hornetq-deployers-jboss-beans.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="HornetQConfigParserDeployerFile1" class="org.jboss.as.integration.hornetq.deployers.HornetQConfigParserDeployer">
+        <constructor>
+         <parameter>hornetq-configuration.xml</parameter>
+      </constructor>
+   </bean>
+
+   <bean name="HornetQConfigParserDeployerFile2" class="org.jboss.as.integration.hornetq.deployers.HornetQConfigParserDeployer">
+        <constructor>
+         <parameter>hornetq-queues.xml</parameter>
+      </constructor>
+   </bean>
+
+   <bean name="HornetQCoreConfigRealDeployer" class="org.jboss.as.integration.hornetq.deployers.HornetQCoreConfigRealDeployer"/>
+
+   <bean name="HornetQJMSParserDeployer" class="org.jboss.as.integration.hornetq.deployers.HornetQJMSParserDeployer">
+   </bean>
+
+
+   <bean name="HornetQJMSRealDeployer" class="org.jboss.as.integration.hornetq.deployers.HornetQJMSRealDeployer">
+       <demand>HornetQDestinationCreator</demand>
+   </bean>
+
+   <!-- Destination creator for HornetQ
+        This gets "automagically" injected into CreateDestinationDeployer Bean at ejb-deployer-jboss.xml through incallback and uncallback
+    -->
+   <bean name="HornetQDestinationCreator" class="org.jboss.ejb.deployers.CreateDestination">
+      <!-- We match any jms mdb that is going to be deployed using our rar -->
+      <property name="matcher">
+         <bean class="org.jboss.ejb.deployers.SimpleCreateDestinationMatcher">
+            <property name="default">true</property>
+            <property name="messageListener">javax.jms.MessageListener</property>
+            <property name="rarName">jms-ra.rar</property>
+         </bean>
+      </property>
+      <!-- Create a destination with HornetQ -->
+      <property name="factory">
+         <bean class="org.jboss.as.integration.hornetq.deployers.DestinationFactoryDeployerPlugin"/>
+      </property>
+   </bean>
+
+   <bean name="JMSQueueManageMO" class="org.jboss.as.integration.hornetq.management.jms.QueueManageMO">
+      <constructor><parameter><inject bean="HornetQServer" /></parameter></constructor>
+      <demand>JMSServerManager</demand>
+   </bean>
+
+   <bean name="JMSTopicManageMO" class="org.jboss.as.integration.hornetq.management.jms.TopicManageMO">
+      <constructor><parameter><inject bean="HornetQServer" /></parameter></constructor>
+      <demand>JMSServerManager</demand>
+   </bean>
+
+   <bean name="JMSConnectionFactoryManageMO" class="org.jboss.as.integration.hornetq.management.jms.ConnectionFactoryManageMO">
+      <constructor><parameter><inject bean="HornetQServer" /></parameter></constructor>
+      <demand>JMSServerManager</demand>
+   </bean>
+
+   <bean name="JMSServerMO" class="org.jboss.as.integration.hornetq.management.jms.JMSServerMO">
+      <constructor><parameter><inject bean="HornetQServer" /></parameter></constructor>
+      <demand>JMSServerManager</demand>
+   </bean>
+
+</deployment>
\ No newline at end of file

Modified: branches/JBPAPP_5_1_hornetq-int/thirdparty/pom.xml
===================================================================
--- branches/JBPAPP_5_1_hornetq-int/thirdparty/pom.xml	2010-04-30 09:14:36 UTC (rev 104369)
+++ branches/JBPAPP_5_1_hornetq-int/thirdparty/pom.xml	2010-04-30 09:37:03 UTC (rev 104370)
@@ -1655,6 +1655,46 @@
       <artifactId>resources</artifactId>
     </dependency>
     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-core-client</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-core</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-jms</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-jms-client</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-resources</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-jboss-as-integration</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-ra</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-bootstrap</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.hornetq</groupId>
+       <artifactId>hornetq-logging</artifactId>
+     </dependency>
+     <dependency>
+       <groupId>org.jboss.netty</groupId>
+       <artifactId>netty</artifactId>
+     </dependency>
+    <dependency>
       <groupId>org.jboss.metadata</groupId>
       <artifactId>jboss-metadata</artifactId>
     </dependency>




More information about the jboss-cvs-commits mailing list