Package com.iizix.txp.impl
Class TXPCoordinatorImpl
java.lang.Object
com.iizix.txp.impl.TXPCoordinatorImpl
- All Implemented Interfaces:
- ITXPCoordinator,- ITXPMonitor
Basic and crude (for now) 
ITXPCoordinator implementation- Author:
- Freggle
- Constructor SummaryConstructorsConstructorDescriptionConstructs a- TXPCoordinatorImplinstance with the default policy- TXPCoordinatorImpl- (ITXPPolicy policy) Constructs a- TXPCoordinatorImplinstance with the specified policy
- Method SummaryModifier and TypeMethodDescription- 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.Returns the coordinatorCreates a new implementation specific- ITXProcessinstance and sets itself as coordinator.- void- onBeganProcess- (ITXProcess process) Called when a process created and associated with he controller- void- onCommitCanceled- (ITXProcess process, TXPException reason) Called when the process aborts committing.- void- onCommitInitiated- (ITXProcess process) Called when a process is called to attempt a commit- void- onMonitorAdded- (ITXPMonitor monitor) Called when a monitor is added to the coordinator's monitor chain- void- onMonitorRemoved- (ITXPMonitor monitor) Called when a monitor is removed from the coordinator's monitor chain- void- onNodeAssociated- (ITXProcess process, ITXPNode node, ITXPNode.State returnedState) Called when a node is associated with a process- void- onNodeCommitFailedPolicyAction- (ITXProcess process, ITXPNode node, ITXPPolicy.Action action) Called when the policy action is determined for a node that failed to commit- void- onNodeDisassociated- (ITXProcess process, ITXPNode node) Called when a node is disassociated from a process- void- onNodeReady- (ITXProcess process, ITXPNode node, ITXPNode.State returnedState) Called when a node has finished doing the work needed- void- onNodeReadyFailedPolicyAction- (ITXProcess process, ITXPNode node, ITXPPolicy.Action action) Called when the policy action is determined for a node that failed processing- void- onNodeRollbackFailedPolicyAction- (ITXProcess process, ITXPNode node, ITXPPolicy.Action action) Called when the policy action is determined for a node that failed to rollback- void- onNodeTimeoutSignaled- (ITXProcess process, ITXPNode node) Called when a node indicates it timed out waiting on the process.- void- onNodeTimeoutSignaledPolicyAction- (ITXProcess process, ITXPNode node, ITXPPolicy.Action action) Called when the policy action is determined for a node that timed out waiting for completion.- void- onProcessCompleted- (ITXProcess process) Called when a process has been completed (either committed or rolled back)- void- onProcessCreated- (ITXProcess process) Called when the process is created.- void- onProcessTimeoutSignaled- (ITXProcess process) Called when a process indicates it timed out waiting on the nodes- void- onProcessTimeoutSignaledPolicyAction- (ITXProcess process, ITXPPolicy.Action action) Called when the policy action is determined for a process that timed out waiting for the nodes to do the work.- void- onRollbackCanceled- (ITXProcess process, TXPException reason) Called when the process aborts rolling back.- void- onRollbackInitiated- (ITXProcess process) Called when a process is called to attempt a rollback- 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.- void- setLogger- (ITXPLogger logger) Sets the logger.
- Constructor Details- TXPCoordinatorImplpublic TXPCoordinatorImpl()Constructs a- TXPCoordinatorImplinstance with the default policy
- TXPCoordinatorImplConstructs a- TXPCoordinatorImplinstance with the specified policy- Parameters:
- policy- the policy to use
 
 
- Method Details- setLoggerSets the logger.- Parameters:
- logger- The new logger instance.
 
- newProcessDescription copied from interface:- ITXPCoordinatorCreates a new implementation specific- ITXProcessinstance and sets itself as coordinator.- Specified by:
- newProcessin interface- ITXPCoordinator
- Returns:
- an ITXProcessinstance
 
- readyDescription copied from interface:- ITXPCoordinatorCalled by the process to signal that a node is ready for completion. Typically the coordinator handles error states that may occur using a policy.- Specified by:
- readyin interface- ITXPCoordinator
- Parameters:
- process- the process
- node- the node
- nodeState- the current state of the node
 
- commitDescription copied from interface:- ITXPCoordinatorCalled 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.- Specified by:
- commitin interface- ITXPCoordinator
- Parameters:
- process- the process
- Throws:
- TXPException- a coordinator and policy dependent exception (today 1 of 3, more details later)
 
- rollbackDescription copied from interface:- ITXPCoordinatorCalled 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.- Specified by:
- rollbackin interface- ITXPCoordinator
- Parameters:
- process- the process
- Throws:
- TXPException- a coordinator and policy dependent exception (today 1 of 3, more details later)
 
- addMonitorDescription copied from interface:- ITXPCoordinatorAdds the specified TXP monitor. Monitors can be used for logging and monitoring processes under this coordinator's control.- Specified by:
- addMonitorin interface- ITXPCoordinator
- Parameters:
- monitor- the monitor
 
- removeMonitorDescription copied from interface:- ITXPCoordinatorRemoves the specified TXP monitor.- Specified by:
- removeMonitorin interface- ITXPCoordinator
- Parameters:
- monitor- The monitor.
 
- getCoordinatorDescription copied from interface:- ITXPMonitorReturns the coordinator- Specified by:
- getCoordinatorin interface- ITXPMonitor
- Returns:
- the coordinator
 
