/** * Given a token representing a context, associate it with the current * thread of control. This will implicitly disassociate the thread from any * activities that it may already be associated with. If the parameter is * null then the thread is associated with no activity. * * @param tx The activity to associate with this thread. This * may be null in which case the current thread becomes associated with * no activity. * * @exception InvalidActivityException Thrown if the activity handle * is invalid in this context. * @exception SystemException Thrown if any other error occurs. */ public void resume (ActivityHierarchy tx) throws InvalidActivityException, SystemException { UserActivityFactory.userActivity().resume(tx); }
/** * Suspend the current activity from this thread and return the token * representing the context, if any, or null otherwise. Once called, the * thread will have no activities associated with it. * * @exception SystemException Thrown if any error occurs. * * @return the token representing the current context, if any, or null * otherwise. */ public ActivityHierarchy suspend () throws SystemException { return UserActivityFactory.userActivity().suspend(); }
/** * @return the token representing the current activity context hierarchy, * or null if there is none associated with the invoking thread. * * @exception SystemException Thrown if any error occurs. */ public ActivityHierarchy currentActivity () throws SystemException { return UserActivityFactory.userActivity().currentActivity(); }
Outcome res = UserActivityFactory.userActivity().end(Failure.instance());
String currentServiceType = UserActivityFactory.userActivity().serviceType(); if (currentServiceType.equals(serviceType)) { service = _manager.getHighLevelService(serviceType);
/** * 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). * * @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 begin (String coordinationType) throws WrongStateException, SystemException { UserActivityFactory.userActivity().start(coordinationType); }
/** * Get the timeout value currently associated with activities. * * @exception SystemException Thrown if any error occurs. * * @return the timeout value in seconds, or 0 if no application specified * timeout has been provided. */ public int getTimeout () throws SystemException { return UserActivityFactory.userActivity().getTimeout(); }
/** * Set the termination status for the current activity to cancel only. * * @exception WrongStateException Thrown if the completion status is * incompatible with the current state of the activity. * @exception SystemException Thrown if any other error occurs. */ public void setCancelOnly () throws NoCoordinatorException, WrongStateException, SystemException { try { UserActivityFactory.userActivity().setCompletionStatus(FailureOnly.instance()); } catch (NoActivityException ex) { throw new NoCoordinatorException(); } }
/** * Set the timeout to be associated with all subsequently created * activities. A default value of 0 is automatically associated with * each thread and this means that no application specified timeout is * set for activities. * * @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 * is negative, too large, or if timeouts are simply not supported by * the activity implementation. * @exception SystemException Thrown if any other error occurs. */ public void setTimeout (int timeout) throws InvalidTimeoutException, SystemException { UserActivityFactory.userActivity().setTimeout(timeout); }
Outcome res = UserActivityFactory.userActivity().end(Success.instance());
String currentServiceType = UserActivityFactory.userActivity().serviceType(); if (currentServiceType.equals(serviceType)) { service = _manager.getHighLevelService(serviceType);
/** * 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). * * @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 begin (String coordinationType) throws WrongStateException, SystemException { UserActivityFactory.userActivity().start(coordinationType); }
/** * Get the timeout value currently associated with activities. * * @exception SystemException Thrown if any error occurs. * * @return the timeout value in seconds, or 0 if no application specified * timeout has been provided. */ public int getTimeout () throws SystemException { return UserActivityFactory.userActivity().getTimeout(); }
/** * Set the termination status for the current activity to cancel only. * * @exception WrongStateException Thrown if the completion status is * incompatible with the current state of the activity. * @exception SystemException Thrown if any other error occurs. */ public void setCancelOnly () throws NoCoordinatorException, WrongStateException, SystemException { try { UserActivityFactory.userActivity().setCompletionStatus(FailureOnly.instance()); } catch (NoActivityException ex) { throw new NoCoordinatorException(); } }
/** * Set the timeout to be associated with all subsequently created * activities. A default value of 0 is automatically associated with * each thread and this means that no application specified timeout is * set for activities. * * @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 * is negative, too large, or if timeouts are simply not supported by * the activity implementation. * @exception SystemException Thrown if any other error occurs. */ public void setTimeout (int timeout) throws InvalidTimeoutException, SystemException { UserActivityFactory.userActivity().setTimeout(timeout); }
/** * @return the token representing the current activity context hierarchy, or * null if there is none associated with the invoking thread. * * @exception SystemException * Thrown if any error occurs. */ public ActivityHierarchy currentActivity () throws SystemException { return UserActivityFactory.userActivity().currentActivity(); }
Outcome res = UserActivityFactory.userActivity().end(Failure.instance());