Package com.iizix.txp
Interface ITXPCoordinator
- All Superinterfaces:
ITXPMonitor
- All Known Implementing Classes:
TXPCoordinatorImpl
public interface ITXPCoordinator extends ITXPMonitor
TheITXPCoordinator
interface.- Author:
- Freggle
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMonitor(ITXPMonitor monitor)
Adds the specified TXP monitor.void
commit(ITXProcess process)
Called by the process to signal that the process logic/application requests a commit.ITXProcess
newProcess()
Creates a new implementation specificITXProcess
instance and sets itself as coordinator.void
ready(ITXProcess process, ITXPNode node, ITXPNode.State nodeState)
Called by the process to signal that a node is ready for completion.void
removeMonitor(ITXPMonitor monitor)
Removes the specified TXP monitor.void
rollback(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 specificITXProcess
instance and sets itself as coordinator.- Returns:
- an
ITXProcess
instance
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.