[jboss-svn-commits] JBL Code SVN: r21716 - in labs/jbosstm/trunk/XTS: WS-C/dev/dd and 24 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Aug 22 09:55:14 EDT 2008
Author: adinn
Date: 2008-08-22 09:55:13 -0400 (Fri, 22 Aug 2008)
New Revision: 21716
Added:
labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/common/
labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/common/Environment.java
labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/common/
labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/common/Environment.java
Modified:
labs/jbosstm/trunk/XTS/WS-C/build.xml
labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c11_web-app.xml
labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_web-app.xml
labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/Sequencer.java
labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpServiceMultiplexorServlet.java
labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java
labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/build.xml
labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t11_web-app.xml
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java
labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java
labs/jbosstm/trunk/XTS/WSAS/build.xml
labs/jbosstm/trunk/XTS/WSCF/build.xml
labs/jbosstm/trunk/XTS/WSTX/build.xml
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java
labs/jbosstm/trunk/XTS/WSTX/config/wstx.xml
labs/jbosstm/trunk/XTS/WSTX/config/wstx11.xml
labs/jbosstm/trunk/XTS/demo/xts-build.xml
labs/jbosstm/trunk/XTS/sar/META-INF/jboss-beans.xml
labs/jbosstm/trunk/XTS/sar/build.xml
labs/jbosstm/trunk/XTS/sar/src/org/jboss/jbossts/XTSService.java
Log:
modified to ensure coordinator URL can be configured from config file, from sar build and from JBoss command line
Modified: labs/jbosstm/trunk/XTS/WS-C/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/build.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-C/build.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -42,8 +42,6 @@
<!-- ================================================================== -->
<property name="deploy.dir" value="${jboss.server.dir}/deploy"/>
- <property name="hostname" value="localhost"/>
- <property name="port" value="8080"/>
<!-- ================================================================== -->
@@ -263,16 +261,8 @@
<target name="dev-webapps" depends="dev-jars" >
<copy file="${dev.dd.dir}/ws-c_web-app.xml" tofile="${build.dev.dd.dir}/web-app.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<copy file="${dev.dd.dir}/ws-c11_web-app.xml" tofile="${build.dev.dd.dir}/web-app11.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<copy file="${dev.dd.dir}/ws-c_handlers.xml" tofile="${build.dev.classes11.dir}/handlers.xml"/>
<war warfile="${build.dev.webapps.dir}/ws-c10.war" webxml="${build.dev.dd.dir}/web-app.xml"/>
@@ -297,16 +287,8 @@
<target name="tests-webapps" depends="tests-compile" >
<copy file="${tests.dd.dir}/ws-c-tests_web-app.xml" tofile="${build.tests.dd.dir}/web-app.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<copy file="${tests.dd.dir}/ws-c11-tests_web-app.xml" tofile="${build.tests.dd.dir}/web-app11.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<war warfile="${build.tests.webapps.dir}/ws-c-tests.war" webxml="${build.tests.dd.dir}/web-app.xml">
<classes dir="${build.tests.classes.dir}"/>
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c11_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c11_web-app.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c11_web-app.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,11 +27,6 @@
<description>WS-Coordination 1.1 Services</description>
- <!-- base URL for location of Coordination 1.1 services -->
- <context-param>
- <param-name>BaseURI</param-name>
- <param-value>http://@hostname@:@port@/ws-c11</param-value>
- </context-param>
<!-- Initialise WS Coord 1.1 services -->
<listener>
<listener-class>com.arjuna.webservices11.wscoor.server.ActivationCoordinatorInitialisation</listener-class>
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_web-app.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_web-app.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -71,20 +71,7 @@
<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://@hostname@:@port@/ws-c10/soap/</param-value>
- </init-param>
- <!--
- <init-param>
- <param-name>BaseHttpsURI</param-name>
- <param-value>https://@hostname@:@port@/xts/soap/</param-value>
- </init-param>
- <init-param>
<param-name>LogPackets</param-name>
<param-value>true</param-value>
</init-param>
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/Sequencer.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/Sequencer.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/Sequencer.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -130,9 +130,27 @@
public abstract void run();
}
+ /**
+ * undo the latch which initially delays running of any callback sequences. this is provided
+ * to enable the Service start routine to configure any necessary parameters before the
+ * listener callbacks are run. It is synchronized on the class so we can safely notify any
+ * threads waiting to pass the latch which will be waiting on the Sequencer.class.
+ */
+ public static synchronized void unlatch()
+ {
+ latched = false;
+ Sequencer.class.notifyAll();
+ }
+
// private implementation
/**
+ * a global latch used to delay running of callbacks until the XTS servcie is ready to
+ * let them run
+ */
+ private static boolean latched = true;
+
+ /**
* a global list of all startup sequences
*/
private static final Sequencer[] SEQUENCERS =
@@ -202,6 +220,9 @@
private void runCallbacks()
{
+ // we cannot run the callbacks until the sequencer has been unlatched
+ passLatch();
+
for (int i = 0; i < sequenceSize; i++) {
Iterator<Callback> iter = callbacks[i].iterator();
while (iter.hasNext()) {
@@ -212,6 +233,20 @@
}
/**
+ * do not return until the latch has been lifted
+ */
+ private static synchronized void passLatch()
+ {
+ while (latched) {
+ try {
+ Sequencer.class.wait();
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ }
+ }
+
+ /**
* construct a Sequencer to manage registration and execution of callbacks associated with an ordered sequence
* of web apps
* @param sequenceSize count of the number of web apps for which callbacks are to be registered
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpServiceMultiplexorServlet.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpServiceMultiplexorServlet.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpServiceMultiplexorServlet.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -40,6 +40,7 @@
import com.arjuna.webservices.SoapServiceEndpointProvider;
import com.arjuna.webservices.util.ClassLoaderHelper;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc.common.Environment;
/**
* Servlet handling SOAP requests over HTTP.
@@ -368,8 +369,34 @@
}
return buffer.substring(startIndex, endIndex+1) ;
}
-
+
/**
+ * called by the sequencer callback to set the base address used to construct the XTS
+ * service URLs.
+ */
+ private void configureBaseURIs()
+ {
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+
+ if (secureBindPort == null) {
+ secureBindPort = "8080";
+ }
+
+ baseHttpURI = "http://" + bindAddress + ":" + bindPort + "/ws-c10/soap/";
+ baseHttpsURI = "http://" + bindAddress + ":" + secureBindPort + "/ws-c10/soap/";
+ }
+
+ /**
* Configure the endpoint servlet.
* @param servletConfig The servlet configuration.
* @throws ServletException For errors during configuration.
@@ -384,15 +411,10 @@
final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
soapRegistry.registerSoapServiceProvider(HttpUtils.HTTP_SCHEME, servlet) ;
soapRegistry.registerSoapServiceProvider(HttpUtils.HTTPS_SCHEME, servlet) ;
+ servlet.configureBaseURIs();
}
};
- // must do this before we close the callback list because some of the other callbacks depend upon and
- // we don't want to introduce a race
-
- baseHttpURI = processURI(servletConfig.getInitParameter("BaseHttpURI")) ;
- baseHttpsURI = processURI(servletConfig.getInitParameter("BaseHttpsURI")) ;
-
// this is the last WSC callback to be initialised so close the list
Sequencer.close(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10);
Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/common/Environment.java (from rev 21606, labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/common/Environment.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/common/Environment.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -0,0 +1,44 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Environment.java,v 1.6 2004/09/09 08:48:48 kconner Exp $
+ */
+
+package com.arjuna.wsc.common;
+
+/**
+ */
+
+public interface Environment
+{
+
+ public static final String XTS_BIND_ADDRESS = "org.jboss.jbossts.xts.bind.address";
+ public static final String XTS_BIND_PORT = "org.jboss.jbossts.xts.bind.port";
+ public static final String XTS_SECURE_BIND_PORT = "org.jboss.jbossts.xts.bind.port.secure";
+ public static final String XTS_COMMAND_LINE_COORDINATOR_URL = "org.jboss.jbossts.xts.command.line.coordinatorURL";
+}
\ No newline at end of file
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -23,6 +23,7 @@
import com.arjuna.services.framework.startup.Sequencer;
import com.arjuna.webservices11.wscoor.CoordinationConstants;
import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.common.Environment;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
@@ -40,16 +41,26 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/ActivationService";
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSC11) {
public void run() {
// TODO if we rely upon JaxWS to automatically publish implementation classes it will only
// do so under a URL based on service name. which means we cannot define a service using
// multiple port bindings because thsi causes a namespace clash
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-c11/";
+ final String uri = baseUri + "ActivationService";
+
serviceRegistry.registerServiceProvider(CoordinationConstants.ACTIVATION_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -23,6 +23,7 @@
import com.arjuna.services.framework.startup.Sequencer;
import com.arjuna.webservices11.wscoor.CoordinationConstants;
import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.common.Environment;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
@@ -40,14 +41,24 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/RegistrationService";
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSC11) {
public void run() {
// TODO work out how to configure the endpoint name here
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-c11/";
+ final String uri = baseUri + "RegistrationService";
+
serviceRegistry.registerServiceProvider(CoordinationConstants.REGISTRATION_SERVICE_NAME, uri) ;
}
};
Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/common/Environment.java (from rev 21606, labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/common/Environment.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/common/Environment.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -0,0 +1,45 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Environment.java,v 1.6 2004/09/09 08:48:48 kconner Exp $
+ */
+
+package com.arjuna.wsc11.common;
+
+/**
+ */
+
+public interface Environment
+{
+
+ public static final String XTS_BIND_ADDRESS = "org.jboss.jbossts.xts11.bind.address";
+ public static final String XTS_BIND_PORT = "org.jboss.jbossts.xts11.bind.port";
+ public static final String XTS_SECURE_BIND_PORT = "org.jboss.jbossts.xts11.bind.port.secure";
+ public static final String XTS_COMMAND_LINE_COORDINATOR_URL = "org.jboss.jbossts.xts11.command.line.coordinatorURL";
+
+}
\ No newline at end of file
Modified: labs/jbosstm/trunk/XTS/WS-T/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/build.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/build.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -43,8 +43,6 @@
<!-- ================================================================== -->
<property name="deploy.dir" value="${jboss.server.dir}/deploy"/>
- <property name="hostname" value="localhost"/>
- <property name="port" value="8080"/>
<property name="ws-c.home" value="../WS-C"/>
<!-- ================================================================== -->
@@ -298,16 +296,8 @@
<target name="dev-webapps" depends="dev-jars">
<copy file="${dev.dd.dir}/ws-t_web-app.xml" tofile="${build.dev.dd.dir}/web-app.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<copy file="${dev.dd.dir}/ws-t11_web-app.xml" tofile="${build.dev.dd.dir}/web-app11.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<copy file="${dev.dd.dir}/ws-t_handlers.xml" tofile="${build.dev.classes11.dir}/handlers.xml"/>
<war warfile="${build.dev.webapps.dir}/ws-t10.war" webxml="${build.dev.dd.dir}/web-app.xml"/>
@@ -341,18 +331,10 @@
</manifest>
</jar>
<copy file="${tests.dd.dir}/ws-t-tests_web-app.xml" tofile="${build.tests.dd.dir}/web-app.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<war warfile="${build.tests.webapps.dir}/ws-t-tests.war" webxml="${build.tests.dd.dir}/web-app.xml">
</war>
<copy file="${tests.dd.dir}/ws-t11-tests_web-app.xml" tofile="${build.tests.dd.dir}/web-app11.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<war warfile="${build.tests.webapps.dir}/ws-t11-tests.war" webxml="${build.tests.dd.dir}/web-app11.xml">
</war>
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t11_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t11_web-app.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t11_web-app.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,11 +27,6 @@
<description>Arjuna Web Services Transaction 1.1</description>
- <!-- base URL for location of Web Services Transaction 1.1 services -->
- <context-param>
- <param-name>BaseURI</param-name>
- <param-value>http://@hostname@:@port@/ws-t11</param-value>
- </context-param>
<!-- Initialise Arjuna TX 1.1 services -->
<listener>
<listener-class>com.arjuna.webservices11.wsarjtx.server.TerminationParticipantInitialisation</listener-class>
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -23,6 +23,7 @@
import com.arjuna.services.framework.startup.Sequencer;
import com.arjuna.webservices11.wsarjtx.ArjunaTX11Constants;
import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.common.Environment;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
@@ -40,13 +41,23 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME;
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,6 +27,7 @@
import com.arjuna.webservices11.wsarjtx.ArjunaTX11Constants;
import com.arjuna.webservices11.ServiceRegistry;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc11.common.Environment;
/**
* Activate the Terminator Coordinator service
@@ -40,13 +41,22 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME;
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME;
serviceRegistry.registerServiceProvider(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -23,6 +23,7 @@
import com.arjuna.services.framework.startup.Sequencer;
import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.common.Environment;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
@@ -40,13 +41,24 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME;
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,6 +27,7 @@
import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
import com.arjuna.webservices11.ServiceRegistry;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc11.common.Environment;
/**
* Activate the Completion Initiator service
@@ -40,13 +41,24 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME;
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,6 +27,7 @@
import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
import com.arjuna.webservices11.ServiceRegistry;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc11.common.Environment;
/**
* Activate the Coordinator service
@@ -40,13 +41,23 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + AtomicTransactionConstants.COORDINATOR_SERVICE_NAME;
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + AtomicTransactionConstants.COORDINATOR_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,6 +27,7 @@
import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
import com.arjuna.webservices11.ServiceRegistry;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc11.common.Environment;
/**
* Activate the Participant service
@@ -40,13 +41,23 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME;
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -23,6 +23,7 @@
import com.arjuna.services.framework.startup.Sequencer;
import com.arjuna.webservices11.wsba.BusinessActivityConstants;
import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.common.Environment;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
@@ -40,13 +41,23 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME;
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,6 +27,7 @@
import com.arjuna.webservices11.wsba.BusinessActivityConstants;
import com.arjuna.webservices11.ServiceRegistry;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc11.common.Environment;
/**
* Activate the Coordinator Completion Participant service
@@ -40,13 +41,23 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME;
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,6 +27,7 @@
import com.arjuna.webservices11.wsba.BusinessActivityConstants;
import com.arjuna.webservices11.ServiceRegistry;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc11.common.Environment;
/**
* Activate the Participant Completion Coordinator service
@@ -40,13 +41,23 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -27,6 +27,7 @@
import com.arjuna.webservices11.wsba.BusinessActivityConstants;
import com.arjuna.webservices11.ServiceRegistry;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc11.common.Environment;
/**
* Activate the Participant Completion Participant service
@@ -40,13 +41,23 @@
*/
public void contextInitialized(final ServletContextEvent servletContextEvent)
{
- ServletContext context = servletContextEvent.getServletContext();
- String baseURI = context.getInitParameter("BaseURI");
- final String uri = baseURI + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;
-
Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
public void run() {
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ String secureBindPort = System.getProperty(Environment.XTS_SECURE_BIND_PORT);
+
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ final String baseUri = "http://" + bindAddress + ":" + bindPort + "/ws-t11/";
+ final String uri = baseUri + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;
+
serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, uri) ;
}
};
Modified: labs/jbosstm/trunk/XTS/WSAS/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/build.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSAS/build.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -29,12 +29,10 @@
<!-- Load Build Properties File -->
<property file="${com.arjuna.mw.wsas.properties}"/>
- <!-- Set hostname and port property defaults -->
+ <!-- Set property defaults -->
<property environment="env"/>
<property name="jboss.dir" value="${env.JBOSS_HOME}"/>
<property name="deploy.dir" value="${jboss.dir}/server/default/deploy"/>
- <property name="hostname" value="localhost"/>
- <property name="port" value="8080"/>
<property name="jboss.client.lib.dir" location="${jboss.dir}/client"/>
@@ -215,10 +213,6 @@
<target name="com.arjuna.mwlabs.wsas.tests.webapps" depends="com.arjuna.mwlabs.wsas.tests.compile">
<copy file="${com.arjuna.mwlabs.wsas.tests.dd}/wsas-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wsas.tests.dd.dest}/web-app.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<war warfile="${com.arjuna.mwlabs.wsas.tests.webapps.dest}/wsas-tests.war" webxml="${com.arjuna.mwlabs.wsas.tests.dd.dest}/web-app.xml">
<classes dir="${com.arjuna.mwlabs.wsas.tests.dest}"/>
Modified: labs/jbosstm/trunk/XTS/WSCF/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/build.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSCF/build.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -39,8 +39,6 @@
<property name="jboss.server.lib.dir" location="${jboss.server.dir}/lib"/>
<property name="deploy.dir" value="${jboss.server.dir}/deploy"/>
- <property name="hostname" value="localhost"/>
- <property name="port" value="8080"/>
<!-- Set internal property defaults -->
<!-- Path names -->
@@ -328,16 +326,8 @@
<target name="com.arjuna.mwlabs.wscf.tests.webapps" depends="com.arjuna.mwlabs.wscf.tests.compile">
<copy file="${com.arjuna.mwlabs.wscf.tests.dd}/wscf-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<copy file="${com.arjuna.mwlabs.wscf.tests.dd}/wscf11-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app11.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<jar jarfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.jar">
<fileset dir="${com.arjuna.mwlabs.wscf.tests.dest}"/>
Modified: labs/jbosstm/trunk/XTS/WSTX/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/build.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSTX/build.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -29,7 +29,7 @@
<!-- Load Build Properties File -->
<property file="${com.arjuna.mw.wstx.properties}"/>
- <!-- Set hostname and port property defaults -->
+ <!-- Set property defaults -->
<property environment="env"/>
<property name="jboss.home" value="${env.JBOSS_HOME}"/>
<property name="jboss.server" value="default"/>
@@ -39,8 +39,6 @@
<property name="jboss.server.lib.dir" location="${jboss.server.dir}/lib"/>
<property name="deploy.dir" value="${jboss.server.dir}/deploy"/>
- <property name="hostname" value="localhost"/>
- <property name="port" value="8080"/>
<!-- Path names -->
<property name="com.arjuna.mwlabs.wstx.src" value="classes"/>
@@ -349,16 +347,8 @@
<target name="com.arjuna.mwlabs.wstx.tests.webapps" depends="com.arjuna.mwlabs.wstx.tests.compile">
<copy file="${com.arjuna.mwlabs.wstx.tests.dd}/wstx-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<copy file="${com.arjuna.mwlabs.wstx.tests.dd}/wstx11-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app11.xml">
- <filterset>
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- </filterset>
</copy>
<jar jarfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.jar">
<manifest>
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -37,6 +37,9 @@
public interface Environment
{
- public static final String COORDINATOR_URL = "com.arjuna.mw.wst.coordinatorURL";
+ public static final String COORDINATOR_URL = "org.jboss.jbossts.xts.coordinatorURL";
+ public static final String COORDINATOR_HOST = "org.jboss.jbossts.xts.coordinator.host";
+ public static final String COORDINATOR_PORT = "org.jboss.jbossts.xts.coordinator.port";
+ public static final String COORDINATOR_PATH = "org.jboss.jbossts.xts.coordinator.path";
}
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -42,6 +42,7 @@
import com.arjuna.mw.wstx.logging.wstxLogger;
import com.arjuna.webservices.util.ClassLoaderHelper;
import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc.common.Environment;
/**
* Initialise WSTX.
@@ -70,6 +71,15 @@
{
Configuration.initialise("/wstx.xml");
+ // ok, if we just loaded a coordinator URL and one was already defined on
+ // the command line then reinstate the command line version
+ String commandLineCoordinatrURL = System.getProperty(com.arjuna.wsc.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL);
+ if (commandLineCoordinatrURL != null) {
+ System.setProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_URL, commandLineCoordinatrURL);
+ }
+
+ fixCoordinatorURL();
+
listener.configure();
// Start recovery
// RecoveryManager.manager() ;
@@ -133,6 +143,52 @@
BusinessActivityManager.setBusinessActivityManager((BusinessActivityManager)ClassLoaderHelper.forName(getClass(), baManager).newInstance()) ;
}
+ private final String SERVER_BIND_ADDRESS_KEY = "server.bind.address";
+
+ private final String JBOSS_WEB_BIND_PORT_KEY = "jboss.web.bind.port";
+
+ private void fixCoordinatorURL()
+ {
+ // ok, if we just loaded a coordinator URL and one was already defined on
+ // the command line then reinstate the command line version
+ String commandLineCoordinatrURL = System.getProperty(com.arjuna.wsc.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL);
+ if (commandLineCoordinatrURL != null) {
+ System.setProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_URL, commandLineCoordinatrURL);
+ }
+
+ // if the coordinatorURL contains the symbolic names server.bind.address
+ // or jboss.web.bind.port then we must substitute these with the actual
+ // bind address and jboss web http port
+
+ String coordinatorURL = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_URL);
+
+ if (coordinatorURL != null) {
+ boolean updated = false;
+ int idx = coordinatorURL.indexOf(SERVER_BIND_ADDRESS_KEY);
+ if (idx >= 0) {
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+ coordinatorURL = coordinatorURL.substring(0, idx) + bindAddress + coordinatorURL.substring(idx + SERVER_BIND_ADDRESS_KEY.length());
+ updated = true;
+ }
+
+ idx = coordinatorURL.indexOf(JBOSS_WEB_BIND_PORT_KEY);
+ if (idx >= 0) {
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ coordinatorURL = coordinatorURL.substring(0, idx) + bindPort + coordinatorURL.substring(idx + JBOSS_WEB_BIND_PORT_KEY.length());
+ updated = true;
+ }
+
+ if (updated) {
+ System.setProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_URL, coordinatorURL);
+ }
+ }
+ }
/**
* Get the specified service.
* @param root The root element.
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -37,6 +37,9 @@
public interface Environment
{
- public static final String COORDINATOR_URL = "com.arjuna.mw.wst11.coordinatorURL";
+ public static final String COORDINATOR_URL = "org.jboss.jbossts.xts11.coordinatorURL";
+ public static final String COORDINATOR_HOST = "org.jboss.jbossts.xts11.coordinator.host";
+ public static final String COORDINATOR_PORT = "org.jboss.jbossts.xts11.coordinator.port";
+ public static final String COORDINATOR_PATH = "org.jboss.jbossts.xts11.coordinator.path";
}
\ No newline at end of file
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -28,6 +28,7 @@
import com.arjuna.mw.wst11.UserTransaction;
import com.arjuna.services.framework.startup.Sequencer;
import com.arjuna.webservices.util.ClassLoaderHelper;
+import com.arjuna.wsc11.common.Environment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -68,6 +69,8 @@
{
Configuration.initialise("/wstx11.xml");
+ fixCoordinatorURL();
+
listener.configure();
// Start recovery
// RecoveryManager.manager() ;
@@ -133,6 +136,53 @@
BusinessActivityManager.setBusinessActivityManager((BusinessActivityManager)ClassLoaderHelper.forName(getClass(), baManager).newInstance());
}
+ private final String SERVER_BIND_ADDRESS_KEY = "server.bind.address";
+
+ private final String JBOSS_WEB_BIND_PORT_KEY = "jboss.web.bind.port";
+
+ private void fixCoordinatorURL()
+ {
+ // ok, if we just loaded a coordinator URL and one was already defined on
+ // the command line then reinstate the command line version
+ String commandLineCoordinatrURL = System.getProperty(com.arjuna.wsc11.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL);
+ if (commandLineCoordinatrURL != null) {
+ System.setProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_URL, commandLineCoordinatrURL);
+ }
+
+ // if the coordinatorURL contains the symbolic names server.bind.address
+ // or jboss.web.bind.port then we must substitute these with the actual
+ // bind address and jboss web http port
+
+ String coordinatorURL = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_URL);
+
+ if (coordinatorURL != null) {
+ boolean updated = false;
+ int idx = coordinatorURL.indexOf(SERVER_BIND_ADDRESS_KEY);
+ if (idx >= 0) {
+ String bindAddress = System.getProperty(Environment.XTS_BIND_ADDRESS);
+ if (bindAddress == null) {
+ bindAddress = "127.0.0.1";
+ }
+ coordinatorURL = coordinatorURL.substring(0, idx) + bindAddress + coordinatorURL.substring(idx + SERVER_BIND_ADDRESS_KEY.length());
+ updated = true;
+ }
+
+ idx = coordinatorURL.indexOf(JBOSS_WEB_BIND_PORT_KEY);
+ if (idx >= 0) {
+ String bindPort = System.getProperty(Environment.XTS_BIND_PORT);
+ if (bindPort == null) {
+ bindPort = "8080";
+ }
+ coordinatorURL = coordinatorURL.substring(0, idx) + bindPort + coordinatorURL.substring(idx + JBOSS_WEB_BIND_PORT_KEY.length());
+ updated = true;
+ }
+
+ if (updated) {
+ System.setProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_URL, coordinatorURL);
+ }
+ }
+ }
+
/**
* Get the specified service.
* @param root The root element.
Modified: labs/jbosstm/trunk/XTS/WSTX/config/wstx.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/config/wstx.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSTX/config/wstx.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -50,13 +50,6 @@
name="com.arjuna.ats.arjuna.recovery.recoveryExtension1"
value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule"/>
- <!-- include this property to employ a remote WS-COOR 1.0 activation coordinator
- substitute host and port to use an XTS remote activation coordinator deployed in another JBoss AS
- or provide an alternative URL if you are using some other coordinator service
- <property
- name="com.arjuna.mw.wst.coordinatorURL"
- value="http://@hostname@:@port@/ws-c10/soap/ActivationCoordinator"/>
- -->
<!-- this property can be used to define a remote WSCOOR 1.0
activation coordinator. substitute @coordinator.hostname@
and @coordinator.port@ to specify an XTS remote activation
@@ -66,16 +59,16 @@
n.b. if you leave this line as is the build script in the
sar directory which builds the jbossxts service archive
- (jbossxts.sar) will substitute the local hostname and
- port into this property which means that the local
+ (jbossxts.sar) will substitute the values server.bind.address and
+ jboss.web.bind.port into this property which means that the local
coordinator will be used to service coordination
- requests. you can override these settings by editing the
- build script or by supplying values on the ant command
- line using -Dcoordinator.hostname=<hostname> and
- -Dcoordinator.port=<port>.
+ requests. you can override these settings by editing the sar
+ build script or supplying values -Dcoordinator.hostname=<hostname>
+ and -Dcoordinator.port=<port> on the ant command
+ line when rebuilding the sar.
-->
<property
- name="com.arjuna.mw.wst.coordinatorURL"
+ name="org.jboss.jbossts.xts.coordinatorURL"
value="http://@coordinator.hostname@:@coordinator.port@/ws-c10/soap/ActivationCoordinator"/>
</properties>
</wstx-config>
Modified: labs/jbosstm/trunk/XTS/WSTX/config/wstx11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/config/wstx11.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/WSTX/config/wstx11.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -57,16 +57,16 @@
n.b. if you leave this line as is the build script in the
sar directory which builds the jbossxts service archive
- (jbossxts.sar) will substitute the local hostname and
- port into this property which means that the local
+ (jbossxts.sar) will substitute the values server.bind.address and
+ jboss.web.bind.port into this property which means that the local
coordinator will be used to service coordination
- requests. you can override these settings by editing the
- build script or by supplying values on the ant command
- line using -Dcoordinator.hostname=<hostname> and
- -Dcoordinator.port=<port>.
+ requests. you can override these settings by editing the sar
+ build script or supplying values -Dcoordinator.hostname=<hostname>
+ and -Dcoordinator.port=<port> on the ant command
+ line when rebuilding the sar.
-->
<property
- name="com.arjuna.mw.wst11.coordinatorURL"
+ name="org.jboss.jbossts.xts11.coordinatorURL"
value="http://@coordinator.hostname@:@coordinator.port@/ws-c11/ActivationService"/>
</properties>
</wstx-config>
Modified: labs/jbosstm/trunk/XTS/demo/xts-build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/demo/xts-build.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/demo/xts-build.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -68,7 +68,6 @@
<xmlproperty file="${xmlpropertyfile}" keeproot="false"/>
<property name="xts.home" value=".."/>
- <property name="conf.dir" location="${xts.home}/conf"/>
<property name="lib.dir" location="${xts.home}/lib"/>
<property name="ext.dir" location="${lib.dir}/ext"/>
@@ -89,16 +88,12 @@
<property name="dd.dir" location="dd"/>
<property name="jboss.dd.dir" location="${dd.dir}/jboss"/>
<property name="build.jboss.dd.dir" location="${build.dir}/dd/jboss"/>
- <property name="build.config" location="${build.dir}/config"/>
- <property name="build.soapconfig" location="${build.dir}/soapconfig"/>
<property name="buildrpc.dir" location="buildrpc"/>
<property name="srcrpc.dir" location="srcrpc"/>
<property name="ddrpc.dir" location="ddrpc"/>
<property name="jboss.ddrpc.dir" location="${ddrpc.dir}/jboss"/>
<property name="build.jboss.ddrpc.dir" location="${buildrpc.dir}/dd/jboss"/>
- <property name="buildrpc.config" location="${buildrpc.dir}/config"/>
- <property name="buildrpc.soapconfig" location="${buildrpc.dir}/soapconfig"/>
<property name="web.dir" location="web"/>
<property name="build.web.dir" location="${build.dir}/web"/>
@@ -183,16 +178,12 @@
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir}/classes"/>
<mkdir dir="${build.jboss.dd.dir}"/>
- <mkdir dir="${build.config}"/>
- <mkdir dir="${build.soapconfig}"/>
</target>
<target name="initrpc" depends="init-properties">
<mkdir dir="${buildrpc.dir}"/>
<mkdir dir="${buildrpc.dir}/classes"/>
<mkdir dir="${build.jboss.ddrpc.dir}"/>
- <mkdir dir="${buildrpc.config}"/>
- <mkdir dir="${buildrpc.soapconfig}"/>
</target>
<target name="compilerpc" depends="initrpc">
@@ -256,15 +247,6 @@
</war>
</target>
- <target name="config" depends="insertcfg">
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- <copy todir="${build.config}" filtering="true">
- <fileset dir="${conf.dir}" includes="wscf.xml wstx.xml wst.xml"/>
- </copy>
- <jar destfile="${build.dir}/config.jar" basedir="${build.config}"/>
- </target>
-
<target name="jboss-webservicesrpc" depends="compilerpc">
<war destfile="${buildrpc.dir}/xts-demo-webservicesrpc.war" webxml="${jboss.ddrpc.dir}/service-web-app.xml">
<webinf dir="${jboss.ddrpc.dir}" excludes="client-web-app.xml service-web-app.xml application.xml client-jaxrpc-mapping.xml"/>
@@ -274,15 +256,6 @@
</war>
</target>
- <target name="configrpc" depends="insertcfgrpc">
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- <copy todir="${buildrpc.config}" filtering="true">
- <fileset dir="${conf.dir}" includes="wscf.xml wstx.xml wst.xml"/>
- </copy>
- <jar destfile="${buildrpc.dir}/config.jar" basedir="${buildrpc.config}"/>
- </target>
-
<!-- the client side elements -->
<target name="jboss-webapp" depends="compile">
<copy tofile="${build.dir}/client-web-app.xml" file="${jboss.dd.dir}/client-web-app.xml">
@@ -357,54 +330,6 @@
<target name="buildrpc" depends="jboss-earrpc"/>
- <target name="insertcfg" depends="init">
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- <filter token="urlstub" value="${urlstub}"/>
-
- <unjar src="${xts.home}/webapps/ws-c11.war" dest="${build.dir}/tmp/ws-c11"/>
-
- <copy file="${xts.home}/coordinator/dd/ws-c11_web-app.xml"
- tofile="${build.dir}/tmp/ws-c11/WEB-INF/web.xml" filtering="true" overwrite="true"/>
-
- <jar destfile="${build.dir}/ws-c11.war" basedir="${build.dir}/tmp/ws-c11" manifest="${build.dir}/tmp/ws-c11/META-INF/MANIFEST.MF"/>
-
- <delete dir="${build.dir}/tmp/ws-c11"/>
-
- <unjar src="${xts.home}/webapps/ws-t.war" dest="${build.dir}/tmp/ws-t11"/>
-
- <copy file="${xts.home}/coordinator/dd/ws-t11_web-app.xml"
- tofile="${build.dir}/tmp/ws-t11/WEB-INF/web.xml" filtering="true" overwrite="true"/>
-
- <jar destfile="${build.dir}/ws-t11.war" basedir="${build.dir}/tmp/ws-t11" manifest="${build.dir}/tmp/ws-t11/META-INF/MANIFEST.MF"/>
-
- <delete dir="${build.dir}/tmp/ws-t11"/>
- </target>
-
- <target name="insertcfgrpc" depends="initrpc">
- <filter token="hostname" value="${hostname}"/>
- <filter token="port" value="${port}"/>
- <filter token="urlstub" value="${urlstub}rpc"/>
-
- <unjar src="${xts.home}/webapps/ws-c.war" dest="${buildrpc.dir}/tmp/ws-c"/>
-
- <copy file="${xts.home}/coordinator/dd/ws-c_web-app.xml"
- tofile="${buildrpc.dir}/tmp/ws-c/WEB-INF/web.xml" filtering="true" overwrite="true"/>
-
- <jar destfile="${buildrpc.dir}/ws-c.war" basedir="${buildrpc.dir}/tmp/ws-c" manifest="${buildrpc.dir}/tmp/ws-c/META-INF/MANIFEST.MF"/>
-
- <delete dir="${buildrpc.dir}/tmp/ws-c"/>
-
- <unjar src="${xts.home}/webapps/ws-t.war" dest="${buildrpc.dir}/tmp/ws-t"/>
-
- <copy file="${xts.home}/coordinator/dd/ws-t_web-app.xml"
- tofile="${buildrpc.dir}/tmp/ws-t/WEB-INF/web.xml" filtering="true" overwrite="true"/>
-
- <jar destfile="${buildrpc.dir}/ws-t.war" basedir="${buildrpc.dir}/tmp/ws-t" manifest="${buildrpc.dir}/tmp/ws-t/META-INF/MANIFEST.MF"/>
-
- <delete dir="${buildrpc.dir}/tmp/ws-t"/>
- </target>
-
<target name="deploy" depends="build, undeploy">
<copy file="${build.dir}/xts-demo.ear" tofile="${deploy.dir}/xts-demo.ear"/>
</target>
Modified: labs/jbosstm/trunk/XTS/sar/META-INF/jboss-beans.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/META-INF/jboss-beans.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/sar/META-INF/jboss-beans.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -6,6 +6,7 @@
<depends>jboss.web:service=WebServer</depends>
<depends>jboss:service=TransactionManager</depends>
+ <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
</bean>
</deployment>
\ No newline at end of file
Modified: labs/jbosstm/trunk/XTS/sar/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/build.xml 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/sar/build.xml 2008-08-22 13:55:13 UTC (rev 21716)
@@ -26,8 +26,6 @@
<!-- build and install the XTS component as a service archive -->
<!-- The properties to override are the following: -->
- <!-- hostname (defaults to localhost) -->
- <!-- port (defaults to 8080 for jboss) -->
<!-- coordinator.hostname (defaults to ${hostname}) -->
<!-- coordinator.port (defaults to ${port}) -->
<!-- xts.home The installation directory for XTS -->
@@ -39,18 +37,16 @@
<!-- the directory in which XTS resides -->
<property name="xts.home" value="../xts-install"/>
- <!-- the name of the host running JBOSS -->
- <property name="hostname" value="localhost"/>
+ <!-- the name of the host where the coordinator resides. this defaults to the
+ special symbol server.bind.address which will be substituted with the actual
+ server bind address employed when jboss is started -->
+ <property name="coordinator.hostname" value="server.bind.address"/>
- <!-- the name of the port used by the JBoss web listener -->
- <property name="port" value="8080"/>
+ <!-- the name of the port the coordinator is listening on. this defaults to the
+ special symbol jboss.web.bind.port which will be substituted with the actual
+ jboss web service HTTP listener port employed when jboss is started -->
+ <property name="coordinator.port" value="jboss.web.bind.port"/>
- <!-- the name of the host where the coordinator resides -->
- <property name="coordinator.hostname" value="${hostname}"/>
-
- <!-- the name of the port the coordinator is listening on -->
- <property name="coordinator.port" value="8080"/>
-
<!-- the directory in which your installed app server resides -->
<property environment="env"/>
@@ -148,7 +144,7 @@
</target>
<!-- build XTS service archive supporting both 1.0 and 1.1 WS-C/T protocols -->
- <target name="sar-both" depends="init, compile, dev-resourcebundle, insertcfg10, insertcfg11">
+ <target name="sar-both" depends="init, compile, dev-resourcebundle">
<!-- create config jar containing conf files for 1.0 and 1.1 -->
<filter token="coordinator.hostname" value="${coordinator.hostname}"/>
<filter token="coordinator.port" value="${coordinator.port}"/>
@@ -162,24 +158,6 @@
<!-- copy 11 and 1.0 application.xml to build dir -->
<copy toFile="${build.metainf.dir}/application.xml" file="${metainf.dir}/application.xml"/>
- <!-- unpack all the jar code into the classes directory -->
- <!-- this works around a bug in AS 5.0.0.CR1 sar handling -->
- <!--
- <unjar src="${lib.dir}/ws-c.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-c10.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-c11.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-t.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-t10.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-t11.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wsas.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wscf.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wscf10.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wscf11.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wstx.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wstx10.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wstx11.jar" dest="${build.classes.dir}"/>
- <delete file="${build.classes.dir}/META-INF/MANIFEST.MF"/>
- -->
<!-- pack everything in the service archive -->
<jar jarfile="${build.dir}/jbossxts.sar">
<!-- include generic 1.0 and 1.1 jars -->
@@ -188,9 +166,8 @@
-->
<fileset dir="${lib.dir}" includes="*.jar"/>
- <!-- include 1.0 and 1.1 web apps all config files are included -->
- <fileset dir="${build.dir}" includes="ws-c11.war ws-c10.war ws-t11.war ws-t10.war"/>
- <fileset dir="${webapps.dir}" includes="*.war" excludes="ws-c11.war ws-c10.war ws-t11.war ws-t10.war"/>
+ <!-- include 1.0 and 1.1 web apps -->
+ <fileset dir="${webapps.dir}" includes="*.war"/>
<!-- include config jar -->
<fileset dir="${build.dir}" includes="config.jar"/>
@@ -202,15 +179,12 @@
<fileset dir="${build.dir}" includes="META-INF/application.xml"/>
<!-- include sar boot and shutdown code -->
- <!--
- <fileset dir="${build.dir}" includes="**/*.class"/>
- -->
<fileset dir="${build.classes.dir}" includes="**/*"/>
</jar>
</target>
<!-- build XTS service archive supporting 1.1 WS-C/T protocols -->
- <target name="sar-11" depends="init, compile, dev-resourcebundle, insertcfg11">
+ <target name="sar-11" depends="init, compile, dev-resourcebundle">
<!-- create config jar containing conf files for 1.1 -->
<filter token="coordinator.hostname" value="${coordinator.hostname}"/>
<filter token="coordinator.port" value="${coordinator.port}"/>
@@ -224,26 +198,13 @@
<!-- copy 11 application.xml to build dir -->
<copy toFile="${build.metainf.dir}/application.xml" file="${metainf.dir}/application11.xml"/>
- <!-- unpack all the jar code into the classes directory -->
- <!-- this works around a bug in AS 5.0.0.CR1 sar handling -->
- <unjar src="${lib.dir}/ws-c.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-c11.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-t.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-t11.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wsas.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wscf.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wscf11.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wstx.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wstx11.jar" dest="${build.classes.dir}"/>
- <delete file="${build.classes.dir}/META-INF/MANIFEST.MF"/>
<!-- pack everything in the service archive -->
<jar jarfile="${build.dir}/jbossxts.sar">
<!-- include generic and 1.1 jars -->
<fileset dir="${lib.dir}" includes="*.jar" excludes="*10.jar"/>
- <!-- include 1.1 web apps all config files are included -->
- <fileset dir="${build.dir}" includes="ws-c11.war ws-t11.war"/>
- <fileset dir="${webapps.dir}" includes="*11.war" excludes="ws-c11.war ws-t11.war"/>
+ <!-- include 1.1 web apps-->
+ <fileset dir="${webapps.dir}" includes="*11.war"/>
<!-- include config jar -->
<fileset dir="${build.dir}" includes="config.jar"/>
@@ -255,15 +216,12 @@
<fileset dir="${build.dir}" includes="META-INF/application.xml"/>
<!-- include sar boot and shutdown code -->
- <!--
- <fileset dir="${build.dir}" includes="**/*.class"/>
- -->
<fileset dir="${build.classes.dir}" includes="**/*"/>
</jar>
</target>
<!-- build XTS service archive supporting 1.0 WS-C/T protocols -->
- <target name="sar-10" depends="init, compile, dev-resourcebundle, insertcfg10">
+ <target name="sar-10" depends="init, compile, dev-resourcebundle">
<!-- create config jar containing conf files for 1.0 -->
<filter token="coordinator.hostname" value="${coordinator.hostname}"/>
<filter token="coordinator.port" value="${coordinator.port}"/>
@@ -277,26 +235,13 @@
<!-- copy 10 application.xml to build dir -->
<copy toFile="${build.metainf.dir}/application.xml" file="${metainf.dir}/application10.xml"/>
- <!-- unpack all the jar code into the classes directory -->
- <!-- this works around a bug in AS 5.0.0.CR1 sar handling -->
- <unjar src="${lib.dir}/ws-c.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-c10.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-t.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/ws-t10.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wsas.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wscf.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wscf10.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wstx.jar" dest="${build.classes.dir}"/>
- <unjar src="${lib.dir}/wstx10.jar" dest="${build.classes.dir}"/>
- <delete file="${build.classes.dir}/META-INF/MANIFEST.MF"/>
<!-- pack everything in the service archive -->
<jar jarfile="${build.dir}/jbossxts.sar">
<!-- include generic and 1.0 jars -->
<fileset dir="${lib.dir}" includes="*.jar" excludes="*11.jar"/>
- <!-- include 1.0 web apps all config files are included -->
- <fileset dir="${build.dir}" includes="ws-c10.war ws-t10.war"/>
- <fileset dir="${webapps.dir}" includes="*10.war" excludes="ws-c10.war ws-t10.war"/>
+ <!-- include 1.0 web apps -->
+ <fileset dir="${webapps.dir}" includes="*10.war"/>
<!-- include config jar -->
<fileset dir="${build.dir}" includes="config.jar"/>
@@ -308,9 +253,6 @@
<fileset dir="${build.dir}" includes="META-INF/application.xml"/>
<!-- include sar boot and shutdown code -->
- <!--
- <fileset dir="${build.dir}" includes="**/*.class"/>
- -->
<fileset dir="${build.classes.dir}" includes="**/*"/>
</jar>
</target>
Modified: labs/jbosstm/trunk/XTS/sar/src/org/jboss/jbossts/XTSService.java
===================================================================
--- labs/jbosstm/trunk/XTS/sar/src/org/jboss/jbossts/XTSService.java 2008-08-22 13:53:57 UTC (rev 21715)
+++ labs/jbosstm/trunk/XTS/sar/src/org/jboss/jbossts/XTSService.java 2008-08-22 13:55:13 UTC (rev 21716)
@@ -34,6 +34,7 @@
//import com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl;
//import com.arjuna.mwlabs.wsc.ContextFactoryMapperImple;
import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.services.framework.startup.Sequencer;
//import com.arjuna.webservices.HandlerRegistry;
//import com.arjuna.webservices.SoapRegistry;
//import com.arjuna.webservices.SoapService;
@@ -72,6 +73,12 @@
//import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
//import com.arjuna.wst.messaging.*;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
+
+import javax.management.ObjectName;
+import javax.management.AttributeNotFoundException;
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import java.util.Set;
//import com.arjuna.ats.arjuna.recovery.RecoveryModule;
/**
@@ -126,6 +133,88 @@
// read unified properties file (replaces wscf.xml and wstx.xml)
// Configuration.initialise("/jbossxts.xml");
+ // before we can allow the services to start up we need to identify the server
+ // bind address and the web service port so they services register themselves
+ // in the registry using the correct URL
+
+ // the Transaction Service initialization saves the server bind address using a System
+ // property. we can use this to define the binding address used by the XTS services
+
+ String bindAddress = System.getProperty(com.arjuna.ats.arjuna.common.Environment.SERVER_BIND_ADDRESS);
+ System.setProperty(com.arjuna.wsc.common.Environment.XTS_BIND_ADDRESS, bindAddress);
+ System.setProperty(com.arjuna.wsc11.common.Environment.XTS_BIND_ADDRESS, bindAddress);
+
+ // the web service exposes its listen port somehow or other
+ String bindPortString = getConnectorPort("HTTP/1.1", false);
+ String secureBindPortString = getConnectorPort("HTTP/1.1", true);
+
+ if (bindPortString != null) {
+ System.setProperty(com.arjuna.wsc.common.Environment.XTS_BIND_PORT, bindPortString);
+ System.setProperty(com.arjuna.wsc11.common.Environment.XTS_BIND_PORT, bindPortString);
+ }
+
+ if (secureBindPortString != null) {
+ System.setProperty(com.arjuna.wsc.common.Environment.XTS_SECURE_BIND_PORT, secureBindPortString);
+ System.setProperty(com.arjuna.wsc11.common.Environment.XTS_SECURE_BIND_PORT, secureBindPortString);
+ }
+
+ // see if the coordinatorURL or host/port has been specified on the command line
+ // if so then we need to record that fact here so we override any value
+ // supplied in the config file
+ // but we don't do this if we have already saved it and we are now reloading XTS
+ // yeeurrch really need to stop using System properties
+
+ if (System.getProperty(com.arjuna.wsc.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL) == null) {
+ String coordinatorURL = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_URL);
+ String coordinatorHost = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_HOST);
+ String coordinatorPort = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_PORT);
+ String coordinatorPath = System.getProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_PATH);
+ if (coordinatorURL != null) {
+ System.setProperty(com.arjuna.wsc.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL, coordinatorURL);
+ } else if (coordinatorHost != null || coordinatorPort != null || coordinatorPath != null) {
+ if (coordinatorHost == null) {
+ coordinatorHost = (bindAddress != null ? bindAddress : "127.0.0.1");
+ }
+ if (coordinatorPort == null) {
+ coordinatorPort = (bindPortString != null ? bindPortString : "8080");
+ }
+ if (coordinatorPath == null) {
+ coordinatorPath = "ws-c10/soap/ActivationCoordinator";
+ }
+ coordinatorURL = "http://" + coordinatorHost + ":" + coordinatorPort + "/" + coordinatorPath;
+ System.setProperty(com.arjuna.wsc.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL, coordinatorURL);
+ System.setProperty(com.arjuna.mw.wst.common.Environment.COORDINATOR_URL, coordinatorURL);
+ }
+ }
+
+ // ok now do the same for the 1.1 env settings
+
+ if (System.getProperty(com.arjuna.wsc11.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL) == null) {
+ String coordinatorURL = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_URL);
+ String coordinatorHost = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_HOST);
+ String coordinatorPort = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_PORT);
+ String coordinatorPath = System.getProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_PATH);
+ if (coordinatorURL != null) {
+ System.setProperty(com.arjuna.wsc11.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL, coordinatorURL);
+ } else if (coordinatorHost != null || coordinatorPort != null || coordinatorPath != null) {
+ if (coordinatorHost == null) {
+ coordinatorHost = (bindAddress != null ? bindAddress : "127.0.0.1");
+ }
+ if (coordinatorPort == null) {
+ coordinatorPort = (bindPortString != null ? bindPortString : "8080");
+ }
+ if (coordinatorPath == null) {
+ coordinatorPath = "ws-c11/ActivationService";
+ }
+ coordinatorURL = "http://" + coordinatorHost + ":" + coordinatorPort + "/" + coordinatorPath;
+ System.setProperty(com.arjuna.wsc11.common.Environment.XTS_COMMAND_LINE_COORDINATOR_URL, coordinatorURL);
+ System.setProperty(com.arjuna.mw.wst11.common.Environment.COORDINATOR_URL, coordinatorURL);
+ }
+ }
+ // now it is safe to let the Sequencer class run any intiialisation routines it needs
+
+ Sequencer.unlatch();
+
TaskManagerInitialisation(); // com.arjuna.services.framework.admin.TaskManagerInitialisation : initialise the Task Manager
/*
@@ -452,4 +541,63 @@
soapRegistry.registerSoapService(serviceName, new SoapService(handlerRegistry)) ;
}
*/
+
+ private String getConnectorPort(final String protocol, final boolean secure)
+ {
+ int port = -1;
+
+ try
+ {
+ ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
+
+ Set connectorNames = getMbeanServer().queryNames(connectors, null);
+ for (Object current : connectorNames)
+ {
+ ObjectName currentName = (ObjectName)current;
+
+ try
+ {
+ int connectorPort = (Integer)getMbeanServer().getAttribute(currentName, "port");
+ boolean connectorSecure = (Boolean)getMbeanServer().getAttribute(currentName, "secure");
+ String connectorProtocol = (String)getMbeanServer().getAttribute(currentName, "protocol");
+
+ if (protocol.equals(connectorProtocol) && secure == connectorSecure)
+ {
+ if (port > -1)
+ {
+ log.warn("Found multiple connectors for protocol='" + protocol + "' and secure='" + secure + "', using first port found '" + port + "'");
+ }
+ else
+ {
+ port = connectorPort;
+ }
+ }
+ }
+ catch (AttributeNotFoundException ignored)
+ {
+ }
+ }
+
+ if (port < 0) {
+ return null;
+ } else {
+ return Integer.toString(port);
+ }
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ private MBeanServer mbeanServer = null;
}
\ No newline at end of file
More information about the jboss-svn-commits
mailing list