com.atomikos.icatch.imp
Class CompositeTransactionAdaptor

java.lang.Object
  extended by com.atomikos.icatch.imp.AbstractCompositeTransaction
      extended by com.atomikos.icatch.imp.CompositeTransactionAdaptor
All Implemented Interfaces:
Stateful, CompositeCoordinator, CompositeTransaction, Serializable

public class CompositeTransactionAdaptor
extends AbstractCompositeTransaction
implements CompositeCoordinator

A composite transaction adaptor for inter-position on an imported instance. This allows substitution of the recovery coordinator adaptor.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atomikos.icatch.imp.AbstractCompositeTransaction
lineage_, properties_, serial_, tag_, tid_
 
Constructor Summary
CompositeTransactionAdaptor(Stack lineage, String tid, boolean serial, RecoveryCoordinator adaptor, Boolean isRecoverableWhileActive)
          Create a new instance.
CompositeTransactionAdaptor(String root, boolean serial, RecoveryCoordinator adaptor)
          Constructor for testin.
CompositeTransactionAdaptor(String root, boolean serial, RecoveryCoordinator adaptor, Properties properties)
          Constructs a new instance for an imported ROOT.
 
Method Summary
 CompositeCoordinator getCompositeCoordinator()
           
 String getCoordinatorId()
           
 RecoveryCoordinator getRecoveryCoordinator()
           
 HeuristicMessage[] getTags()
           
 Boolean isRecoverableWhileActive()
          Checks whether the instance is recoverable in the active state.
 void setRecoverableWhileActive()
          Sets this coordinator to be recoverable while active.
 
Methods inherited from class com.atomikos.icatch.imp.AbstractCompositeTransaction
addParticipant, addSubTxAwareParticipant, commit, createSubTransaction, equals, getExtent, getLineage, getLocalSubTxCount, getProperties, getProperty, getState, getTid, getTimeout, getTransactionControl, hashCode, isAncestorOf, isDescendantOf, isLocal, isRelatedTransaction, isRoot, isSameTransaction, isSerial, registerSynchronization, rollback, setProperty, setRollbackOnly, setSerial, setTag
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeTransactionAdaptor

public CompositeTransactionAdaptor(Stack lineage,
                                   String tid,
                                   boolean serial,
                                   RecoveryCoordinator adaptor,
                                   Boolean isRecoverableWhileActive)
Create a new instance.

Parameters:
lineage - The parent info, not including the instance being constructed here!
serial - True if serial.
adaptor - The adaptor for replay requests.
isRecoverableWhileActive - Whether recoverable in active state or not. Null if not known.

CompositeTransactionAdaptor

public CompositeTransactionAdaptor(String root,
                                   boolean serial,
                                   RecoveryCoordinator adaptor)
Constructor for testin.

Parameters:
root -
serial -
adaptor -

CompositeTransactionAdaptor

public CompositeTransactionAdaptor(String root,
                                   boolean serial,
                                   RecoveryCoordinator adaptor,
                                   Properties properties)
Constructs a new instance for an imported ROOT. This constructor is needed for message-based propagation where only the root TID is passed.

Parameters:
root - The root URI.
serial - Flag for serial mode.
adaptor - The adaptor for recovery.
Method Detail

getCompositeCoordinator

public CompositeCoordinator getCompositeCoordinator()
                                             throws SysException
Specified by:
getCompositeCoordinator in interface CompositeTransaction
Overrides:
getCompositeCoordinator in class AbstractCompositeTransaction
Returns:
CompositeCoordinator
Throws:
SysException
See Also:
CompositeCoordinator.

getCoordinatorId

public String getCoordinatorId()
Specified by:
getCoordinatorId in interface CompositeCoordinator
Returns:
String The coordinatorId. For imported transactions, this will be the id of the top-level or root transaction. For subtransactions, this will be an independent id.
See Also:
CompositeCoordinator.

getTags

public HeuristicMessage[] getTags()
Specified by:
getTags in interface CompositeCoordinator
Returns:
HeuristicMessage[] Any tags set by the application. These serve as a summary of the local work towards remote client TMs (that way, these do not have to see ALL local heuristic messages, but rather get a relevant summary). The participant proxy for a local coordinator returns these tags as its heuristic messages.
See Also:
CompositeCoordinator.

getRecoveryCoordinator

public RecoveryCoordinator getRecoveryCoordinator()
Specified by:
getRecoveryCoordinator in interface CompositeCoordinator
Returns:
RecoveryCoordinator.
See Also:
CompositeCoordinator.

isRecoverableWhileActive

public Boolean isRecoverableWhileActive()
Description copied from interface: CompositeCoordinator
Checks whether the instance is recoverable in the active state. Although active recoverability requires more logging overhead, some protocols may need this capability.

Specified by:
isRecoverableWhileActive in interface CompositeCoordinator
Returns:
Boolean True if the instance is recoverable in active state, or null if this information is not available (e.g., for imported instances).

setRecoverableWhileActive

public void setRecoverableWhileActive()
Description copied from interface: CompositeCoordinator
Sets this coordinator to be recoverable while active. Ideally, this method is called before any participants are added (otherwise, some participants may have been added and not recovered due to an intermediate crash). This operation may not be unavailable for imported coordinators, but it should always work for locally created (sub)transactions. Calling this method is optional, and it defaults to false.
NOTE: active recoverability is inherited by any subtransactions that are created afterwards.

Specified by:
setRecoverableWhileActive in interface CompositeCoordinator


Copyright © 2012. All Rights Reserved.