[jboss-svn-commits] JBL Code SVN: r16435 - in labs/jbosstm/trunk/XTS: sar and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Nov 8 09:15:40 EST 2007


Author: jhalliday
Date: 2007-11-08 09:15:39 -0500 (Thu, 08 Nov 2007)
New Revision: 16435

Added:
   labs/jbosstm/trunk/XTS/sar/
   labs/jbosstm/trunk/XTS/sar/META-INF/
   labs/jbosstm/trunk/XTS/sar/META-INF/jboss-service.xml
   labs/jbosstm/trunk/XTS/sar/WEB-INF/
   labs/jbosstm/trunk/XTS/sar/WEB-INF/web.xml
   labs/jbosstm/trunk/XTS/sar/build.xml
   labs/jbosstm/trunk/XTS/sar/jbossxts.xml
   labs/jbosstm/trunk/XTS/sar/src/
   labs/jbosstm/trunk/XTS/sar/src/org/
   labs/jbosstm/trunk/XTS/sar/src/org/jboss/
   labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/
   labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSService.java
   labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSServiceMBean.java
Log:
Added prototype for new .sar file style of packaging for XTS in JBossAS.


Added: labs/jbosstm/trunk/XTS/sar/META-INF/jboss-service.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/META-INF/jboss-service.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/META-INF/jboss-service.xml	2007-11-08 14:15:39 UTC (rev 16435)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<server>
+
+   <mbean name="jboss.xts:service=XTSService" code="org.jboss.transactions.XTSService">
+       <depends>jboss.web:service=WebServer</depends>
+   </mbean>
+
+</server>

Added: labs/jbosstm/trunk/XTS/sar/WEB-INF/web.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/WEB-INF/web.xml	2007-11-08 14:15:39 UTC (rev 16435)
@@ -0,0 +1,35 @@
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+    <servlet>
+    <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+    <servlet-class>com.arjuna.webservices.transport.http.HttpServiceMultiplexorServlet</servlet-class>
+    <!--
+      The BaseHttpURI and BaseHttpsURI parameters specify the default values
+      used to generate the service URIs without reference to an incoming
+      request.
+     -->
+    <init-param>
+        <param-name>BaseHttpURI</param-name>
+        <param-value>http://localhost:8080/jbossxts/soap/</param-value>
+    </init-param>
+    <!--
+    <init-param>
+        <param-name>BaseHttpsURI</param-name>
+        <param-value>https://localhost:8080/xts/soap/</param-value>
+    </init-param>
+    <init-param>
+        <param-name>LogPackets</param-name>
+        <param-value>true</param-value>
+    </init-param>
+    -->
+    <load-on-startup>1</load-on-startup>
+</servlet>
+
+    <!-- servlet mappings -->
+<servlet-mapping>
+    <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+    <url-pattern>/soap/*</url-pattern>
+</servlet-mapping>
+</web-app>

Added: labs/jbosstm/trunk/XTS/sar/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/build.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/build.xml	2007-11-08 14:15:39 UTC (rev 16435)
@@ -0,0 +1,90 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2007, Red Hat Middleware LLC, and individual contributors
+  as indicated by the @author tags.
+  See the copyright.txt in the distribution for a full listing
+  of individual contributors.
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU General Public License, v. 2.0.
+  This program is distributed in the hope that it will be useful, but WITHOUT A
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+  PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+  You should have received a copy of the GNU General Public License,
+  v. 2.0 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  (C) 2007,
+  @author JBoss Inc.
+-->
+
+<project name="sar" default="sar" basedir=".">
+
+    <!-- ================================================================== -->
+
+    <!-- The properties to override are the following:                      -->
+    <!--    hostname (defaults to localhost)                                -->
+    <!--    port (defaults to 8080 for jboss)                               -->
+
+    <!--    deploy.dir The deployment directory for the ear                 -->
+    <!--    xts.home The installation directory for AXTS                   -->
+    <!-- ================================================================== -->
+
+    <!-- the directory in which XTS resides -->
+    <!-- devs: run 'ant jta; cd XTS; ant install' after svn checkout -->
+    <property name="xts.home" value="../xts-install"/>
+
+    <!-- the directory in which your app server resides (version 4.2.1 expected) -->
+    <property name="jbossas.home" value="/home/jhalli/IdeaProjects/jboss/jbossas421ga/build/output/jboss-4.2.1.GA"/>
+
+
+    <property name="lib.dir" location="${xts.home}/lib"/>
+    <property name="ext.dir" location="${lib.dir}/ext"/>
+
+    <property name="build.dir"         value="build"/>
+
+    <target name="init">
+        <delete dir="${build.dir}"/>
+        <mkdir dir="${build.dir}"/>
+    </target>
+
+    <!-- TODO are the xts engine and its WS stack conceptually separate deployments? at what level do they integrate? spi or jax-ws?-->
+    <target name="sar" depends="init">
+
+        <javac srcdir="src" destdir="${build.dir}">
+            <classpath>
+                <!-- logging -->
+                <pathelement location="${jbossas.home}/lib/jboss-common.jar"/>
+                <!-- mbean -->
+                <pathelement location="${jbossas.home}/lib/jboss-system.jar"/>
+                <pathelement location="${jbossas.home}/lib/jboss-jmx.jar"/>
+                <!-- XTS -->
+                <fileset dir="${lib.dir}" includes="*.jar"/>
+                <fileset dir="${lib.dir}/ext" includes="jbossjta.jar jbossts-common.jar"/>
+            </classpath>
+        </javac>
+
+        <!-- TODO: how to enforce startup ordering? -->
+
+        <jar jarfile="${build.dir}/jbossxts.war">
+            <fileset dir="." includes="WEB-INF/web.xml"/>
+        </jar>
+
+        <jar jarfile="${build.dir}/jbossxts.sar">
+            <fileset dir="${lib.dir}" includes="*.jar"/>
+
+            <fileset dir="." includes="META-INF/jboss-service.xml"/>
+            <fileset dir="${build.dir}" includes="**/*.class"/>
+
+            <fileset dir="${build.dir}" includes="jbossxts.war"/>
+
+            <!-- AS /lib supplies servlet.jar, jbossjta.jar, commons-logging.jar, jbossts-common.jar
+                saaj-api.jar, jaxrpc.jar.  stax is in jbossws.sar but not server /lib    -->
+            <fileset dir="${ext.dir}" includes="stax-api-1.0.jar wstx-asl-2.0.3.jar"/>
+
+            <fileset dir="." includes="jbossxts.xml"/>
+        </jar>
+    </target>
+
+</project>

