com.arjuna.mw.wst11
Class UserBusinessActivity

java.lang.Object
  extended by com.arjuna.mw.wst11.UserBusinessActivity

public abstract class UserBusinessActivity
extends Object

This is the interface that allows BAs to be started and terminated. The messaging layer converts the messages into calls on this. Importantly, a UserBusinessActivity does not represent a specific transaction, but rather is responsible for providing access to an implicit per-thread transaction context; it is similar to the UserTransaction in the JTA specification. Therefore, all of the UserTransaction methods implicitly act on the current thread of control.

Since:
XTS 1.0.
Version:
$Id: UserBusinessActivity.java,v 1.4.6.1 2005/11/22 10:36:06 kconner Exp $
Author:
Mark Little (mark.little@arjuna.com)

Field Summary
static int ATOMIC_OUTCOME
           
static int MIXED_OUTCOME
           
 
Constructor Summary
UserBusinessActivity()
           
 
Method Summary
abstract  void begin()
          Start a new business activity with atomic outcome.
abstract  void begin(int timeout)
          Start a new BA with atomic outcome and the specified timeout as its lifetime.
abstract  void cancel()
          If the BA must undo its work then the cancel method is used.
abstract  void close()
          The BA is normally terminated by the close method.
abstract  void complete()
          If participants have registered for the BusinessAgreementWithComplete protocol then they will be expecting the application to inform them when all work intended for them has been sent (and responded to).
static UserBusinessActivity getUserBusinessActivity()
          Get the user business activity.
abstract  UserBusinessActivity getUserSubordinateBusinessActivity()
          get the user subordinate business activity this is a UserBusinessActivity whose begin method will create an interposed BA transaction
static void setUserBusinessActivity(UserBusinessActivity userBusinessActivity)
          Set the user business activity.
abstract  String transactionIdentifier()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATOMIC_OUTCOME

public static final int ATOMIC_OUTCOME
See Also:
Constant Field Values

MIXED_OUTCOME

public static final int MIXED_OUTCOME
See Also:
Constant Field Values
Constructor Detail

UserBusinessActivity

public UserBusinessActivity()
Method Detail

getUserBusinessActivity

public static UserBusinessActivity getUserBusinessActivity()
Get the user business activity.

Returns:
The user business activity.

setUserBusinessActivity

public static void setUserBusinessActivity(UserBusinessActivity userBusinessActivity)
Set the user business activity.

Parameters:
userBusinessActivity - The user business activity.

getUserSubordinateBusinessActivity

public abstract UserBusinessActivity getUserSubordinateBusinessActivity()
get the user subordinate business activity this is a UserBusinessActivity whose begin method will create an interposed BA transaction

Returns:
The user business activity.

begin

public abstract void begin()
                    throws WrongStateException,
                           SystemException
Start a new business activity with atomic outcome. If one is already associated with this thread then the WrongStateException will be thrown. Upon success, this operation associates the newly created transaction with the current thread.

Throws:
WrongStateException
SystemException

begin

public abstract void begin(int timeout)
                    throws WrongStateException,
                           SystemException
Start a new BA with atomic outcome and the specified timeout as its lifetime. If one is already associated with this thread then the WrongStateException will be thrown.

Throws:
WrongStateException
SystemException

close

public abstract void close()
                    throws TransactionRolledBackException,
                           UnknownTransactionException,
                           SystemException,
                           WrongStateException
The BA is normally terminated by the close method. This signals to all registered participants that the BA has ended and no compensation is required.

Throws:
TransactionRolledBackException
UnknownTransactionException
SystemException
WrongStateException

cancel

public abstract void cancel()
                     throws UnknownTransactionException,
                            SystemException,
                            WrongStateException
If the BA must undo its work then the cancel method is used. Any participants that can compensate are forced to do so.

Throws:
UnknownTransactionException
SystemException
WrongStateException

complete

public abstract void complete()
                       throws UnknownTransactionException,
                              SystemException,
                              WrongStateException
If participants have registered for the BusinessAgreementWithComplete protocol then they will be expecting the application to inform them when all work intended for them has been sent (and responded to). The complete method is used for this purpose.

Throws:
UnknownTransactionException
SystemException
WrongStateException

transactionIdentifier

public abstract String transactionIdentifier()


Copyright © 2011. All Rights Reserved.