public class TXPCoordinatorImpl extends Object implements ITXPCoordinator
ITXPCoordinator
implementationConstructor and Description |
---|
TXPCoordinatorImpl()
Constructs a
TXPCoordinatorImpl instance with the default
policy |
TXPCoordinatorImpl(ITXPPolicy policy)
Constructs a
TXPCoordinatorImpl instance with the specified
policy |
Modifier and Type | Method and 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.
|
ITXPCoordinator |
getCoordinator()
Returns the coordinator
|
ITXProcess |
newProcess()
Creates a new implementation specific
ITXProcess instance 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.
|
public TXPCoordinatorImpl()
TXPCoordinatorImpl
instance with the default
policypublic TXPCoordinatorImpl(ITXPPolicy policy)
TXPCoordinatorImpl
instance with the specified
policypolicy
- the policy to usepublic void setLogger(ITXPLogger logger)
logger
- The new logger instance.public ITXProcess newProcess()
ITXPCoordinator
ITXProcess
instance and
sets itself as coordinator.newProcess
in interface ITXPCoordinator
ITXProcess
instancepublic void ready(ITXProcess process, ITXPNode node, ITXPNode.State nodeState)
ITXPCoordinator
ready
in interface ITXPCoordinator
process
- the processnode
- the nodenodeState
- the current state of the nodepublic void commit(ITXProcess process) throws TXPException
ITXPCoordinator
commit
in interface ITXPCoordinator
process
- the processTXPException
- a coordinator and policy dependent exception (today 1 of 3, more
details later)public void rollback(ITXProcess process) throws TXPException
ITXPCoordinator
rollback
in interface ITXPCoordinator
process
- the processTXPException
- a coordinator and policy dependent exception (today 1 of 3, more
details later)public void addMonitor(ITXPMonitor monitor)
ITXPCoordinator
addMonitor
in interface ITXPCoordinator
monitor
- the monitorpublic void removeMonitor(ITXPMonitor monitor)
ITXPCoordinator
removeMonitor
in interface ITXPCoordinator
monitor
- The monitor.public ITXPCoordinator getCoordinator()
ITXPMonitor
getCoordinator
in interface ITXPMonitor
public void onMonitorAdded(ITXPMonitor monitor)
ITXPMonitor
onMonitorAdded
in interface ITXPMonitor
monitor
- the monitor that got addedpublic void onMonitorRemoved(ITXPMonitor monitor)
ITXPMonitor
onMonitorRemoved
in interface ITXPMonitor
monitor
- the monitor that got removedpublic void onBeganProcess(ITXProcess process)
ITXPMonitor
onBeganProcess
in interface ITXPMonitor
process
- the processpublic void onNodeAssociated(ITXProcess process, ITXPNode node, ITXPNode.State returnedState)
ITXPMonitor
onNodeAssociated
in interface ITXPMonitor
process
- the processnode
- the nodereturnedState
- the returned node statepublic void onNodeDisassociated(ITXProcess process, ITXPNode node)
ITXPMonitor
onNodeDisassociated
in interface ITXPMonitor
process
- the processnode
- the nodepublic void onNodeReady(ITXProcess process, ITXPNode node, ITXPNode.State returnedState)
ITXPMonitor
onNodeReady
in interface ITXPMonitor
process
- the processnode
- the nodereturnedState
- the node state after attempting to do the workpublic void onNodeTimeoutSignaled(ITXProcess process, ITXPNode node)
ITXPMonitor
onNodeTimeoutSignaled
in interface ITXPMonitor
process
- the processnode
- the nodepublic void onProcessTimeoutSignaled(ITXProcess process)
ITXPMonitor
onProcessTimeoutSignaled
in interface ITXPMonitor
process
- the processpublic void onCommitInitiated(ITXProcess process)
ITXPMonitor
onCommitInitiated
in interface ITXPMonitor
process
- the processpublic void onCommitCanceled(ITXProcess process, TXPException reason)
ITXPMonitor
onCommitCanceled
in interface ITXPMonitor
process
- the processreason
- the exception thrown by the commitpublic void onRollbackInitiated(ITXProcess process)
ITXPMonitor
onRollbackInitiated
in interface ITXPMonitor
process
- the processpublic void onRollbackCanceled(ITXProcess process, TXPException reason)
ITXPMonitor
onRollbackCanceled
in interface ITXPMonitor
process
- the processreason
- the exception thrown by the rollbackpublic void onNodeReadyFailedPolicyAction(ITXProcess process, ITXPNode node, ITXPPolicy.Action action)
ITXPMonitor
onNodeReadyFailedPolicyAction
in interface ITXPMonitor
process
- the processnode
- the nodeaction
- the policy actionpublic void onNodeCommitFailedPolicyAction(ITXProcess process, ITXPNode node, ITXPPolicy.Action action)
ITXPMonitor
onNodeCommitFailedPolicyAction
in interface ITXPMonitor
process
- the processnode
- the nodeaction
- the actionpublic void onNodeRollbackFailedPolicyAction(ITXProcess process, ITXPNode node, ITXPPolicy.Action action)
ITXPMonitor
onNodeRollbackFailedPolicyAction
in interface ITXPMonitor
process
- the processnode
- the nodeaction
- the actionpublic void onNodeTimeoutSignaledPolicyAction(ITXProcess process, ITXPNode node, ITXPPolicy.Action action)
ITXPMonitor
onNodeTimeoutSignaledPolicyAction
in interface ITXPMonitor
process
- the processnode
- the nodeaction
- the actionpublic void onProcessTimeoutSignaledPolicyAction(ITXProcess process, ITXPPolicy.Action action)
ITXPMonitor
onProcessTimeoutSignaledPolicyAction
in interface ITXPMonitor
process
- the processaction
- the actionpublic void onProcessCreated(ITXProcess process)
ITXPMonitor
onProcessCreated
in interface ITXPMonitor
process
- The process.public void onProcessCompleted(ITXProcess process)
ITXPMonitor
onProcessCompleted
in interface ITXPMonitor
process
- The process.iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.