Added: labs/jbosstm/trunk/XTS/sar/jbossxts.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/jbossxts.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/jbossxts.xml	2007-11-08 14:15:39 UTC (rev 16435)
@@ -0,0 +1,43 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, Red Hat Middleware LLC, and individual contributors
+  as indicated by the @author tags.
+  See the copyright.txt in the distribution for a full listing
+  of individual contributors.
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU General Public License, v. 2.0.
+  This program is distributed in the hope that it will be useful, but WITHOUT A
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+  PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+  You should have received a copy of the GNU General Public License,
+  v. 2.0 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<xts-config>
+	<properties>
+	    <property name="com.arjuna.mw.wsas.deploymentContext"
+	    value="com.arjuna.mwlabs.wst.at.context.DeploymentContextImple"/>
+	    <property name="com.arjuna.mw.wscf.protocols.twophase.context"
+	    value="com.arjuna.mwlabs.wst.at.context.ArjunaContextImple"/>
+	    <property name="com.arjuna.mw.wscf.protocols.sagas.context"
+	    value="com.arjuna.mwlabs.wst.ba.context.ArjunaContextImple"/>
+	    <property
+	    name="com.arjuna.mw.wscf.protocolImplementation1"
+	    value="com.arjuna.mwlabs.wscf.model.twophase.arjunacore.TwoPhaseHLSImple"/>
+	    <property
+	    name="com.arjuna.mw.wscf.protocolImplementation2"
+	    value="com.arjuna.mwlabs.wst.at.ContextFactoryImple"/>
+	    <property
+	    name="com.arjuna.mw.wscf.protocolImplementation3"
+	    value="com.arjuna.mwlabs.wscf.model.sagas.arjunacore.SagasHLSImple"/>
+	    <property
+	    name="com.arjuna.mw.wscf.protocolImplementation4"
+	    value="com.arjuna.mwlabs.wst.ba.ContextFactoryImple"/>
+    </properties>
+</xts-config>
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSService.java
===================================================================
--- labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSService.java	2007-11-08 14:15:39 UTC (rev 16435)
@@ -0,0 +1,403 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.transactions;
+
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.logging.Logger;
+
+import com.arjuna.mw.wsas.utils.Configuration;
+import com.arjuna.mw.wst.deploy.WSTXInitialisation;
+import com.arjuna.mw.wst.UserTransaction;
+import com.arjuna.mw.wst.TransactionManager;
+import com.arjuna.mw.wst.UserBusinessActivity;
+import com.arjuna.mw.wst.BusinessActivityManager;
+import com.arjuna.wsc.ContextFactoryMapper;
+import com.arjuna.wsc.messaging.ActivationCoordinatorProcessorImpl;
+import com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl;
+import com.arjuna.mwlabs.wsc.ContextFactoryMapperImple;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.HandlerRegistry;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.SoapClient;
+import com.arjuna.webservices.util.ClassLoaderHelper;
+import com.arjuna.webservices.wsba.policy.CoordinatorCompletionCoordinatorPolicy;
+import com.arjuna.webservices.wsba.policy.CoordinatorCompletionParticipantPolicy;
+import com.arjuna.webservices.wsba.policy.ParticipantCompletionCoordinatorPolicy;
+import com.arjuna.webservices.wsba.policy.ParticipantCompletionParticipantPolicy;
+import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.webservices.wsba.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.webservices.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
+import com.arjuna.webservices.wsba.processors.ParticipantCompletionCoordinatorProcessor;
+import com.arjuna.webservices.wsat.policy.CompletionCoordinatorPolicy;
+import com.arjuna.webservices.wsat.policy.CompletionInitiatorPolicy;
+import com.arjuna.webservices.wsat.policy.CoordinatorPolicy;
+import com.arjuna.webservices.wsat.policy.ParticipantPolicy;
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.webservices.wsat.processors.ParticipantProcessor;
+import com.arjuna.webservices.wsat.processors.CoordinatorProcessor;
+import com.arjuna.webservices.wsarjtx.policy.TerminationParticipantPolicy;
+import com.arjuna.webservices.wsarjtx.policy.TerminationCoordinatorPolicy;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.webservices.transport.http.HttpClient;
+import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
+import com.arjuna.webservices.wscoor.policy.ActivationCoordinatorPolicy;
+import com.arjuna.webservices.wscoor.policy.ActivationRequesterPolicy;
+import com.arjuna.webservices.wscoor.policy.RegistrationCoordinatorPolicy;
+import com.arjuna.webservices.wscoor.policy.RegistrationRequesterPolicy;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.processors.ActivationCoordinatorProcessor;
+import com.arjuna.webservices.wscoor.processors.RegistrationCoordinatorProcessor;
+import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+import com.arjuna.wst.messaging.*;
+import com.arjuna.ats.arjuna.recovery.RecoveryManager;
+
+import java.io.InputStream;
+
+/**
+ * $Id$
+ */
+public class XTSService extends ServiceMBeanSupport implements XTSServiceMBean {
+
+    // TODO expose as bean properties
+    private int taskManagerMinWorkerCount = 0;
+    private int taskManagerMaxWorkerCount = 10;
+
+    // TODO: how to use a (per application) remote coordinator?
+    // does the http servlet param indicate its own location and the
+    // coordinatorURL indicate the coord??
+
+    // ./HashedActionStore/defaultStore/StateManager/BasicAction/AtomicAction/TwoPhaseCoordinator/TwoPhase/ACCoordinator/
+
+//    	    <property
+//	    name="com.arjuna.ats.arjuna.recovery.recoveryExtension1"
+//	    value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule"/>
+    // recovers /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction
+    // not what we need.
+
+    // TODO: new recovery mod, inheriting from existing base version e.g. AtomicActionRecoveryModule - change typex
+
+    public XTSService() {}
+
+    protected void startService() throws Exception
+    {
+        getLog().info("JBossTS XTS Transaction Service - starting");
+
+        InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/jjh.properties");
+                    if(inputStream != null) {
+                        System.out.println("jjh found it (sar).");
+                    }
+
+                InputStream inputStream2 = this.getClass().getResourceAsStream("/jjh.properties");
+                    if(inputStream2 != null) {
+                        System.out.println("jjh found it (sar) local.");
+                    }
+
+
+
+        // read unified properties file (replaces wscf.xml and wstx.xml)
+        Configuration.initialise("/jbossxts.xml");
+
+        //// wscf.war:
+
+        WSCFInitialisation();  // com.arjuna.mw.wsc.deploy.WSCFInitialisation: Initialise WSCF
+
+        //// ws-c.war:
+
+        TaskManagerInitialisation(); // com.arjuna.services.framework.admin.TaskManagerInitialisation : initialise the Task Manager
+        ActivationCoordinatorInitialisation(); // com.arjuna.webservices.wscoor.server.ActivationCoordinatorInitialisation : Activate the Activation Coordinator service
+        ActivationRequesterInitialisation(); // com.arjuna.webservices.wscoor.server.ActivationRequesterInitialisation : Activate the Activation Requester service
+        RegistrationCoordinatorInitialisation(); // com.arjuna.webservices.wscoor.server.RegistrationCoordinatorInitialisation : Activate the Registration Coordinator service
+        RegistrationRequesterInitialisation(); // com.arjuna.webservices.wscoor.server.RegistrationRequesterInitialisation : Activate the Registration Requester service
+        CoordinationInitialisation(); // com.arjuna.wsc.messaging.deploy.CoordinationInitialisation : Initialise the coordination services.
+        HttpClientInitialisation(); // com.arjuna.webservices.transport.http.HttpClientInitialisation : initialise the HTTP clients.
+        // TODO: HTTP SOAP Service Multiplexor Servlet
+
+        //// ws-t.war:
+
+        TerminationParticipantInitialisation(); // com.arjuna.webservices.wsarjtx.server.TerminationParticipantInitialisation : Arjuna TX - Activate the Terminator Participant  service
+        TerminationCoordinatorInitialisation(); // com.arjuna.webservices.wsarjtx.server.TerminationCoordinatorInitialisation : Arjuna TX - Activate the Terminator Coordinator service
+
+        CompletionCoordinatorInitialisation(); // com.arjuna.webservices.wsat.server.CompletionCoordinatorInitialisation : WS-AT - Activate the Completion Coordinator service
+        CompletionInitiatorInitialisation(); // com.arjuna.webservices.wsat.server.CompletionInitiatorInitialisation : WS-AT - Activate the Completion Initiator service
+        CoordinatorInitialisation(); // com.arjuna.webservices.wsat.server.CoordinatorInitialisation : WS-AT: Activate the Coordinator service
+        ParticipantInitialisation(); // com.arjuna.webservices.wsat.server.ParticipantInitialisation : WS-AT - Activate the Participant service
+
+        CoordinatorCompletionCoordinatorInitialisation(); // com.arjuna.webservices.wsba.server.CoordinatorCompletionCoordinatorInitialisation : WS-BA - Activate the Coordinator Completion Coordinator service
+        CoordinatorCompletionParticipantInitialisation(); // com.arjuna.webservices.wsba.server.CoordinatorCompletionParticipantInitialisation : WS-BA - Activate the Coordinator Completion Participant service
+        ParticipantCompletionCoordinatorInitialisation(); // com.arjuna.webservices.wsba.server.ParticipantCompletionCoordinatorInitialisation : WS-BA - Activate the Participant Completion Coordinator service
+        ParticipantCompletionParticipantInitialisation(); // com.arjuna.webservices.wsba.server.ParticipantCompletionParticipantInitialisation : WS-BA - Activate the Participant Completion Participant service
+
+        TransactionInitialisation(); // com.arjuna.wst.messaging.deploy.TransactionInitialisation : WS-T - Initialise the transaction services.
+
+        //// wstx.war:
+
+        WSTXInitialisation(); // com.arjuna.mw.wst.deploy.WSTXInitialisation : Initialise WSTX
+
+        ACCoordinatorRecoveryModule acCoordinatorRecoveryModule = new ACCoordinatorRecoveryModule();
+        // we assume the tx manager has started, hence initializing the recovery manager.
+        // to guarantee this our mbean should depend on the tx mgr mbean. (but does that g/tee start or just load?)
+        RecoveryManager.manager().addModule(acCoordinatorRecoveryModule); // TODO thread safety.
+
+    }
+
+    protected void stopService() throws Exception
+    {
+        getLog().info("JBossTS XTS Transaction Service - stopping");
+
+        TaskManager.getManager().shutdown() ; // com.arjuna.services.framework.admin.TaskManagerInitialisation
+
+        // HttpClientInitialisation
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        soapRegistry.removeSoapClient("http") ;
+        soapRegistry.removeSoapClient("https") ;
+    }
+
+
+    ///////////////////////////////
+
+    private void WSCFInitialisation() throws Exception
+    {
+        //Configuration.initialise("/wscf.xml");
+
+        final ContextFactoryMapper wscfImpl = ContextFactoryMapper.getFactory() ;
+
+        wscfImpl.setSubordinateContextFactoryMapper(new ContextFactoryMapperImple());
+    }
+
+    private void TaskManagerInitialisation()
+    {
+        final TaskManager taskManager = TaskManager.getManager() ;
+        taskManager.setMinimumWorkerCount(taskManagerMinWorkerCount) ;
+        taskManager.setMaximumWorkerCount(taskManagerMaxWorkerCount) ;
+    }
+
+    private void ActivationCoordinatorInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        AddressingPolicy.register(handlerRegistry) ;
+        // Add Activation coordinator.
+        ActivationCoordinatorPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR, handlerRegistry);
+    }
+
+    private void ActivationRequesterInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        AddressingPolicy.register(handlerRegistry) ;
+        // Add Activation coordinator.
+        ActivationRequesterPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(CoordinationConstants.SERVICE_ACTIVATION_REQUESTER, handlerRegistry);
+    }
+
+    private void RegistrationCoordinatorInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Registration coordinator.
+        RegistrationCoordinatorPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR, handlerRegistry);
+    }
+
+    private void RegistrationRequesterInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        AddressingPolicy.register(handlerRegistry) ;
+        // Add Registration coordinator.
+        RegistrationRequesterPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(CoordinationConstants.SERVICE_REGISTRATION_REQUESTER, handlerRegistry);
+    }
+
+    private void CoordinationInitialisation()
+    {
+        ActivationCoordinatorProcessor.setCoordinator(new ActivationCoordinatorProcessorImpl()) ;
+        RegistrationCoordinatorProcessor.setCoordinator(new RegistrationCoordinatorProcessorImpl()) ;
+    }
+
+    private void HttpClientInitialisation()
+    {
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        final SoapClient client = new HttpClient() ;
+        soapRegistry.registerSoapClient("http", client) ;
+        soapRegistry.registerSoapClient("https", client) ;
+    }
+
+    private void TerminationParticipantInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Terminator coordinator.
+        TerminationParticipantPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(ArjunaTXConstants.SERVICE_TERMINATION_PARTICIPANT, handlerRegistry);
+    }
+
+    private void TerminationCoordinatorInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Terminator participant.
+        TerminationCoordinatorPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(ArjunaTXConstants.SERVICE_TERMINATION_COORDINATOR, handlerRegistry);
+    }
+
+    private void CompletionCoordinatorInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Completion coordinator.
+        CompletionCoordinatorPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(AtomicTransactionConstants.SERVICE_COMPLETION_COORDINATOR, handlerRegistry);
+    }
+
+    private void CompletionInitiatorInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Completion initiator.
+        CompletionInitiatorPolicy.register(handlerRegistry);
+
+        addToSOAPRegistry(AtomicTransactionConstants.SERVICE_COMPLETION_INITIATOR, handlerRegistry);
+    }
+
+    private void CoordinatorInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add coordinator.
+        CoordinatorPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(AtomicTransactionConstants.SERVICE_COORDINATOR, handlerRegistry);
+    }
+
+    private void ParticipantInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Participant.
+        ParticipantPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(AtomicTransactionConstants.SERVICE_PARTICIPANT, handlerRegistry);
+    }
+
+    private void CoordinatorCompletionCoordinatorInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Coordinator Completion coordinator.
+        CoordinatorCompletionCoordinatorPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_COORDINATOR, handlerRegistry);
+    }
+
+    private void CoordinatorCompletionParticipantInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Coordinator Completion participant.
+        CoordinatorCompletionParticipantPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_PARTICIPANT, handlerRegistry);
+    }
+
+    private void ParticipantCompletionCoordinatorInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Participant Completion coordinator.
+        ParticipantCompletionCoordinatorPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_COORDINATOR, handlerRegistry);
+    }
+
+    private void ParticipantCompletionParticipantInitialisation()
+    {
+        final HandlerRegistry handlerRegistry = getHandlerRegistry();
+
+        // Add Participant Completion participant.
+        ParticipantCompletionParticipantPolicy.register(handlerRegistry) ;
+
+        addToSOAPRegistry(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_PARTICIPANT, handlerRegistry);
+    }
+
+    private void TransactionInitialisation()
+    {
+        CompletionCoordinatorProcessor.setProcessor(new CompletionCoordinatorProcessorImpl()) ;
+        ParticipantProcessor.setProcessor(new ParticipantProcessorImpl()) ;
+        CoordinatorProcessor.setProcessor(new CoordinatorProcessorImpl()) ;
+        TerminationCoordinatorProcessor.setProcessor(new TerminatorParticipantProcessorImpl()) ;
+        CoordinatorCompletionParticipantProcessor.setProcessor(new CoordinatorCompletionParticipantProcessorImpl()) ;
+        ParticipantCompletionParticipantProcessor.setProcessor(new ParticipantCompletionParticipantProcessorImpl()) ;
+        CoordinatorCompletionCoordinatorProcessor.setProcessor(new CoordinatorCompletionCoordinatorProcessorImpl()) ;
+        ParticipantCompletionCoordinatorProcessor.setProcessor(new ParticipantCompletionCoordinatorProcessorImpl()) ;
+    }
+
+    private void WSTXInitialisation() throws Exception
+    {
+        // we don't know if the servlet is inited yet since its deploy is async,
+        // so play it safe and set the URL here too since UserTransactionImple needs it.
+        System.setProperty("com.arjuna.mw.wst.coordinatorURL", "http://localhost:8080/jbossxts/soap/ActivationCoordinator");
+
+        // wst.xml ignored. TODO: make these configurable again (mbean properties?):
+        UserTransaction.setUserTransaction(new com.arjuna.mwlabs.wst.at.remote.UserTransactionImple());
+        TransactionManager.setTransactionManager(new com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple());
+        UserBusinessActivity.setUserBusinessActivity(new com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple());
+        BusinessActivityManager.setBusinessActivityManager(new com.arjuna.mwlabs.wst.ba.remote.BusinessActivityManagerImple());
+
+        // TODO: should this really be after the above? At least one property from this file (coordinatorURL)
+        // would seem to be required at an earlier stage.
+        //Configuration.initialise("/wstx.xml");
+
+    }
+    ////
+
+    private HandlerRegistry getHandlerRegistry() {
+        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        AddressingPolicy.register(handlerRegistry) ;
+        // Add Arjuna handlers
+        ArjunaPolicy.register(handlerRegistry) ;
+
+        return handlerRegistry;
+    }
+
+    private void addToSOAPRegistry(String serviceName, HandlerRegistry handlerRegistry)
+    {
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        soapRegistry.registerSoapService(serviceName, new SoapService(handlerRegistry)) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSServiceMBean.java
===================================================================
--- labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSServiceMBean.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSServiceMBean.java	2007-11-08 14:15:39 UTC (rev 16435)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.transactions;
+
+/**
+ * $Id$
+ */
+public interface XTSServiceMBean  extends org.jboss.system.ServiceMBean {
+}




More information about the jboss-svn-commits mailing list