use of com.arjuna.mw.wsas.common.GlobalId in project narayana by jbosstm.
the class DemoHLS method begun.
/**
* An activity has begun and is active on the current thread.
*/
public void begun() throws SystemException {
try {
GlobalId activityId = UserActivityFactory.userActivity().activityId();
_id.push(activityId);
System.out.println("DemoHLS.begun " + activityId);
} catch (Exception ex) {
ex.printStackTrace();
}
}
use of com.arjuna.mw.wsas.common.GlobalId in project narayana by jbosstm.
the class ResumeTest method testResume.
@Test
public void testResume() throws Exception {
UserActivity ua = UserActivityFactory.userActivity();
try {
GlobalId ac1 = null;
GlobalId ac2 = null;
ua.start("dummy");
ac1 = ua.activityId();
System.out.println("Started: " + ac1);
ua.start("dummy");
ac2 = ua.activityId();
System.out.println("\nStarted: " + ac2);
ActivityHierarchy ctx = ua.suspend();
System.out.println("\nSuspended: " + ctx);
if (ua.currentActivity() != null) {
fail("Current activity shoudl be null " + ua.currentActivity());
}
ua.resume(ctx);
if (!ac2.equals(ua.activityId())) {
fail("Current activity id " + ua.activityId() + " should equal " + ac2);
}
ua.end();
if (!ac1.equals(ua.activityId())) {
fail("Current activity id " + ua.activityId() + " should equal " + ac1);
}
} finally {
WSASTestUtils.cleanup(ua);
}
}
use of com.arjuna.mw.wsas.common.GlobalId in project narayana by jbosstm.
the class FailureHLS method begun.
/**
* An activity has begun and is active on the current thread.
*/
public void begun() throws SystemException {
if (_failPoint == FailureHLS.BEGUN_FAIL)
throw new SystemException();
try {
GlobalId activityId = UserActivityFactory.userActivity().activityId();
_id.push(activityId);
System.out.println("FailureHLS.begun " + activityId);
} catch (Exception ex) {
ex.printStackTrace();
}
}
Aggregations