[jboss-svn-commits] JBL Code SVN: r34520 - in labs/jbosstm/trunk/XTS: WSAS/classes/com/arjuna/mw/wsas/activity and 29 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Aug 4 11:54:45 EDT 2010
Author: adinn
Date: 2010-08-04 11:54:43 -0400 (Wed, 04 Aug 2010)
New Revision: 34520
Removed:
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/activity/OutcomeManager.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/CompositeOutcomeImple.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/OutcomeManagerImple.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/util/
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/status/
Modified:
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/ActivityManager.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/UserActivity.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/context/ContextManager.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/ActivityManagerImple.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/UserActivityImple.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/ActivityImple.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/HLSManager.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/DemoSOAPContextImple.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Context.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Hierarchy.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/NestedActivity.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Resume.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/StartEnd.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/StatusCheck.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Suspend.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Timeout.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Context1.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Context2.java
labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Service.java
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/api/UserCoordinator.java
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/api/UserCoordinator.java
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/CoordinatorServiceImple.java
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/CoordinatorServiceImple.java
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/Environment.java
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java
labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java
labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.java
labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/AddParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/AddSynchronization.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/BeginCancel.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/BeginConfirm.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/CancelOnlyCancel.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/CancelOnlyConfirm.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/ContextOutput.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/ParticipantSynchronization.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/Suspend.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendConfirm.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendResume.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscContext.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscNestedContext.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscTranslateContext.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/AddParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginCancel.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyCancel.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantCannotCompleteClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantExitedClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantFaultedClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/Suspend.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendClose.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResume.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResumeMultiParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddSynchronization.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginCancel.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginConfirm.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyCancel.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyConfirm.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/Suspend.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendConfirm.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendParticipant.java
labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendResume.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/context/ArjunaContextImple.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/LocalContextFactoryImple.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/context/ArjunaContextImple.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/local/LocalContextFactoryImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/ArjunaContextImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/ArjunaContextImple.java
Log:
collapsed HSL management so that only the service relevant to the current activity type is invoked
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/ActivityManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/ActivityManager.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/ActivityManager.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -32,8 +32,6 @@
package com.arjuna.mw.wsas;
import com.arjuna.mw.wsas.activity.HLS;
-import com.arjuna.mw.wsas.activity.OutcomeManager;
-
import com.arjuna.mw.wsas.exceptions.SystemException;
import com.arjuna.mw.wsas.exceptions.InvalidHLSException;
@@ -92,29 +90,13 @@
public HLS[] allHighLevelServices () throws SystemException;
/**
- * When multiple HLSs are registered with the activity service, some
- * means of collating their Outcome responses may be required. An
- * application may provide an OutcomeManager to do this work rather than
- * use the default provided by the system.
+ * Allows an invoker to obtain a specific registered HLS supporting a given coordination type.
*
- * @param om The manager to use. If null is specified, then
- * the default manager will be used.
- *
* @exception SystemException Thrown if any error occurs.
- */
-
- public void setOutcomeManager (OutcomeManager om) throws SystemException;
-
- /*
- * When multiple HLSs are registered with the activity service, some
- * means of collating their Outcome responses may be required. This
- * method returns the current manager.
*
- * @exception SystemException Thrown if any error occurs.
+ * @return the HLS.
*
- * @return The manager currently associated with activities.
*/
- public OutcomeManager getOutcomeManager () throws SystemException;
-
+ public HLS getHighLevelService (String serviceType) throws SystemException;
}
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/UserActivity.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/UserActivity.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/UserActivity.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,27 +61,33 @@
{
/**
- * Start a new activity. If there is already an activity associated
- * with the thread then it will be nested. An implementation specific
- * timeout will be associated with the activity (which may be no
- * timeout).
+ * Start a new activity with a given coordination type. If there is already
+ * an activity associated with the thread then it will be nested. An
+ * implementation specific timeout will be associated with the activity
+ * (which may be no timeout).
*
+ * @param serviceType specifies the type of coordinator which will be
+ * instantiated to manage the activity.
+ *
* @exception WrongStateException Thrown if the any currently associated
* activity is in a state that does not allow a new activity to be
* enlisted.
* @exception SystemException Thrown in any other situation.
*/
- public void start () throws WrongStateException, SystemException;
+ public void start (String serviceType) throws WrongStateException, SystemException;
/**
- * Start a new activity. If there is already an activity associated
+ * Start a new activity with a given coordination type. If there is already an activity associated
* with the thread then it will be nested. If the activity is still
* active when the specified timeout elapses, it will be terminated.
*
+ * @param serviceType specifies the type of coordinator which will be
+ * instantiated to manage the activity.
* @param timeout The timeout associated with the activity (in
* seconds). If the activity has not been terminated by the time this
* period elapses, then it will automatically be terminated.
+ *
* @exception WrongStateException Thrown if the currently associated
* activity is in a state that does not allow a new activity to be
* enlisted as a child.
@@ -90,7 +96,7 @@
* @exception SystemException Thrown in any other situation.
*/
- public void start (int timeout) throws WrongStateException, InvalidTimeoutException, SystemException;
+ public void start (String serviceType, int timeout) throws WrongStateException, InvalidTimeoutException, SystemException;
/**
* Complete the activity with the current completion status.
@@ -104,7 +110,7 @@
* @exception ProtocolViolationException Thrown if the a violation of the
* activity service or HLS protocol occurs.
* @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
+ * associated with the invoking thread or none with the given type of coordinator.
* @exception NoPermissionException Thrown if the invoking thread does
* not have permission to terminate the transaction.
* @exception SystemException Thrown if some other error occurred.
@@ -120,6 +126,8 @@
/**
* Complete the activity with the completion status provided.
*
+ * @param cs The CompletionStatus to use.
+ *
* @exception InvalidActivityException Thrown if the current activity is
* invalid in the execution environment.
* @exception ActiveChildException Thrown if the current activity is a
@@ -129,20 +137,18 @@
* @exception ProtocolViolationException Thrown if the a violation of the
* activity service or HLS protocol occurs.
* @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
+ * associated with the invoking thread or none with the given type of coordinator.
* @exception NoPermissionException Thrown if the invoking thread does
* not have permission to terminate the transaction.
* @exception SystemException Thrown if some other error occurred.
*
- * @param cs The CompletionStatus to use.
- *
* @return the result of completing the activity. Null is valid and must
* be interpreted within the context of any HLS that may exist.
*
* @see com.arjuna.mw.wsas.activity.Outcome
*/
- public Outcome end (com.arjuna.mw.wsas.completionstatus.CompletionStatus cs) throws InvalidActivityException, WrongStateException, ProtocolViolationException, SystemException, ActiveChildException, NoActivityException, NoPermissionException;
+ public Outcome end (CompletionStatus cs) throws InvalidActivityException, WrongStateException, ProtocolViolationException, SystemException, ActiveChildException, NoActivityException, NoPermissionException;
/**
* Set the termination status for the current activity, if any.
@@ -275,5 +281,15 @@
public ActivityHierarchy currentActivity () throws SystemException;
+ /**
+ * @return the service type supplied when the current activity was started.
+ *
+ * @exception NoActivityException Thrown if there is no activity
+ * associated with the invoking thread.
+ * @exception SystemException Thrown if any error occurs.
+ */
+
+ public String serviceType() throws NoActivityException, SystemException;
+
}
Deleted: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/activity/OutcomeManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/activity/OutcomeManager.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/activity/OutcomeManager.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -1,59 +0,0 @@
-/*
- * 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) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: OutcomeManager.java,v 1.3 2005/05/19 12:13:16 nmcl Exp $
- */
-
-package com.arjuna.mw.wsas.activity;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-/**
- * When multiple HLSs are registered with the activity service, some
- * means of collating their Outcome responses may be required.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: OutcomeManager.java,v 1.3 2005/05/19 12:13:16 nmcl Exp $
- * @since 1.0.
- */
-
-public interface OutcomeManager
-{
-
- /**
- * Given the current (composite) Outcome and the Outcome just obtained
- * from an HLS, the OutcomeManager may return a new Outcome.
- *
- * @exception SystemException Thrown if any error occurs.
- *
- * @return the Oucome or null.
- */
-
- public Outcome processOutcome (Outcome current, Outcome next) throws SystemException;
-
-}
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/context/ContextManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/context/ContextManager.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/context/ContextManager.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -1,8 +1,8 @@
/*
* 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
+ * 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
@@ -14,7 +14,7 @@
* 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.
*/
@@ -31,12 +31,18 @@
package com.arjuna.mw.wsas.context;
+import com.arjuna.mw.wsas.UserActivity;
+import com.arjuna.mw.wsas.UserActivityFactory;
+import com.arjuna.mw.wsas.activity.ActivityHandle;
+import com.arjuna.mw.wsas.exceptions.NoActivityException;
import com.arjuna.mw.wsas.logging.wsasLogger;
import com.arjuna.mw.wsas.ActivityManager;
import com.arjuna.mw.wsas.ActivityManagerFactory;
import com.arjuna.mw.wsas.activity.HLS;
+import com.arjuna.mwlabs.wsas.ActivityManagerImple;
+import com.arjuna.mwlabs.wsas.activity.ActivityImple;
/**
* @author Mark Little (mark at arjuna.com)
@@ -52,51 +58,51 @@
_manager = ActivityManagerFactory.activityManager();
}
- public final Context[] contexts ()
+ /**
+ * @message com.arjuna.mw.wsas.context.ContextManager_3 [com.arjuna.mw.wsas.context.ContextManager_3] - getHighLevelServices threw:
+ * @message com.arjuna.mw.wsas.context.ContextManager_4 [com.arjuna.mw.wsas.context.ContextManager_4] - assembling context and received:
+ */
+
+ public final Context context (String serviceType)
{
- Context[] ctxs = null;
- HLS[] services = null;
+ Context ctx = null;
+ HLS service = null;
- try
- {
- services = _manager.allHighLevelServices();
- }
- catch (Exception ex)
- {
+ try
+ {
+ // ensure we are in an activity associated with the correct service type
+
+ String currentServiceType = UserActivityFactory.userActivity().serviceType();
+ if (currentServiceType == serviceType) {
+ service = _manager.getHighLevelService(serviceType);
+ }
+ }
+ catch (NoActivityException nae)
+ {
+ // ignore
+ }
+ catch (Exception ex)
+ {
wsasLogger.i18NLogger.warn_context_ContextManager_1(ex);
- }
-
- if (services != null)
- {
- /*
- * Null entries are allowed and should be ignored.
- */
+ }
- ctxs = new Context[services.length];
+ if (service != null)
+ {
+ try
+ {
+ ctx = service.context();
+ }
+ catch (Exception ex)
+ {
+ wsasLogger.i18NLogger.warn_context_ContextManager_2(ex);
- try
- {
- // ActivityHierarchy ctx = _activity.currentActivity();
+ ctx = null;
+ }
+ }
- /*
- * Check for null or leave to hls? (leave to hls at
- * the moment).
- */
-
- for (int i = 0; i < services.length; i++)
- ctxs[i] = services[i].context();
- }
- catch (Exception ex)
- {
- wsasLogger.i18NLogger.warn_context_ContextManager_2(ex);
-
- ctxs = null;
- }
- }
-
- return ctxs;
+ return ctx;
}
private ActivityManager _manager;
-
+
}
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/ActivityManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/ActivityManagerImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/ActivityManagerImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -34,8 +34,6 @@
import com.arjuna.mw.wsas.ActivityManager;
import com.arjuna.mw.wsas.activity.HLS;
-import com.arjuna.mw.wsas.activity.OutcomeManager;
-
import com.arjuna.mwlabs.wsas.activity.HLSManager;
import com.arjuna.mw.wsas.exceptions.SystemException;
@@ -77,14 +75,8 @@
return HLSManager.allHighLevelServices();
}
- public void setOutcomeManager (OutcomeManager om) throws SystemException
+ public HLS getHighLevelService (String serviceType) throws SystemException
{
- HLSManager.setOutcomeManager(om);
+ return HLSManager.getHighLevelService(serviceType);
}
-
- public OutcomeManager getOutcomeManager () throws SystemException
- {
- return HLSManager.getOutcomeManager();
- }
-
}
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/UserActivityImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/UserActivityImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/UserActivityImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -83,17 +83,20 @@
* timeout will be associated with the activity (which may be no
* timeout).
*
+ * @param serviceType specifies the type of coordinator which will be
+ * instantiated to manage the activity.
+ *
* @exception WrongStateException Thrown if the any currently associated
* activity is in a state that does not allow a new activity to be
* enlisted.
* @exception SystemException Thrown in any other situation.
*/
- public void start () throws WrongStateException, SystemException
+ public void start (String serviceType) throws WrongStateException, SystemException
{
try
{
- start(getTimeout());
+ start(serviceType, getTimeout());
}
catch (InvalidTimeoutException ex)
{
@@ -104,7 +107,9 @@
* Start a new activity. If there is already an activity associated
* with the thread then it will be nested.
*
- * @param int timeout The timeout associated with the activity. If the
+ * @param serviceType specifies the type of coordinator which will be
+ * instantiated to manage the activity.
+ * @param timeout The timeout associated with the activity. If the
* activity has not been terminated by the time this period elapses, then
* it will automatically be terminated.
* @exception WrongStateException Thrown if the currently associated
@@ -116,62 +121,53 @@
*
*/
- public void start (int timeout) throws WrongStateException, InvalidTimeoutException, SystemException
+ public void start (String serviceType, int timeout) throws WrongStateException, InvalidTimeoutException, SystemException
{
- if (timeout < 0)
- throw new InvalidTimeoutException();
- else
- {
- if (timeout == 0)
- timeout = getTimeout();
- }
+ if (timeout < 0)
+ throw new InvalidTimeoutException();
+ else
+ {
+ if (timeout == 0)
+ timeout = getTimeout();
+ }
- ActivityImple currentActivity = new ActivityImple(current());
+ ActivityImple currentActivity = new ActivityImple(current(), serviceType);
- currentActivity.start(timeout);
+ currentActivity.start(timeout);
- push(currentActivity);
+ push(currentActivity);
- HLS[] hls = HLSManager.allHighLevelServices();
+ HLS hls = HLSManager.getHighLevelService(serviceType);
- if (hls != null)
- {
- for (int i = 0; i < hls.length; i++)
- {
- try
- {
- hls[i].begun();
- }
- catch (SystemException ex)
- {
- try
- {
- setCompletionStatus(FailureOnly.instance());
- }
- catch (Exception e)
- {
- wsasLogger.i18NLogger.warn_UserActivityImple_1(ex);
- }
+ try {
+ if (hls != null)
+ {
+ hls.begun();
+ }
+ } catch (SystemException ex) {
+ try {
+ setCompletionStatus(FailureOnly.instance());
+ } catch (Exception e) {
+ wsasLogger.i18NLogger.warn_UserActivityImple_1(e);
+ }
- throw ex;
- }
- }
- }
+ throw ex;
+ }
}
/**
- * Complete the activity with the current completion status.
+ * Complete the activity with the completion status provided.
*
* @exception InvalidActivityException Thrown if the current activity is
* invalid in the execution environment.
* @exception ActiveChildException Thrown if the current activity is a
- * parent activity with active children.
* @exception WrongStateException Thrown if the current activity is not in a
- * state that allows it to be completed.
- * @exception ProtocolViolationException Thrown if a violation of the
+ * state that allows it to be completed, or is incompatible with the
+ * completion status provided.
+ * @exception ProtocolViolationException Thrown if the a violation of the
* activity service or HLS protocol occurs.
* @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
+ * associated with the invoking thread or none with the given type of coordinator.
* @exception NoPermissionException Thrown if the invoking thread does
* not have permission to terminate the transaction.
* @exception SystemException Thrown if some other error occurred.
@@ -179,130 +175,114 @@
* @return the result of completing the activity. Null is valid and must
* be interpreted within the context of any HLS that may exist.
*
- * @see com.arjuna.mw.wsas.Outcome
- *
+ * @see com.arjuna.mw.wsas.activity.Outcome
+ * @message com.arjuna.mwlabs.wsas.UserActivityImple_2 [com.arjuna.mwlabs.wsas.UserActivityImple_2] - currentActivity.end threw:
+ * @message com.arjuna.mwlabs.wsas.UserActivityImple_3 [com.arjuna.mwlabs.wsas.UserActivityImple_3] - Activity.completed caught:
*/
public Outcome end () throws InvalidActivityException, WrongStateException, ProtocolViolationException, SystemException, NoActivityException, SystemException, NoPermissionException, ActiveChildException
{
- ActivityImple currentActivity = current();
+ ActivityImple currentActivity = current();
- if (currentActivity == null)
- throw new NoActivityException();
+ if (currentActivity == null) {
+ throw new NoActivityException();
+ }
- /*
- if (currentActivity.parent() != null)
- throw new ActiveChildException();
- */
-
- Outcome res = null;
+ Outcome res = null;
+ String serviceType = currentActivity.serviceType();
- try
- {
- res = currentActivity.end();
- }
- catch (Exception ex)
- {
- wsasLogger.i18NLogger.warn_UserActivityImple_1(ex);
- }
+ try {
+ res = currentActivity.end();
+ } catch (Exception ex) {
+ wsasLogger.i18NLogger.warn_UserActivityImple_1(ex);
+ }
- HLS[] hls = HLSManager.allHighLevelServices();
+ HLS hls = HLSManager.getHighLevelService(serviceType);
- if (hls != null)
- {
- for (int i = 0; i < hls.length; i++)
- {
- try
- {
- hls[i].completed();
- }
- catch (SystemException ex)
- {
- wsasLogger.i18NLogger.warn_UserActivityImple_3(ex);
- }
- }
- }
+ if (hls != null)
+ {
+ try
+ {
+ hls.completed();
+ }
+ catch (SystemException ex)
+ {
+ wsasLogger.i18NLogger.warn_UserActivityImple_3(ex);
+ }
+ }
- pop();
+ pop();
- return res;
+ return res;
}
/**
* Complete the activity with the completion status provided.
*
+ * @param cs The CompletionStatus to use.
+ *
* @exception InvalidActivityException Thrown if the current activity is
* invalid in the execution environment.
* @exception ActiveChildException Thrown if the current activity is a
- * parent activity with active children.
* @exception WrongStateException Thrown if the current activity is not in a
* state that allows it to be completed, or is incompatible with the
* completion status provided.
* @exception ProtocolViolationException Thrown if the a violation of the
* activity service or HLS protocol occurs.
* @exception NoActivityException Thrown if there is no activity
- * associated with the invoking thread.
+ * associated with the invoking thread or none with the given type of coordinator.
* @exception NoPermissionException Thrown if the invoking thread does
* not have permission to terminate the transaction.
* @exception SystemException Thrown if some other error occurred.
*
- * @param CompletionStatus cs The CompletionStatus to use.
- *
* @return the result of completing the activity. Null is valid and must
* be interpreted within the context of any HLS that may exist.
*
* @see com.arjuna.mw.wsas.Outcome
*/
- public Outcome end (com.arjuna.mw.wsas.completionstatus.CompletionStatus cs) throws InvalidActivityException, WrongStateException, ProtocolViolationException, SystemException, NoActivityException, NoPermissionException, ActiveChildException
+ public Outcome end (CompletionStatus cs) throws InvalidActivityException, WrongStateException, ProtocolViolationException, SystemException, NoActivityException, NoPermissionException, ActiveChildException
{
- ActivityImple currentActivity = current();
+ ActivityImple currentActivity = current();
- if (currentActivity == null)
- throw new NoActivityException();
+ if (currentActivity == null) {
+ throw new NoActivityException();
+ }
- /*
+ /*
if (currentActivity.parent() != null)
throw new ActiveChildException();
*/
- Outcome res = null;
-
- try
- {
- res = currentActivity.end(cs);
- }
- catch (Exception ex)
- {
- wsasLogger.i18NLogger.warn_UserActivityImple_2(ex);
- }
+ Outcome res = null;
+ String serviceType = currentActivity.serviceType();
- HLS[] hls = HLSManager.allHighLevelServices();
+ try {
+ res = currentActivity.end(cs);
+ } catch (Exception ex) {
+ wsasLogger.i18NLogger.warn_UserActivityImple_2(ex);
+ }
- if (hls != null)
- {
- for (int i = 0; i < hls.length; i++)
- {
- try
- {
- hls[i].completed();
- }
- catch (SystemException ex)
- {
- wsasLogger.i18NLogger.warn_UserActivityImple_3(ex);
- }
- }
- }
+ HLS hls = HLSManager.getHighLevelService(serviceType);
- pop();
+ if (hls != null)
+ {
+ try {
+ hls.completed();
+ } catch (SystemException ex) {
+ wsasLogger.i18NLogger.warn_UserActivityImple_3(ex);
+ }
+ }
+
+ pop();
- return res;
+ return res;
}
/**
* Set the termination status for the current activity, if any.
*
- * @param CompletionStatus endStatus The state in which the activity
+ * @param endStatus The state in which the activity
* should attempt to terminate. This may
* be one of the default values provided by WSAS or may be extended in
* an implementation specific manner by an HLS.
@@ -370,7 +350,7 @@
* each thread and this means that no application specified timeout is
* set for activities.
*
- * @param int timeout The timeout (in seconds) to associate with all
+ * @param timeout The timeout (in seconds) to associate with all
* subsequently created activities. This value must be 0 or greater.
*
* @exception InvalidTimeoutException Thrown if the timeout value provided
@@ -452,29 +432,30 @@
public ActivityHierarchy suspend () throws SystemException
{
- HLS[] hls = HLSManager.allHighLevelServices();
+ ActivityImple currentActivity = current();
+ if (currentActivity == null) {
+ return null;
+ }
- if (hls != null)
- {
- for (int i = 0; i < hls.length; i++)
- {
- try
- {
- hls[i].suspended();
- }
- catch (SystemException ex)
- {
- wsasLogger.i18NLogger.warn_UserActivityImple_4(ex);
- }
- }
- }
+ String serviceType = currentActivity.serviceType();
+
+ HLS hls = HLSManager.getHighLevelService(serviceType);
- ActivityImple currentActivity = purge();
+ if (hls != null) {
+ try {
+ hls.suspended();
+ } catch (SystemException ex) {
+ wsasLogger.i18NLogger.warn_UserActivityImple_4(ex);
+ }
+ }
+
+ currentActivity = purge();
- if (currentActivity != null)
- return new ActivityHierarchyImple(currentActivity);
- else
- return null;
+ if (currentActivity != null) {
+ return new ActivityHierarchyImple(currentActivity);
+ } else {
+ return null;
+ }
}
/**
@@ -483,7 +464,7 @@
* activities that it may already be associated with. If the parameter is
* null then the thread is associated with no activity.
*
- * @param ActivityHierarchy tx The activity to associate with this thread. This
+ * @param tx The activity to associate with this thread. This
* may be null in which case the current thread becomes associated with
* no activity.
*
@@ -495,50 +476,46 @@
public void resume (ActivityHierarchy tx) throws InvalidActivityException, SystemException
{
- if (tx == null)
- {
- purge();
- }
- else
- {
- if (tx instanceof ActivityHierarchyImple)
- {
- try
- {
- for (int i = 0; i < tx.size(); i++)
- {
- ActivityHandleImple handle = (ActivityHandleImple) tx.activity(i);
+ if (tx == null)
+ {
+ purge();
+ }
+ else
+ {
+ if (tx instanceof ActivityHierarchyImple)
+ {
+ try
+ {
+ for (int i = 0; i < tx.size(); i++)
+ {
+ ActivityHandleImple handle = (ActivityHandleImple) tx.activity(i);
- push(handle.getActivity());
- }
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
+ push(handle.getActivity());
+ }
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
- purge();
- }
- }
- else
- throw new InvalidActivityException(wsasLogger.i18NLogger.get_UserActivityImple_51());
- }
+ purge();
+ }
+ }
+ else
+ throw new InvalidActivityException(wsasLogger.i18NLogger.get_UserActivityImple_51());
+ }
- HLS[] hls = HLSManager.allHighLevelServices();
+ ActivityImple currentActivity = current();
+ String serviceType = currentActivity.serviceType();
- if (hls != null)
- {
- for (int i = 0; i < hls.length; i++)
- {
- try
- {
- hls[i].resumed();
- }
- catch (SystemException ex)
- {
- wsasLogger.i18NLogger.warn_UserActivityImple_5(ex);
- }
- }
- }
+ HLS hls = HLSManager.getHighLevelService(serviceType);
+
+ if (hls != null) {
+ try {
+ hls.resumed();
+ } catch (SystemException ex) {
+ wsasLogger.i18NLogger.warn_UserActivityImple_5(ex);
+ }
+ }
}
public ActivityHierarchy currentActivity () throws SystemException
@@ -551,6 +528,14 @@
return null;
}
+ public String serviceType() throws NoActivityException, SystemException {
+ ActivityImple currentActivity = current();
+ if (currentActivity == null) {
+ throw new NoActivityException();
+ }
+ return currentActivity.serviceType();
+ }
+
public final ActivityImple current ()
{
Stack hier = (Stack) _threadAxData.get();
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/ActivityImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/ActivityImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/ActivityImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -31,6 +31,8 @@
package com.arjuna.mwlabs.wsas.activity;
+import com.arjuna.mw.wsas.activity.HLS;
+import com.arjuna.mw.wsas.completionstatus.Success;
import com.arjuna.mw.wsas.logging.wsasLogger;
import com.arjuna.mw.wsas.activity.Outcome;
@@ -41,8 +43,6 @@
import com.arjuna.mwlabs.wsas.common.arjunacore.GlobalIdImple;
-import com.arjuna.mwlabs.wsas.util.HLSWrapper;
-
import com.arjuna.mw.wsas.status.Created;
import com.arjuna.mw.wsas.status.Active;
import com.arjuna.mw.wsas.status.Completing;
@@ -80,12 +80,12 @@
public class ActivityImple
{
- public ActivityImple ()
+ public ActivityImple (String coordinationType)
{
- this(null);
+ this(null, coordinationType);
}
- public ActivityImple (ActivityImple parent)
+ public ActivityImple (ActivityImple parent, String serviceType)
{
_parent = parent;
_children = new Hashtable();
@@ -94,6 +94,7 @@
_activityId = new GlobalIdImple();
_timeout = 0;
_result = null;
+ _serviceType = serviceType;
}
/**
@@ -273,7 +274,7 @@
+ " " + this);
}
- Outcome current = null;
+ Outcome result = null;
try
{
@@ -288,27 +289,12 @@
try
{
- Iterator<HLSWrapper> iter = HLSManager.HLServices();
- HLSWrapper elem;
-
- while (iter.hasNext())
- {
- elem = iter.next();
-
- Outcome result = null;
-
- try
- {
- result = elem.hls().complete(getCompletionStatus());
- }
- catch (SystemException ex)
- {
- result = new OutcomeImple(new HLSException(ex),
- getCompletionStatus());
- }
-
- current = HLSManager.getOutcomeManager().processOutcome(current, result);
- }
+ HLS hls = HLSManager.getHighLevelService(_serviceType);
+ if (hls != null) {
+ result = hls.complete(getCompletionStatus());
+ } else {
+ result = new OutcomeImple(Failure.instance());
+ }
}
catch (SystemException ex)
{
@@ -320,7 +306,7 @@
* which have not?
*/
- current = new OutcomeImple(new HLSException(ex),
+ result = new OutcomeImple(new HLSException(ex),
Failure.instance());
}
@@ -332,11 +318,8 @@
_status = Completed.instance();
- if (current == null)
- current = new OutcomeImple(getCompletionStatus());
+ _result = result;
- _result = current;
-
return _result;
}
else
@@ -487,6 +470,14 @@
return _parent;
}
+ /**
+ *
+ * @return the type of the coordinator employed for this activity
+ */
+ public String serviceType()
+ {
+ return _serviceType;
+ }
/**
*/
@@ -678,5 +669,6 @@
private GlobalIdImple _activityId;
private int _timeout;
private Outcome _result;
+ private String _serviceType;
}
Deleted: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/CompositeOutcomeImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/CompositeOutcomeImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/CompositeOutcomeImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -1,129 +0,0 @@
-/*
- * 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) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: CompositeOutcomeImple.java,v 1.5 2005/05/19 12:13:18 nmcl Exp $
- */
-
-package com.arjuna.mwlabs.wsas.activity;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-
-import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import java.util.Vector;
-
-/**
- * The Outcome represents the final outcome of the activity. Because
- * different HLS implementations will have different requirements
- * on what they can or cannot return, this interface is deliberately
- * generic.
- *
- * This should be a public class!
- */
-
-public class CompositeOutcomeImple implements Outcome
-{
-
- public CompositeOutcomeImple (CompletionStatus cs)
- {
- _outcomes = new Vector();
- _status = cs;
- }
-
- public final void add (Outcome out)
- {
- _outcomes.add(out);
- }
-
- public final Outcome get (String type)
- {
- if (_outcomes != null)
- {
- for (int i = 0; i < _outcomes.size(); i++)
- {
- if (_outcomes.elementAt(i).getClass().getName().equals(type))
- return (Outcome) _outcomes.elementAt(i);
- }
- }
-
- return null;
- }
-
- /**
- * Give a name for this outcome.
- *
- * @exception SystemException Thrown if an error occurs.
- * @return some implementation specific name for the Outcome. Typically
- * this will be the only thing necessary to determine the transaction's
- * outcome, e.g., "RolledBack".
- */
-
- public String name () throws SystemException
- {
- return "CompositeOutcomeImple";
- }
-
- /**
- * The state in which the activity completed.
- *
- * @exception SystemException Thrown if an error occurs.
- * @return the final completion status of the transaction. Any additional
- * information (e.g., exception types) may be provided by the data method.
- */
-
- public CompletionStatus completedStatus () throws SystemException
- {
- return _status;
- }
-
- /**
- * Outcome specific information that can be used to determine finer
- * level details about the outcome instance.
- *
- * @exception SystemException Thrown if an error occurs.
- * @return completion specific data for this activity. Examples include
- * the type of failure exception that was thrown by the implementation
- * (e.g., HeuristicMixed).
- */
-
- public Object data () throws SystemException
- {
- return null;
- }
-
- public final Outcome[] outcomes () throws SystemException
- {
- return (Outcome[]) _outcomes.toArray();
- }
-
- private Vector _outcomes;
- private CompletionStatus _status;
-
-}
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/HLSManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/HLSManager.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/HLSManager.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -34,10 +34,7 @@
import com.arjuna.mw.wsas.logging.wsasLogger;
import com.arjuna.mw.wsas.activity.HLS;
-import com.arjuna.mw.wsas.activity.OutcomeManager;
-import com.arjuna.mwlabs.wsas.util.HLSWrapper;
-
import com.arjuna.mw.wsas.exceptions.SystemException;
import com.arjuna.mw.wsas.exceptions.InvalidHLSException;
@@ -65,8 +62,9 @@
if (service == null) {
throw new InvalidHLSException();
} else {
- synchronized(_hls) {
- _hls.add(new HLSWrapper(service));
+ String key = service.identity();
+ synchronized(_hlsMap) {
+ _hlsMap.put(key, service);
}
}
}
@@ -77,70 +75,38 @@
throw new InvalidHLSException();
else
{
- synchronized (_hls)
+ String key = service.identity();
+ HLS oldValue;
+ synchronized (_hlsMap)
{
- HLSWrapper elem = null;
- boolean found = false;
- Iterator<HLSWrapper> iter = _hls.iterator();
- while (!found && iter.hasNext()) {
- elem = iter.next();
- if (elem.hls() == service) {
- found = true;
- }
- }
- if (!found) {
- throw new InvalidHLSException(wsasLogger.i18NLogger.get_activity_HLSManager_1());
- } else {
- _hls.remove(elem);
- }
+ oldValue = _hlsMap.remove(key);
}
+ if (oldValue == null) {
+ throw new InvalidHLSException(wsasLogger.i18NLogger.get_activity_HLSManager_1());
+ }
}
}
-
+ /*
+ * redundant?
+ */
public static final HLS[] allHighLevelServices () throws SystemException
{
- synchronized (_hls)
+ synchronized (_hlsMap)
{
- HLS[] toReturn = new HLS[(int) _hls.size()];
- Iterator<HLSWrapper> iter = _hls.iterator();
- HLSWrapper elem;
- int i = 0;
-
- while (iter.hasNext())
- {
- elem = iter.next();
- toReturn[i++] = ((HLSWrapper) elem).hls();
- }
-
- return toReturn;
+ HLS[] toReturn = new HLS[(int) _hlsMap.size()];
+ Collection<HLS> services = _hlsMap.values();
+ return services.toArray(toReturn);
}
}
- public static final void setOutcomeManager (OutcomeManager om) throws SystemException
+ public static final HLS getHighLevelService (String serviceType) throws SystemException
{
- synchronized (_outcomeManager)
- {
- if (om == null)
- om = new OutcomeManagerImple();
-
- _outcomeManager = om;
- }
+ synchronized (_hlsMap)
+ {
+ return _hlsMap.get(serviceType);
+ }
}
- public static final OutcomeManager getOutcomeManager () throws SystemException
- {
- synchronized (_outcomeManager)
- {
- return _outcomeManager;
- }
- }
+ private static HashMap<String, HLS> _hlsMap = new HashMap<String, HLS>();
- static final Iterator<HLSWrapper> HLServices ()
- {
- return _hls.iterator();
- }
-
- private static SortedSet<HLSWrapper> _hls = new TreeSet(); // order decreasing as higher is first
- private static OutcomeManager _outcomeManager = new OutcomeManagerImple();
-
}
Deleted: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/OutcomeManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/OutcomeManagerImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mwlabs/wsas/activity/OutcomeManagerImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -1,88 +0,0 @@
-/*
- * 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) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: OutcomeManagerImple.java,v 1.2 2005/05/19 12:13:18 nmcl Exp $
- */
-
-package com.arjuna.mwlabs.wsas.activity;
-
-import com.arjuna.mw.wsas.UserActivityFactory;
-import com.arjuna.mw.wsas.activity.Outcome;
-import com.arjuna.mw.wsas.activity.OutcomeManager;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.NoActivityException;
-
-/**
- * The Outcome represents the final outcome of the activity. Because
- * different HLS implementations will have different requirements
- * on what they can or cannot return, this interface is deliberately
- * generic.
- */
-
-public class OutcomeManagerImple implements OutcomeManager
-{
-
- /**
- * Even if exceptions occur just remember the equivalent exception
- * and keep telling all other HLSes that the activity is completing.
- */
-
- public Outcome processOutcome (Outcome current, Outcome next) throws SystemException
- {
- if (current == null)
- return next;
-
- if (next == null)
- return current;
-
- if (current instanceof CompositeOutcomeImple)
- {
- ((CompositeOutcomeImple) current).add(next);
-
- return current;
- }
- else
- {
- try
- {
- CompositeOutcomeImple toReturn = new CompositeOutcomeImple(UserActivityFactory.userActivity().getCompletionStatus());
-
- toReturn.add(current);
- toReturn.add(next);
-
- return toReturn;
- }
- catch (NoActivityException ex)
- {
- throw new SystemException(ex.toString());
- }
- }
- }
-
-}
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/DemoSOAPContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/DemoSOAPContextImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/DemoSOAPContextImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -38,7 +38,6 @@
import org.w3c.dom.Document;
import com.arjuna.mw.wsas.context.soap.SOAPContext;
-import com.arjuna.mwlabs.wsas.util.XMLUtils;
/**
*/
@@ -92,7 +91,7 @@
public String toString ()
{
- return XMLUtils.writeToString(_context) ;
+ return _context.toString() ;
}
private org.w3c.dom.Element _context;
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Context.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Context.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Context.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -66,19 +66,19 @@
try
{
- ua.start();
+ ua.start("dummy");
System.out.println("Started: "+ua.activityName());
- ua.start();
+ ua.start("dummy");
System.out.println("Started: "+ua.activityName());
ContextManager manager = new ContextManager();
- com.arjuna.mw.wsas.context.Context[] contexts = manager.contexts();
+ com.arjuna.mw.wsas.context.Context context = manager.context("dummy");
- if ((contexts != null) && (contexts.length != 0)) {
- fail("Contexts not null: "+contexts);
+ if (context != null) {
+ fail("Context not null: "+ context);
}
} finally {
try {
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Hierarchy.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Hierarchy.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Hierarchy.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -59,11 +59,11 @@
try
{
- ua.start();
+ ua.start("dummy");
System.out.println("Started: "+ua.activityName());
- ua.start();
+ ua.start("dummy");
System.out.println("Started: "+ua.activityName());
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/NestedActivity.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/NestedActivity.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/NestedActivity.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -58,11 +58,11 @@
try
{
- ua.start();
+ ua.start("dummy");
System.out.println("Started: "+ua.activityName());
- ua.start();
+ ua.start("dummy");
String nested = ua.activityName();
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Resume.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Resume.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Resume.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -64,13 +64,13 @@
GlobalId ac1 = null;
GlobalId ac2 = null;
- ua.start();
+ ua.start("dummy");
ac1 = ua.activityId();
System.out.println("Started: "+ac1);
- ua.start();
+ ua.start("dummy");
ac2 = ua.activityId();
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/StartEnd.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/StartEnd.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/StartEnd.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -53,7 +53,7 @@
throws Exception
{
UserActivity ua = UserActivityFactory.userActivity();
- ua.start();
+ ua.start("dummy");
ua.end();
}
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/StatusCheck.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/StatusCheck.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/StatusCheck.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -64,7 +64,7 @@
fail("Status should be NoActivity " + ua.status());
}
- ua.start();
+ ua.start("dummy");
if (ua.status() != Active.instance()) {
fail("Status should be Active " + ua.status());
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Suspend.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Suspend.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Suspend.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -60,7 +60,7 @@
try
{
- ua.start();
+ ua.start("dummy");
System.out.println("Started: "+ua.activityName());
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Timeout.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Timeout.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/basic/Timeout.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,7 +61,7 @@
try {
ua.setTimeout(1);
- ua.start();
+ ua.start("dummy");
Thread.currentThread().sleep(2000);
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Context1.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Context1.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Context1.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -41,7 +41,6 @@
import com.arjuna.mw.wsas.context.Context;
import com.arjuna.mw.wsas.context.ContextManager;
import com.arjuna.mw.wsas.context.soap.SOAPContext;
-import com.arjuna.mwlabs.wsas.util.XMLUtils;
import com.arjuna.wsas.tests.DemoHLS;
import com.arjuna.wsas.tests.WSASTestUtils;
import com.arjuna.wsas.tests.DemoSOAPContextImple;
@@ -78,26 +77,19 @@
org.w3c.dom.Document doc = docBuilder.newDocument();
org.w3c.dom.Element root = doc.createElement("Context1-test");
doc.appendChild(root);
+ String coordinationType = demoHLS.identity();
- ua.start();
+ ua.start(coordinationType);
System.out.println("Started: "+ua.activityName());
- ua.start();
+ ua.start(coordinationType);
System.out.println("Started: "+ua.activityName()+"\n");
ContextManager contextManager = new ContextManager();
- Context[] contexts = contextManager.contexts();
- Context theContext = null;
+ Context theContext = contextManager.context(coordinationType);
- for (int i = 0; i < contexts.length; i++) {
- if (contexts[i] != null) {
- theContext = contexts[i];
- break;
- }
- }
-
if (theContext == null) {
fail("Demo context not found");
}
@@ -114,16 +106,8 @@
System.out.println("\nFinished child activity.\n");
- contexts = contextManager.contexts();
- theContext = null;
+ theContext = contextManager.context(coordinationType);
- for (int i = 0; i < contexts.length; i++) {
- if (contexts[i] != null) {
- theContext = contexts[i];
- break;
- }
- }
-
if (theContext == null) {
fail("Demo context not found");
}
@@ -145,6 +129,11 @@
System.out.println("\nFinished parent activity.\n");
+ theContext = contextManager.context(coordinationType);
+
+ if (theContext != null) {
+ fail("Demo context not removed");
+ }
}
catch (Exception ex)
{
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Context2.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Context2.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Context2.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -41,7 +41,6 @@
import com.arjuna.mw.wsas.context.Context;
import com.arjuna.mw.wsas.context.ContextManager;
import com.arjuna.mw.wsas.context.soap.SOAPContext;
-import com.arjuna.mwlabs.wsas.util.XMLUtils;
import com.arjuna.wsas.tests.DemoHLS;
import com.arjuna.wsas.tests.FailureHLS;
import com.arjuna.wsas.tests.WSASTestUtils;
@@ -66,7 +65,7 @@
{
UserActivity ua = UserActivityFactory.userActivity();
DemoHLS demoHLS = new DemoHLS();
- FailureHLS failureHLS = new FailureHLS(); // this constructor means it will lnto fail
+ FailureHLS failureHLS = new FailureHLS(); // this constructor means it will not fail
HLS[] currentHLS = ActivityManagerFactory.activityManager().allHighLevelServices();
for (HLS hls : currentHLS) {
@@ -82,85 +81,76 @@
org.w3c.dom.Document doc = docBuilder.newDocument();
org.w3c.dom.Element root = doc.createElement("Context2-test");
doc.appendChild(root);
+ String demoServiceType = demoHLS.identity();
+ String failureServiceType = failureHLS.identity();
- ua.start();
+ ua.start(demoServiceType);
System.out.println("Started: "+ua.activityName());
- ua.start();
+ ua.start(failureServiceType);
System.out.println("Started: "+ua.activityName()+"\n");
- ContextManager contextManager = new ContextManager();
- Context[] contexts = contextManager.contexts();
- Context theContext1 = null;
- Context theContext2 = null;
- int numContexts = (contexts != null ? contexts.length : 0);
+ String currentServiceType = ua.serviceType();
- for (int i = 0; i < numContexts; i++) {
- if (contexts[i] != null) {
- if (theContext1 == null) {
- theContext1 = contexts[i];
- } else {
- theContext2 = contexts[i];
- break;
- }
- }
+ if (currentServiceType != failureServiceType) {
+ fail("invalid service type for current activity");
}
- if (theContext1 == null || theContext2 == null) {
- fail("Demo contexts not found");
+ ContextManager contextManager = new ContextManager();
+
+ Context demoServiceContext;
+ Context failureServiceContext;
+
+ demoServiceContext = contextManager.context(demoServiceType);
+ failureServiceContext = contextManager.context(failureServiceType);
+
+ // we should find a context for each service
+
+ if (failureServiceContext == null) {
+ fail("Failure context not found");
+ } else if (demoServiceContext != null) {
+ fail("Found multiple contexts");
}
- if (!(theContext1 instanceof DemoSOAPContextImple) ||
- !(theContext1 instanceof DemoSOAPContextImple)) {
- fail("Demo contexts not found");
+ if (!(failureServiceContext instanceof DemoSOAPContextImple)) {
+ fail("Failure context not found");
}
- ((SOAPContext)theContext1).serialiseToElement(root);
- ((SOAPContext)theContext2).serialiseToElement(root);
+ ((SOAPContext)failureServiceContext).serialiseToElement(root);
- System.out.println("Context is " + root.getTextContent());
+ System.out.println("Faiure Context is " + root.getTextContent());
ua.end();
System.out.println("\nFinished child activity.\n");
- contexts = contextManager.contexts();
- theContext1 = null;
- theContext2 = null;
- numContexts = (contexts != null ? contexts.length : 0);
+ currentServiceType = ua.serviceType();
- for (int i = 0; i < numContexts; i++) {
- if (contexts[i] != null) {
- if (theContext1 == null) {
- theContext1 = contexts[i];
- } else {
- theContext2 = contexts[i];
- break;
- }
- }
+ if (currentServiceType != demoServiceType) {
+ fail("invalid service type for current activity");
}
- if (theContext1 == null || theContext2 == null) {
- fail("Demo contexts not found");
+ demoServiceContext = contextManager.context(demoServiceType);
+ failureServiceContext = contextManager.context(failureServiceType);
+
+ // we should only find one context for the demo service
+
+ if (demoServiceContext == null) {
+ fail("Demo context not found");
+ } else if (failureServiceContext != null) {
+ fail("Found multiple contexts");
}
- if (!(theContext1 instanceof DemoSOAPContextImple) ||
- !(theContext1 instanceof DemoSOAPContextImple)) {
- fail("Demo contexts not found");
+ if (!(demoServiceContext instanceof DemoSOAPContextImple)) {
+ fail("Demo context not found");
}
- doc = docBuilder.newDocument();
- root = doc.createElement("Context2-test");
- doc.appendChild(root);
+ ((SOAPContext)demoServiceContext).serialiseToElement(root);
-
- ((SOAPContext)theContext1).serialiseToElement(root);
- ((SOAPContext)theContext2).serialiseToElement(root);
-
- System.out.println("Context is " + root.getTextContent());
-
+ System.out.println("Demo Context is " + root.getTextContent());
+
ua.end();
System.out.println("\nFinished parent activity.\n");
Modified: labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Service.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Service.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSAS/tests/classes/com/arjuna/wsas/tests/junit/hls/Service.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,12 +61,13 @@
try
{
ActivityManagerFactory.activityManager().addHLS(demoHLS);
+ String coordinationType = demoHLS.identity();
+
+ ua.start(coordinationType);
- ua.start();
-
System.out.println("Started: "+ua.activityName());
- ua.start();
+ ua.start(coordinationType);
System.out.println("Started: "+ua.activityName());
Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/api/UserCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/api/UserCoordinator.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/api/UserCoordinator.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -72,7 +72,7 @@
* @exception SystemException Thrown in any other situation.
*/
- public void begin () throws WrongStateException, SystemException;
+ public void begin (String coordinationType) throws WrongStateException, SystemException;
/**
* Start a new activity. If there is already an activity associated
@@ -90,7 +90,7 @@
* @exception SystemException Thrown in any other situation.
*/
- public void begin (int timeout) throws WrongStateException, InvalidTimeoutException, SystemException;
+ public void begin (String coordinationType, int timeout) throws WrongStateException, InvalidTimeoutException, SystemException;
/**
* Confirm the current activity.
Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/api/UserCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/api/UserCoordinator.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/api/UserCoordinator.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -72,7 +72,7 @@
* @exception SystemException Thrown in any other situation.
*/
- public void begin () throws WrongStateException, SystemException;
+ public void begin (String serviceType) throws WrongStateException, SystemException;
/**
* Start a new activity. If there is already an activity associated
@@ -90,7 +90,7 @@
* @exception SystemException Thrown in any other situation.
*/
- public void begin (int timeout) throws WrongStateException, InvalidTimeoutException, SystemException;
+ public void begin (String serviceType, int timeout) throws WrongStateException, InvalidTimeoutException, SystemException;
/**
* Confirm the current activity.
Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/CoordinatorServiceImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/CoordinatorServiceImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/CoordinatorServiceImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -45,7 +45,6 @@
import com.arjuna.mwlabs.wsas.UserActivityImple;
import com.arjuna.mwlabs.wsas.activity.ActivityImple;
-import com.arjuna.mwlabs.wsas.activity.CompositeOutcomeImple;
import com.arjuna.mw.wsas.activity.Outcome;
@@ -96,9 +95,9 @@
* @exception SystemException Thrown in any other situation.
*/
- public void begin () throws WrongStateException, SystemException
+ public void begin (String coordinationType) throws WrongStateException, SystemException
{
- UserActivityFactory.userActivity().start();
+ UserActivityFactory.userActivity().start(coordinationType);
}
/**
@@ -116,9 +115,9 @@
* @exception SystemException Thrown in any other situation.
*/
- public void begin (int timeout) throws WrongStateException, InvalidTimeoutException, SystemException
+ public void begin (String coordinationType, int timeout) throws WrongStateException, InvalidTimeoutException, SystemException
{
- UserActivityFactory.userActivity().start(timeout);
+ UserActivityFactory.userActivity().start(coordinationType, timeout);
}
@@ -157,11 +156,6 @@
if (res != null)
{
- // TODO properly! One HLS service per activity.
-
- if (res instanceof CompositeOutcomeImple)
- res = ((CompositeOutcomeImple) res).get(CoordinationOutcome.class.getName());
-
if (res instanceof CoordinationOutcome)
{
CoordinationOutcome co = (CoordinationOutcome) res;
@@ -221,9 +215,6 @@
if (res != null)
{
- if (res instanceof CompositeOutcomeImple)
- res = ((CompositeOutcomeImple) res).get(CoordinationOutcome.class.getName());
-
if (res instanceof CoordinationOutcome)
{
CoordinationOutcome co = (CoordinationOutcome) res;
Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/CoordinatorServiceImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/CoordinatorServiceImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/CoordinatorServiceImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -45,7 +45,6 @@
import com.arjuna.mwlabs.wsas.UserActivityImple;
import com.arjuna.mwlabs.wsas.activity.ActivityImple;
-import com.arjuna.mwlabs.wsas.activity.CompositeOutcomeImple;
import com.arjuna.mw.wsas.activity.Outcome;
@@ -97,9 +96,9 @@
* Thrown in any other situation.
*/
- public void begin () throws WrongStateException, SystemException
+ public void begin (String serviceType) throws WrongStateException, SystemException
{
- UserActivityFactory.userActivity().start();
+ UserActivityFactory.userActivity().start(serviceType);
}
/**
@@ -121,10 +120,10 @@
* Thrown in any other situation.
*/
- public void begin (int timeout) throws WrongStateException,
+ public void begin (String serviceType, int timeout) throws WrongStateException,
InvalidTimeoutException, SystemException
{
- UserActivityFactory.userActivity().start(timeout);
+ UserActivityFactory.userActivity().start(serviceType, timeout);
}
/**
@@ -166,9 +165,6 @@
{
// TODO properly! One HLS service per activity.
- if (res instanceof CompositeOutcomeImple)
- res = ((CompositeOutcomeImple) res).get(CoordinationOutcome.class.getName());
-
if (res instanceof CoordinationOutcome)
{
CoordinationOutcome co = (CoordinationOutcome) res;
@@ -241,9 +237,6 @@
if (res != null)
{
- if (res instanceof CompositeOutcomeImple)
- res = ((CompositeOutcomeImple) res).get(CoordinationOutcome.class.getName());
-
if (res instanceof CoordinationOutcome)
{
CoordinationOutcome co = (CoordinationOutcome) res;
Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/Environment.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/Environment.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -42,7 +42,6 @@
{
public static final String PROTOCOL_IMPLEMENTATION = "com.arjuna.mw.wscf.protocolImplementation";
- public static final String JTA_CONTEXT = "com.arjuna.mw.wscf.protocols.jta.context";
public static final String TWO_PHASE_CONTEXT = "com.arjuna.mw.wscf.protocols.twophase.context";
public static final String SAGAS_CONTEXT = "com.arjuna.mw.wscf.protocols.sagas.context";
Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -112,7 +112,7 @@
/**
* The current activity is completing with the specified completion status.
*
- * @param CompletionStatus cs The completion status to use.
+ * @param cs The completion status to use.
*
* @return The result of terminating the relationship of this HLS and
* the current activity.
@@ -157,7 +157,7 @@
public String identity () throws SystemException
{
- return "SagasHLSImple";
+ return "SagasHLS";
}
/**
@@ -180,7 +180,6 @@
* Return the context augmentation for this HLS, if any on the current
* activity.
*
- * @param ActivityHierarchy current The handle on the current activity
* hierarchy. The HLS may use this when determining what information to
* place in its context data.
*
@@ -197,28 +196,24 @@
public Context context () throws SystemException
{
- String contextImple = System.getProperty(Environment.SAGAS_CONTEXT);
+ if (CONTEXT_IMPLE_NAME != null) {
+ if (CONTEXT_IMPLE_CLASS != null) {
+ try {
+ SOAPContext ctx = (SOAPContext) CONTEXT_IMPLE_CLASS.newInstance();
- if (contextImple != null)
- {
- try
- {
- Class c = Class.forName(contextImple);
- SOAPContext ctx = (SOAPContext) c.newInstance();
-
- ctx.initialiseContext(_coordManager.currentCoordinator());
+ ctx.initialiseContext(_coordManager.currentCoordinator());
- return ctx;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
-
- throw new SystemException(ex.toString());
- }
- }
- else
- throw new SystemException("SAGAS context implementation must be specified by setting environment property " + Environment.SAGAS_CONTEXT);
+ return ctx;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new SystemException(ex.toString());
+ }
+ } else {
+ throw new SystemException("Unable to create SOAPContext for SAGAS context implementation from class" + CONTEXT_IMPLE_NAME);
+ }
+ } else {
+ throw new SystemException("SAGAS context implementation must be specified by setting environment property " + Environment.SAGAS_CONTEXT);
+ }
}
/**
@@ -230,7 +225,7 @@
* This implementation only supports coordination at the end of the
* activity.
*
- * @param CompletionStatus cs The completion status to use when determining
+ * @param cs The completion status to use when determining
* how to execute the protocol.
*
* @exception WrongStateException Thrown if the coordinator is in a state
@@ -292,6 +287,18 @@
return SagasHLSImple.class.getName();
}
+ private final static String CONTEXT_IMPLE_NAME = System.getProperty(Environment.SAGAS_CONTEXT);
+ private final static Class<?> CONTEXT_IMPLE_CLASS;
+ static {
+ Class<?> tmp;
+ try {
+ tmp = Class.forName(CONTEXT_IMPLE_NAME);
+ } catch (Exception ex) {
+ tmp = null;
+ }
+ CONTEXT_IMPLE_CLASS = tmp;
+ }
+
private CoordinatorControl _coordManager;
private CoordinatorServiceImple _coordinatorService;
Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -112,8 +112,7 @@
/**
* The current activity is completing with the specified completion status.
*
- * @param CompletionStatus
- * cs The completion status to use.
+ * @param cs The completion status to use.
*
* @return The result of terminating the relationship of this HLS and the
* current activity.
@@ -157,7 +156,7 @@
public String identity () throws SystemException
{
- return "TwoPhaseHLSImple";
+ return "TwoPhaseHLS";
}
/**
@@ -176,50 +175,36 @@
return 0;
}
- /**
- * Return the context augmentation for this HLS, if any on the current
- * activity.
- *
- * @param ActivityHierarchy
- * current The handle on the current activity hierarchy. The HLS
- * may use this when determining what information to place in its
- * context data.
- *
- * @return a context object or null if no augmentation is necessary.
- */
+ /**
+ * Return the context augmentation for this HLS, if any on the current
+ * activity.
+ *
+ * @return a context object or null if no augmentation is necessary.
+ */
- /*
- * TODO This needs refactoring. It's true that the context format should be
- * configurable to allow the same implementation to be used in different
- * protocols (e.g., 2PC mapping to OTS or original Arjuna could use the same
- * protocol implementation, but the context formats are different.) However,
- * is this the best way of doing that?
- */
+ public Context context () throws SystemException
+ {
+ if (CONTEXT_IMPLE_NAME != null) {
+ if (CONTEXT_IMPLE_CLASS != null) {
+ try {
+ SOAPContext ctx = (SOAPContext) CONTEXT_IMPLE_CLASS.newInstance();
- public Context context () throws SystemException
- {
- String contextImple = System.getProperty(Environment.TWO_PHASE_CONTEXT);
+ ctx.initialiseContext(_coordManager.currentCoordinator());
- if (contextImple != null)
- {
- try
- {
- Class c = Class.forName(contextImple);
- SOAPContext ctx = (SOAPContext) c.newInstance();
+ return ctx;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new SystemException(ex.toString());
+ }
+ } else {
+ throw new SystemException("Unable to create SOAPContext for Two Phase 1.1 implementation from class" + CONTEXT_IMPLE_NAME);
+ }
+ } else {
+ throw new SystemException("Two Phase 1.1 context implementation must be specified by setting environment property " + Environment.TWO_PHASE_CONTEXT);
+ }
+ }
- ctx.initialiseContext(_coordManager.currentCoordinator());
- return ctx;
- }
- catch (Exception ex)
- {
- throw new SystemException(ex.toString());
- }
- }
- else
- throw new SystemException("Two Phase context implementation must be specified by setting environment property " + Environment.TWO_PHASE_CONTEXT);
- }
-
/**
* If the application requires and if the coordination protocol supports it,
* then this method can be used to execute a coordination protocol on the
@@ -229,8 +214,7 @@
* This implementation only supports coordination at the end of the
* activity.
*
- * @param CompletionStatus
- * cs The completion status to use when determining how to
+ * @param cs The completion status to use when determining how to
* execute the protocol.
*
* @exception WrongStateException
@@ -300,6 +284,18 @@
return TwoPhaseHLSImple.class.getName();
}
+ private final static String CONTEXT_IMPLE_NAME = System.getProperty(Environment.TWO_PHASE_CONTEXT);
+ private final static Class<?> CONTEXT_IMPLE_CLASS;
+ static {
+ Class<?> tmp;
+ try {
+ tmp = Class.forName(CONTEXT_IMPLE_NAME);
+ } catch (Exception ex) {
+ tmp = null;
+ }
+ CONTEXT_IMPLE_CLASS = tmp;
+ }
+
private CoordinatorControl _coordManager;
private CoordinatorServiceImple _coordinatorService;
Modified: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -154,12 +154,12 @@
}
/**
- * The HLS name.
+ * We identify the HLS by the name of the coordination protocol it supports.
*/
public String identity () throws SystemException
{
- return "SagasHLSImple";
+ return "Sagas11HLS";
}
/**
@@ -185,29 +185,22 @@
* @return a context object or null if no augmentation is necessary.
*/
- /*
- * TODO This needs refactoring. It's true that the context format should
- * be configurable to allow the same implementation to be used in
- * different protocols (e.g., 2PC mapping to OTS or original Arjuna could
- * use the same protocol implementation, but the context formats are
- * different.) However, is this the best way of doing that?
- */
-
public Context context () throws SystemException
{
- String contextImple = System.getProperty(Environment.SAGAS_CONTEXT);
+ if (CONTEXT_IMPLE_NAME != null) {
+ if (CONTEXT_IMPLE_CLASS != null) {
+ try {
+ SOAPContext ctx = (SOAPContext) CONTEXT_IMPLE_CLASS.newInstance();
- if (contextImple != null) {
- try {
- Class c = Class.forName(contextImple);
- SOAPContext ctx = (SOAPContext) c.newInstance();
+ ctx.initialiseContext(_coordManager.currentCoordinator());
- ctx.initialiseContext(_coordManager.currentCoordinator());
-
- return ctx;
- } catch (Exception ex) {
- ex.printStackTrace();
- throw new SystemException(ex.toString());
+ return ctx;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new SystemException(ex.toString());
+ }
+ } else {
+ throw new SystemException("Unable to create SOAPContext for SAGAS 1.1 context implementation from class" + CONTEXT_IMPLE_NAME);
}
} else {
throw new SystemException("SAGAS 1.1 context implementation must be specified by setting environment property " + Environment.SAGAS_CONTEXT);
@@ -285,6 +278,18 @@
return SagasHLSImple.class.getName();
}
+ private final static String CONTEXT_IMPLE_NAME = System.getProperty(Environment.SAGAS_CONTEXT);
+ private final static Class<?> CONTEXT_IMPLE_CLASS;
+ static {
+ Class<?> tmp;
+ try {
+ tmp = Class.forName(CONTEXT_IMPLE_NAME);
+ } catch (Exception ex) {
+ tmp = null;
+ }
+ CONTEXT_IMPLE_CLASS = tmp;
+ }
+
private CoordinatorControl _coordManager;
private CoordinatorServiceImple _coordinatorService;
Modified: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -158,7 +158,7 @@
public String identity () throws SystemException
{
- return "TwoPhaseHLSImple";
+ return "TwoPhase11HLS";
}
/**
@@ -184,33 +184,28 @@
* @return a context object or null if no augmentation is necessary.
*/
- /*
- * TODO This needs refactoring. It's true that the context format should be
- * configurable to allow the same implementation to be used in different
- * protocols (e.g., 2PC mapping to OTS or original Arjuna could use the same
- * protocol implementation, but the context formats are different.) However,
- * is this the best way of doing that?
- */
+ public Context context () throws SystemException
+ {
+ if (CONTEXT_IMPLE_NAME != null) {
+ if (CONTEXT_IMPLE_CLASS != null) {
+ try {
+ SOAPContext ctx = (SOAPContext) CONTEXT_IMPLE_CLASS.newInstance();
- public Context context () throws SystemException
- {
- String contextImple = System.getProperty(Environment.TWO_PHASE_CONTEXT);
+ ctx.initialiseContext(_coordManager.currentCoordinator());
- if (contextImple != null){
- try {
- Class c = Class.forName(contextImple);
- SOAPContext ctx = (SOAPContext) c.newInstance();
-
- ctx.initialiseContext(_coordManager.currentCoordinator());
-
- return ctx;
- } catch (Exception ex) {
- throw new SystemException(ex.toString());
- }
- } else {
+ return ctx;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new SystemException(ex.toString());
+ }
+ } else {
+ throw new SystemException("Unable to create SOAPContext for Two Phase 1.1 implementation from class" + CONTEXT_IMPLE_NAME);
+ }
+ } else {
throw new SystemException("Two Phase 1.1 context implementation must be specified by setting environment property " + Environment.TWO_PHASE_CONTEXT);
}
}
+
/**
* If the application requires and if the coordination protocol supports it,
* then this method can be used to execute a coordination protocol on the
@@ -290,6 +285,18 @@
return TwoPhaseHLSImple.class.getName();
}
+ private final static String CONTEXT_IMPLE_NAME = System.getProperty(Environment.TWO_PHASE_CONTEXT);
+ private final static Class<?> CONTEXT_IMPLE_CLASS;
+ static {
+ Class<?> tmp;
+ try {
+ tmp = Class.forName(CONTEXT_IMPLE_NAME);
+ } catch (Exception ex) {
+ tmp = null;
+ }
+ CONTEXT_IMPLE_CLASS = tmp;
+ }
+
private CoordinatorControl _coordManager;
private CoordinatorServiceImple _coordinatorService;
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/AddParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/AddParticipant.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/AddParticipant.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -35,6 +35,7 @@
import com.arjuna.mw.wscf.model.twophase.CoordinatorManagerFactory;
+import com.arjuna.mwlabs.wsas.activity.HLSManager;
import com.arjuna.wscf.tests.TwoPhaseParticipant;
import com.arjuna.wscf.tests.WSCFTestUtils;
import org.junit.After;
@@ -61,7 +62,7 @@
try
{
- cm.begin();
+ cm.begin("TwoPhaseHLS");
cm.enlistParticipant(new TwoPhaseParticipant(null));
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/AddSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/AddSynchronization.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/AddSynchronization.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,7 +61,7 @@
try
{
- cm.begin();
+ cm.begin("TwoPhaseHLS");
cm.enlistSynchronization(new TwoPhaseSynchronization());
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/BeginCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/BeginCancel.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/BeginCancel.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -56,7 +56,7 @@
UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/BeginConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/BeginConfirm.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/BeginConfirm.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -59,7 +59,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/CancelOnlyCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/CancelOnlyCancel.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/CancelOnlyCancel.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,7 +61,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/CancelOnlyConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/CancelOnlyConfirm.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/CancelOnlyConfirm.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,7 +61,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/ContextOutput.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/ContextOutput.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/ContextOutput.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -64,29 +64,26 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
ContextManager cxman = new ContextManager();
- Context[] contexts = cxman.contexts();
- for (int i = 0; i < contexts.length; i++)
- {
- SOAPContext theContext = (SOAPContext)contexts[i];
+ Context context = cxman.context("TwoPhaseHLS");
+ SOAPContext theContext = (SOAPContext)context;
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- org.w3c.dom.Document doc = builder.newDocument();
- org.w3c.dom.Element root = doc.createElement("Context-test");
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ org.w3c.dom.Document doc = builder.newDocument();
+ org.w3c.dom.Element root = doc.createElement("Context-test");
- // this fails because the documents are different -- need a better test than this
- ((SOAPContext)theContext).serialiseToElement(root) ;
- doc.appendChild(root);
+ // this fails because the documents are different -- need a better test than this
+ ((SOAPContext)theContext).serialiseToElement(root) ;
+ doc.appendChild(root);
- // this does not do a full recursive conversion to text format -- need a better test than this
- System.out.println(com.arjuna.mw.wscf.utils.DomUtil.nodeAsString(doc));
-
- }
+ // this does not do a full recursive conversion to text format -- need a better test than this
+ System.out.println(com.arjuna.mw.wscf.utils.DomUtil.nodeAsString(doc));
+
ua.cancel();
}
catch (Exception ex)
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/ParticipantSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/ParticipantSynchronization.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/ParticipantSynchronization.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -62,7 +62,7 @@
try
{
- cm.begin();
+ cm.begin("TwoPhaseHLS");
cm.enlistParticipant(new TwoPhaseParticipant(null));
cm.enlistParticipant(new TwoPhaseParticipant(null));
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/Suspend.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/Suspend.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/Suspend.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -63,7 +63,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendConfirm.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendConfirm.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -63,7 +63,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendParticipant.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendParticipant.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -64,7 +64,7 @@
try
{
- cm.begin();
+ cm.begin("TwoPhaseHLS");
cm.enlistParticipant(new TwoPhaseParticipant("p1"));
cm.enlistParticipant(new TwoPhaseParticipant("p2"));
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendResume.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendResume.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/SuspendResume.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,7 +61,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscContext.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscContext.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscContext.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,19 +61,17 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
ContextManager cxman = new ContextManager();
- Context[] contexts = cxman.contexts();
- for (int i = 0; i < contexts.length; i++)
- {
- // this fails because the context toString method gets a NPE -- need a better test
- SOAPContext theContext = (SOAPContext)contexts[i];
- System.out.println("" + i + " " + theContext);
- }
+ Context context = cxman.context("TwoPhaseHLS");
+ // this fails because the context toString method gets a NPE -- need a better test
+ SOAPContext theContext = (SOAPContext)context;
+ System.out.println(theContext);
+
ua.cancel();
}
catch (Exception ex)
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscNestedContext.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscNestedContext.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscNestedContext.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,50 +61,46 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
ContextManager cxman = new ContextManager();
- Context[] contexts = cxman.contexts();
- for (int i = 0; i < contexts.length; i++)
- {
- SOAPContext theContext = (SOAPContext)contexts[i];
+ Context context = cxman.context("TwoPhaseHLS");
+ SOAPContext theContext = (SOAPContext)context;
+
// this fails because the context toString method gets a NPE -- need a better test
- System.out.println("Context: " + theContext);
- }
-
+ System.out.println("Context: " + theContext);
+
ua.cancel();
System.out.println("Cancelled");
- for (int i = 0; i < contexts.length; i++)
- {
- SOAPContext theContext = (SOAPContext)contexts[i];
+ context = cxman.context("TwoPhaseHLS");
- System.out.println("Context: " + theContext);
- }
+ theContext = (SOAPContext)context;
+ System.out.println("Context: " + theContext);
+
ua.cancel();
System.out.println("Cancelled");
- for (int i = 0; i < contexts.length; i++)
- {
- SOAPContext theContext = (SOAPContext)contexts[i];
+ context = cxman.context("TwoPhaseHLS");
- System.out.println("Context: " + theContext);
- }
+ theContext = (SOAPContext)context;
+ System.out.println("Context: " + theContext);
+
ua.cancel();
System.out.println("Cancelled");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscTranslateContext.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscTranslateContext.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/WscTranslateContext.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -67,29 +67,27 @@
try
{
- ua.begin();
+ ua.begin("TwoPhaseHLS");
System.out.println("Started: "+ua.identifier()+"\n");
ContextManager cxman = new ContextManager();
- Context[] contexts = cxman.contexts();
- for (int i = 0; i < contexts.length; i++)
- {
- SOAPContext theContext = (SOAPContext)contexts[i];
- // this fails because the context toString method gets a NPE -- need a better test
- System.out.println("" + i + " " + theContext);
+ Context context = cxman.context("TwoPhaseHLS");
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- org.w3c.dom.Document doc = builder.newDocument();
- org.w3c.dom.Element ctx = doc.createElement("Context-test");
- final Element context = ((SOAPContext)theContext).serialiseToElement(ctx) ;
+ SOAPContext theContext = (SOAPContext)context;
+ // this fails because the context toString method gets a NPE -- need a better test
+ System.out.println(theContext);
+
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ org.w3c.dom.Document doc = builder.newDocument();
+ org.w3c.dom.Element ctx = doc.createElement("Context-test");
+ final Element contextElement = ((SOAPContext)theContext).serialiseToElement(ctx) ;
- org.w3c.dom.Element wscCtx = translate(context);
+ org.w3c.dom.Element wscCtx = translate(contextElement);
- System.out.println("\nNow got "+DomUtil.nodeAsString(wscCtx));
- }
-
+ System.out.println("\nNow got "+DomUtil.nodeAsString(wscCtx));
+
ua.cancel();
}
catch (Exception ex)
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/AddParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/AddParticipant.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/AddParticipant.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -21,7 +21,7 @@
try
{
- cm.begin();
+ cm.begin("Sagas11HLS");
cm.enlistParticipant(new SagasParticipant(null));
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginCancel.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginCancel.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -17,7 +17,7 @@
UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
- ua.begin();
+ ua.begin("Sagas11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginClose.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/BeginClose.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -20,7 +20,7 @@
try
{
- ua.begin();
+ ua.begin("Sagas11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyCancel.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyCancel.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -21,7 +21,7 @@
try
{
- ua.begin();
+ ua.begin("Sagas11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyClose.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/CancelOnlyClose.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -23,7 +23,7 @@
try
{
- ua.begin();
+ ua.begin("Sagas11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantCannotCompleteClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantCannotCompleteClose.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantCannotCompleteClose.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -26,7 +26,7 @@
{
String id = "1234";
- cm.begin();
+ cm.begin("Sagas11HLS");
SagasParticipant participant = new SagasParticipant(id);
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantExitedClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantExitedClose.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantExitedClose.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -26,7 +26,7 @@
{
String id = "1235";
- cm.begin();
+ cm.begin("Sagas11HLS");
SagasParticipant participant = new SagasParticipant(id);
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantFaultedClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantFaultedClose.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/ParticipantFaultedClose.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -26,7 +26,7 @@
{
String id = "1236";
- cm.begin();
+ cm.begin("Sagas11HLS");
SagasParticipant participant = new SagasParticipant(id);
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/Suspend.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/Suspend.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/Suspend.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -24,7 +24,7 @@
try
{
- ua.begin();
+ ua.begin("Sagas11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendClose.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendClose.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -24,7 +24,7 @@
try
{
- ua.begin();
+ ua.begin("Sagas11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResume.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResume.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResume.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -23,7 +23,7 @@
try
{
- ua.begin();
+ ua.begin("Sagas11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResumeMultiParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResumeMultiParticipant.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/sagas/SuspendResumeMultiParticipant.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -24,7 +24,7 @@
try
{
- cm.begin();
+ cm.begin("Sagas11HLS");
cm.enlistParticipant(new SagasParticipant("p1"));
cm.enlistParticipant(new SagasParticipant("p2"));
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddParticipant.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddParticipant.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -59,7 +59,7 @@
try
{
- cm.begin();
+ cm.begin("TwoPhase11HLS");
cm.enlistParticipant(new TwoPhaseParticipant(null));
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddSynchronization.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddSynchronization.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -59,7 +59,7 @@
try
{
- cm.begin();
+ cm.begin("TwoPhase11HLS");
cm.enlistSynchronization(new TwoPhaseSynchronization());
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginCancel.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginCancel.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -54,7 +54,7 @@
UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
- ua.begin();
+ ua.begin("TwoPhase11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginConfirm.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginConfirm.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -57,7 +57,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhase11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyCancel.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyCancel.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -59,7 +59,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhase11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyConfirm.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyConfirm.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -59,7 +59,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhase11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -60,7 +60,7 @@
try
{
- cm.begin();
+ cm.begin("TwoPhase11HLS");
cm.enlistParticipant(new TwoPhaseParticipant(null));
cm.enlistParticipant(new TwoPhaseParticipant(null));
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/Suspend.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/Suspend.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/Suspend.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,7 +61,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhase11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendConfirm.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendConfirm.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -61,7 +61,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhase11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendParticipant.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendParticipant.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -62,7 +62,7 @@
try
{
- cm.begin();
+ cm.begin("TwoPhase11HLS");
cm.enlistParticipant(new TwoPhaseParticipant("p1"));
cm.enlistParticipant(new TwoPhaseParticipant("p2"));
Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendResume.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendResume.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendResume.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -59,7 +59,7 @@
try
{
- ua.begin();
+ ua.begin("TwoPhase11HLS");
System.out.println("Started: "+ua.identifier()+"\n");
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -134,7 +134,7 @@
timeout = (timeoutVal > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)timeoutVal) ;
}
- _coordManager.begin(timeout);
+ _coordManager.begin("TwoPhaseHLS", timeout);
final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/context/ArjunaContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/context/ArjunaContextImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/context/ArjunaContextImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -219,25 +219,19 @@
public static ArjunaContextImple getContext()
{
ContextManager cxman = new ContextManager();
- Context[] contexts = cxman.contexts();
+ Context context = cxman.context("TwoPhaseHLS");
- for (int i = 0; i < contexts.length; i++)
+ if (context instanceof ArjunaContextImple)
{
- if (contexts[i].identifier().equals(ArjunaContextImple.class.getName()))
- {
- if (contexts[i] instanceof ArjunaContextImple)
- {
- return (ArjunaContextImple)contexts[i] ;
- }
- else {
- wstxLogger.i18NLogger.warn_mwlabs_wst_at_context_ArjunaContextImple_1(contexts[i].toString());
- }
- break;
- }
+ return (ArjunaContextImple)context ;
}
- return null ;
+ else
+ {
+ wstxLogger.i18NLogger.warn_mwlabs_wst_at_context_ArjunaContextImple_1(context.toString());
+ }
+
+ return null;
}
-
private org.w3c.dom.Element _context;
private String[] _identifierValues ;
private int[] _expiresValues ;
@@ -248,5 +242,4 @@
private static final String _contextName = CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT;
private static final String _identifier = CoordinationConstants.WSCOOR_ELEMENT_IDENTIFIER;
private static final String _expires = CoordinationConstants.WSCOOR_ELEMENT_EXPIRES;
-
}
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/LocalContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/LocalContextFactoryImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/LocalContextFactoryImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -103,7 +103,7 @@
{
_coordManager.suspend();
- _coordManager.begin();
+ _coordManager.begin("TwoPhaseHLS");
final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -121,7 +121,7 @@
timeout = (longTimeout > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)longTimeout) ;
}
- _coordManager.begin(timeout);
+ _coordManager.begin("SagasHLS", timeout);
final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
@@ -184,7 +184,6 @@
* times if the context factory is removed from multiple context factory mappers or from the same context factory
* mapper with different coordination type uris.
*
- * @param serviceAddress the address of the service
* @param coordinationTypeURI the coordination type uri
*/
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/context/ArjunaContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/context/ArjunaContextImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/context/ArjunaContextImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -218,22 +218,17 @@
public static ArjunaContextImple getContext()
{
ContextManager cxman = new ContextManager();
- Context[] contexts = cxman.contexts();
+ Context context = cxman.context("SagasHLS");
- for (int i = 0; i < contexts.length; i++)
+ if (context instanceof ArjunaContextImple)
{
- if (contexts[i].identifier().equals(ArjunaContextImple.class.getName()))
- {
- if (contexts[i] instanceof ArjunaContextImple)
- {
- return (ArjunaContextImple)contexts[i] ;
- }
- else {
- wstxLogger.i18NLogger.warn_mwlabs_wst_ba_context_ArjunaContextImple_1(contexts[i].toString());
- }
- break;
- }
+ return (ArjunaContextImple)context ;
}
+ else
+ {
+ wstxLogger.i18NLogger.warn_mwlabs_wst11_ba_context_ArjunaContextImple_1(context.toString());
+ }
+
return null ;
}
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/local/LocalContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/local/LocalContextFactoryImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/local/LocalContextFactoryImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -98,7 +98,7 @@
{
_coordManager.suspend();
- _coordManager.begin();
+ _coordManager.begin("SagasHLS");
final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -136,7 +136,7 @@
timeout = (timeoutVal > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)timeoutVal) ;
}
- _coordManager.begin(timeout);
+ _coordManager.begin("TwoPhase11HLS", timeout);
final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/ArjunaContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/ArjunaContextImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/ArjunaContextImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -221,22 +221,17 @@
public static ArjunaContextImple getContext()
{
ContextManager cxman = new ContextManager();
- Context[] contexts = cxman.contexts();
+ Context context = cxman.context("TwoPhase11HLS");
- for (int i = 0; i < contexts.length; i++)
+ if (context instanceof ArjunaContextImple)
{
- if (contexts[i].identifier().equals(ArjunaContextImple.class.getName()))
- {
- if (contexts[i] instanceof ArjunaContextImple)
- {
- return (ArjunaContextImple)contexts[i] ;
- }
- else {
- wstxLogger.i18NLogger.warn_mwlabs_wst11_at_context_ArjunaContextImple_1(contexts[i].toString());
- }
- break;
- }
+ return (ArjunaContextImple)context ;
}
+ else
+ {
+ wstxLogger.i18NLogger.warn_mwlabs_wst11_at_context_ArjunaContextImple_1(context.toString());
+ }
+
return null ;
}
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -139,7 +139,7 @@
timeout = (longTimeout > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)longTimeout) ;
}
- _coordManager.begin(timeout);
+ _coordManager.begin("Sagas11HLS", timeout);
final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/ArjunaContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/ArjunaContextImple.java 2010-08-04 15:36:50 UTC (rev 34519)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/ArjunaContextImple.java 2010-08-04 15:54:43 UTC (rev 34520)
@@ -221,22 +221,17 @@
public static ArjunaContextImple getContext()
{
ContextManager cxman = new ContextManager();
- Context[] contexts = cxman.contexts();
+ Context context = cxman.context("Sagas11HLS");
- for (int i = 0; i < contexts.length; i++)
+ if (context instanceof ArjunaContextImple)
{
- if (contexts[i].identifier().equals(ArjunaContextImple.class.getName()))
- {
- if (contexts[i] instanceof ArjunaContextImple)
- {
- return (ArjunaContextImple)contexts[i] ;
- }
- else {
- wstxLogger.i18NLogger.warn_mwlabs_wst11_ba_context_ArjunaContextImple_1(contexts[i].toString());
- }
- break;
- }
+ return (ArjunaContextImple)context ;
}
+ else
+ {
+ wstxLogger.i18NLogger.warn_mwlabs_wst11_ba_context_ArjunaContextImple_1(context.toString());
+ }
+
return null ;
}
More information about the jboss-svn-commits
mailing list