Package com.iizix.txp
Interface ITXPCoordinator
- All Superinterfaces:
ITXPMonitor
- All Known Implementing Classes:
TXPCoordinatorImpl
public interface ITXPCoordinator extends ITXPMonitor
TheITXPCoordinatorinterface.- Author:
- Freggle
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMonitor(ITXPMonitor monitor)Adds the specified TXP monitor.voidcommit(ITXProcess process)Called by the process to signal that the process logic/application requests a commit.ITXProcessnewProcess()Creates a new implementation specificITXProcessinstance and sets itself as coordinator.voidready(ITXProcess process, ITXPNode node, ITXPNode.State nodeState)Called by the process to signal that a node is ready for completion.voidremoveMonitor(ITXPMonitor monitor)Removes the specified TXP monitor.voidrollback(ITXProcess process)Called by the process to signal that the process logic/application requests a rollback.Methods inherited from interface com.iizix.txp.ITXPMonitor
getCoordinator, onBeganProcess, onCommitCanceled, onCommitInitiated, onMonitorAdded, onMonitorRemoved, onNodeAssociated, onNodeCommitFailedPolicyAction, onNodeDisassociated, onNodeReady, onNodeReadyFailedPolicyAction, onNodeRollbackFailedPolicyAction, onNodeTimeoutSignaled, onNodeTimeoutSignaledPolicyAction, onProcessCompleted, onProcessCreated, onProcessTimeoutSignaled, onProcessTimeoutSignaledPolicyAction, onRollbackCanceled, onRollbackInitiated
Method Detail
newProcess
ITXProcess newProcess()
Creates a new implementation specificITXProcessinstance and sets itself as coordinator.- Returns:
- an
ITXProcessinstance
ready
void ready(ITXProcess process, ITXPNode node, ITXPNode.State nodeState)
Called by the process to signal that a node is ready for completion. Typically the coordinator handles error states that may occur using a policy.- Parameters:
process- the processnode- the nodenodeState- the current state of the node
commit
void commit(ITXProcess process) throws TXPException
Called by the process to signal that the process logic/application requests a commit. Typically the coordinator coordinates the commit and handles error states that may occur using a policy.- Parameters:
process- the process- Throws:
TXPException- a coordinator and policy dependent exception (today 1 of 3, more details later)
rollback
void rollback(ITXProcess process) throws TXPException
Called by the process to signal that the process logic/application requests a rollback. Typically the coordinator coordinates the commit and handles error states that may occur using a policy.- Parameters:
process- the process- Throws:
TXPException- a coordinator and policy dependent exception (today 1 of 3, more details later)
addMonitor
void addMonitor(ITXPMonitor monitor)
Adds the specified TXP monitor. Monitors can be used for logging and monitoring processes under this coordinator's control.- Parameters:
monitor- the monitor
removeMonitor
void removeMonitor(ITXPMonitor monitor)
Removes the specified TXP monitor.- Parameters:
monitor- The monitor.