- onMonitorAddedDescription copied from interface:- ITXPMonitorCalled when a monitor is added to the coordinator's monitor chain- Specified by:
- onMonitorAddedin interface- ITXPMonitor
- Parameters:
- monitor- the monitor that got added
 
- onMonitorRemovedDescription copied from interface:- ITXPMonitorCalled when a monitor is removed from the coordinator's monitor chain- Specified by:
- onMonitorRemovedin interface- ITXPMonitor
- Parameters:
- monitor- the monitor that got removed
 
- onBeganProcessDescription copied from interface:- ITXPMonitorCalled when a process created and associated with he controller- Specified by:
- onBeganProcessin interface- ITXPMonitor
- Parameters:
- process- the process
 
- onNodeAssociatedDescription copied from interface:- ITXPMonitorCalled when a node is associated with a process- Specified by:
- onNodeAssociatedin interface- ITXPMonitor
- Parameters:
- process- the process
- node- the node
- returnedState- the returned node state
 
- onNodeDisassociatedDescription copied from interface:- ITXPMonitorCalled when a node is disassociated from a process- Specified by:
- onNodeDisassociatedin interface- ITXPMonitor
- Parameters:
- process- the process
- node- the node
 
- onNodeReadyDescription copied from interface:- ITXPMonitorCalled when a node has finished doing the work needed- Specified by:
- onNodeReadyin interface- ITXPMonitor
- Parameters:
- process- the process
- node- the node
- returnedState- the node state after attempting to do the work
 
- onNodeTimeoutSignaledDescription copied from interface:- ITXPMonitorCalled when a node indicates it timed out waiting on the process.- Specified by:
- onNodeTimeoutSignaledin interface- ITXPMonitor
- Parameters:
- process- the process
- node- the node
 
- onProcessTimeoutSignaledDescription copied from interface:- ITXPMonitorCalled when a process indicates it timed out waiting on the nodes- Specified by:
- onProcessTimeoutSignaledin interface- ITXPMonitor
- Parameters:
- process- the process
 
- onCommitInitiatedDescription copied from interface:- ITXPMonitorCalled when a process is called to attempt a commit- Specified by:
- onCommitInitiatedin interface- ITXPMonitor
- Parameters:
- process- the process
 
- onCommitCanceledDescription copied from interface:- ITXPMonitorCalled when the process aborts committing. This can happen if a rollback is requested or one or more nodes have not yet finished processing.- Specified by:
- onCommitCanceledin interface- ITXPMonitor
- Parameters:
- process- the process
- reason- the exception thrown by the commit
 
- onRollbackInitiatedDescription copied from interface:- ITXPMonitorCalled when a process is called to attempt a rollback- Specified by:
- onRollbackInitiatedin interface- ITXPMonitor
- Parameters:
- process- the process
 
- onRollbackCanceledDescription copied from interface:- ITXPMonitorCalled when the process aborts rolling back. This can happen if one or more nodes have not yet finished processing.- Specified by:
- onRollbackCanceledin interface- ITXPMonitor
- Parameters:
- process- the process
- reason- the exception thrown by the rollback
 
- onNodeReadyFailedPolicyActionpublic void onNodeReadyFailedPolicyAction- (ITXProcess process, ITXPNode node, ITXPPolicy.Action action) Description copied from interface:- ITXPMonitorCalled when the policy action is determined for a node that failed processing- Specified by:
- onNodeReadyFailedPolicyActionin interface- ITXPMonitor
- Parameters:
- process- the process
- node- the node
- action- the policy action
 
- onNodeCommitFailedPolicyActionpublic void onNodeCommitFailedPolicyAction- (ITXProcess process, ITXPNode node, ITXPPolicy.Action action) Description copied from interface:- ITXPMonitorCalled when the policy action is determined for a node that failed to commit- Specified by:
- onNodeCommitFailedPolicyActionin interface- ITXPMonitor
- Parameters:
- process- the process
- node- the node
- action- the action
 
- onNodeRollbackFailedPolicyActionpublic void onNodeRollbackFailedPolicyAction- (ITXProcess process, ITXPNode node, ITXPPolicy.Action action) Description copied from interface:- ITXPMonitorCalled when the policy action is determined for a node that failed to rollback- Specified by:
- onNodeRollbackFailedPolicyActionin interface- ITXPMonitor
- Parameters:
- process- the process
- node- the node
- action- the action
 
- onNodeTimeoutSignaledPolicyActionpublic void onNodeTimeoutSignaledPolicyAction- (ITXProcess process, ITXPNode node, ITXPPolicy.Action action) Description copied from interface:- ITXPMonitorCalled when the policy action is determined for a node that timed out waiting for completion.- Specified by:
- onNodeTimeoutSignaledPolicyActionin interface- ITXPMonitor
- Parameters:
- process- the process
- node- the node
- action- the action
 
- onProcessTimeoutSignaledPolicyActionDescription copied from interface:- ITXPMonitorCalled when the policy action is determined for a process that timed out waiting for the nodes to do the work.- Specified by:
- onProcessTimeoutSignaledPolicyActionin interface- ITXPMonitor
- Parameters:
- process- the process
- action- the action
 
- onProcessCreatedDescription copied from interface:- ITXPMonitorCalled when the process is created.- Specified by:
- onProcessCreatedin interface- ITXPMonitor
- Parameters:
- process- The process.
 
- onProcessCompletedDescription copied from interface:- ITXPMonitorCalled when a process has been completed (either committed or rolled back)- Specified by:
- onProcessCompletedin interface- ITXPMonitor
- Parameters:
- process- The process.