public class CompensatableActionImpl extends Object implements CompensatableAction
| Constructor and Description |
|---|
CompensatableActionImpl() |
| Modifier and Type | Method and Description |
|---|---|
CompensatableAction |
addWork(CompensatableWork compensatableWork,
CompensationHandler compensationHandler)
Add a piece of work to the action with a compensation handler.
|
CompensatableAction |
addWork(CompensatableWork compensatableWork,
CompensationHandler compensationHandler,
ConfirmationHandler confirmationHandler)
Add a piece of work to the action with a compensation and a confirmation handlers.
|
CompensatableAction |
addWork(CompensatableWork compensatableWork,
ConfirmationHandler confirmationHandler)
Add a piece of work to the action with a confirmation handler.
|
void |
execute()
Execute all registered work pieces one by one.
|
public CompensatableAction addWork(CompensatableWork compensatableWork, CompensationHandler compensationHandler)
CompensatableActionaddWork in interface CompensatableActioncompensatableWork - Work that needs to be executed atomically.compensationHandler - Handler which needs to be invoked in case of failure to undo the work.public CompensatableAction addWork(CompensatableWork compensatableWork, ConfirmationHandler confirmationHandler)
CompensatableActionaddWork in interface CompensatableActioncompensatableWork - Work that needs to be executed atomically.confirmationHandler - Handler which needs to be invoked if action is completed successfully.public CompensatableAction addWork(CompensatableWork compensatableWork, CompensationHandler compensationHandler, ConfirmationHandler confirmationHandler)
CompensatableActionaddWork in interface CompensatableActioncompensatableWork - Work that needs to be executed atomically.compensationHandler - Handler which needs to be invoked in case of failure to undo the work.confirmationHandler - Handler which needs to be invoked if action is completed successfully.public void execute()
throws EnlistException
CompensatableActionexecute in interface CompensatableActionEnlistException - Is thrown if action fails to register any handler with the transaction.Copyright © 2022 JBoss by Red Hat. All rights reserved.