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 interposition 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()
          Get the coordinator for this tx.
 String getCoordinatorId()
          Get the identifier for this coordinator.
 RecoveryCoordinator getRecoveryCoordinator()
          Get the recovery coordinator instance for this one.
 HeuristicMessage[] getTags()
          Get the tags that were set for this coordinator.
 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
Description copied from interface: CompositeTransaction
Get the coordinator for this tx.

Specified by:
getCompositeCoordinator in interface CompositeTransaction
Overrides:
getCompositeCoordinator in class AbstractCompositeTransaction
Returns:
CompositeCoordinator The composite coordinator instance.
Throws:
SysException - On failure.
See Also:
CompositeCoordinator.

getCoordinatorId

public String getCoordinatorId()
Description copied from interface: CompositeCoordinator
Get the identifier for this coordinator.

Specified by:
getCoordinatorId in interface CompositeCoordinator
Returns:
String The coordinator id. 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()
Description copied from interface: CompositeCoordinator
Get the tags that were set for this coordinator.

Specified by:
getTags in interface CompositeCoordinator
Returns:
HeuristicMessage[] The tags set. 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()
Description copied from interface: CompositeCoordinator
Get the recovery coordinator instance for this one.

Specified by:
getRecoveryCoordinator in interface CompositeCoordinator
Returns:
RecoveryCoordinator The recovery coordinator.
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 iff recoverable in active state. Null if this information is not available (for imported instances). By default, this is false.

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.
NOTE: active recoverability is inherited by any subtransactions that are created afterwards.

Specified by:
setRecoverableWhileActive in interface CompositeCoordinator


Copyright © 2011. All Rights Reserved.