com.atomikos.icatch.admin
Interface AdminTransaction

All Superinterfaces:
Serializable

public interface AdminTransaction
extends Serializable

An administrator interface for a transaction. Allows inspection of heuristic info, as well as forced 2PC methods.


Field Summary
static int STATE_ABORTING
           
static int STATE_ACTIVE
           
static int STATE_COMMITTING
           
static int STATE_HEUR_ABORTED
           
static int STATE_HEUR_COMMITTED
           
static int STATE_HEUR_HAZARD
           
static int STATE_HEUR_MIXED
           
static int STATE_PREPARED
           
static int STATE_PREPARING
           
static int STATE_TERMINATED
           
static int STATE_UNKNOWN
           
 
Method Summary
 void forceCommit()
          Force commit of the transaction.
 void forceForget()
          Force the system to forget about the transaction.
 void forceRollback()
          Force rollback of the transaction.
 HeuristicMessage[] getHeuristicMessages()
          Get the HeuristicMessage detailed info for this transaction.
 HeuristicMessage[] getHeuristicMessages(int state)
          Get the heuristic messages for work in the given state.
 int getState()
          Get the transaction's state.
 HeuristicMessage[] getTags()
          Get the high-level heuristic comments.
 String getTid()
          Get the transaction identifier.
 boolean wasCommitted()
          Test if the transaction's 2PC outcome was commit.
 

Field Detail

STATE_ACTIVE

static final int STATE_ACTIVE
See Also:
Constant Field Values

STATE_PREPARING

static final int STATE_PREPARING
See Also:
Constant Field Values

STATE_UNKNOWN

static final int STATE_UNKNOWN
See Also:
Constant Field Values

STATE_PREPARED

static final int STATE_PREPARED
See Also:
Constant Field Values

STATE_HEUR_COMMITTED

static final int STATE_HEUR_COMMITTED
See Also:
Constant Field Values

STATE_HEUR_ABORTED

static final int STATE_HEUR_ABORTED
See Also:
Constant Field Values

STATE_HEUR_HAZARD

static final int STATE_HEUR_HAZARD
See Also:
Constant Field Values

STATE_HEUR_MIXED

static final int STATE_HEUR_MIXED
See Also:
Constant Field Values

STATE_ABORTING

static final int STATE_ABORTING
See Also:
Constant Field Values

STATE_COMMITTING

static final int STATE_COMMITTING
See Also:
Constant Field Values

STATE_TERMINATED

static final int STATE_TERMINATED
See Also:
Constant Field Values
Method Detail

getTid

String getTid()
Get the transaction identifier.

Returns:
String The unique id.

getState

int getState()
Get the transaction's state.

Returns:
int The state, one of the predefined states. NOTE: the state is an int rather than the generic Object, because instances need to be Serializable.

getTags

HeuristicMessage[] getTags()
Get the high-level heuristic comments. This is what remote clients will see as well.

Returns:
HeuristicMessage The comments giving a summary of the tasks done in this transaction.

getHeuristicMessages

HeuristicMessage[] getHeuristicMessages()
Get the HeuristicMessage detailed info for this transaction.

Returns:
HeuristicMessage[] The detailed heuristic messages. These show the comments for EACH individual resource that was part of the transaction.

getHeuristicMessages

HeuristicMessage[] getHeuristicMessages(int state)
Get the heuristic messages for work in the given state. This method is useful in particular for STATE_HEUR_MIXED and STATE_HEUR_HAZARD.

Returns:
HeuristicMessage[] The description of all work in the given state, or null if no such work exists.

wasCommitted

boolean wasCommitted()
Test if the transaction's 2PC outcome was commit. Needed especially for the heuristic states, if the desired outcome (instead of the actual state) needs to be retrieved. For instance, if the state is STATE_HEUR_HAZARD then extra information is needed for determining if the desired outcome was commit or rollback. This method helps here.

Returns:
boolean True iff commit decided (either heuristically or by the super coordinator).

forceCommit

void forceCommit()
                 throws HeurRollbackException,
                        HeurHazardException,
                        HeurMixedException,
                        SysException
Force commit of the transaction.

Throws:
HeurRollbackException - If rolled back in the meantime.
HeurMixedException - If part of it was rolled back.
HeurHazardException - On possible conflicts.
SysException - Unexpected failure.

forceRollback

void forceRollback()
                   throws HeurCommitException,
                          HeurMixedException,
                          HeurHazardException,
                          SysException
Force rollback of the transaction.

Throws:
HeurCommitException - If heuristically committed in the meantime.
HeurHazardException - If the state is not certain.
HeurMixedException - If partially rolled back.
SysException - Unexpected failure.

forceForget

void forceForget()
Force the system to forget about the transaction.



Copyright © 2011. All Rights Reserved.