public class DefaultCompensatingTransactionOperationManager extends Object implements CompensatingTransactionOperationManager
CompensatingTransactionOperationManager.
Manages a stack of CompensatingTransactionOperationExecutor objects
and performs rollback of these in the reverse order.| Constructor and Description |
|---|
DefaultCompensatingTransactionOperationManager(CompensatingTransactionOperationFactory operationFactory)
Set the
CompensatingTransactionOperationFactory to use. |
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commit all recorded operations.
|
protected Stack<CompensatingTransactionOperationExecutor> |
getOperationExecutors()
Get the rollback operations.
|
void |
performOperation(Object resource,
String operation,
Object[] args)
Indicates that the supplied operation (method name) is to be performed.
|
void |
rollback()
Rollback all recorded operations by performing each of the recorded
rollback operations.
|
public DefaultCompensatingTransactionOperationManager(CompensatingTransactionOperationFactory operationFactory)
CompensatingTransactionOperationFactory to use.operationFactory - the CompensatingTransactionOperationFactory.public void performOperation(Object resource, String operation, Object[] args)
CompensatingTransactionOperationManagerperformOperation in interface CompensatingTransactionOperationManagerresource - the target resource to perform the operation on.operation - The method to be invoked.args - Arguments supplied to the method.public void rollback()
CompensatingTransactionOperationManagerrollback in interface CompensatingTransactionOperationManagerprotected Stack<CompensatingTransactionOperationExecutor> getOperationExecutors()
public void commit()
CompensatingTransactionOperationManagercommit in interface CompensatingTransactionOperationManager