public class DefaultCompensatingTransactionOperationManager extends java.lang.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 java.util.Stack |
getOperationExecutors()
Get the rollback operations.
|
void |
performOperation(java.lang.Object resource,
java.lang.String operation,
java.lang.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(java.lang.Object resource, java.lang.String operation, java.lang.Object[] args)
CompensatingTransactionOperationManager
performOperation
in interface CompensatingTransactionOperationManager
resource
- the target resource to perform the operation on.operation
- The method to be invoked.args
- Arguments supplied to the method.public void rollback()
CompensatingTransactionOperationManager
rollback
in interface CompensatingTransactionOperationManager
protected java.util.Stack getOperationExecutors()
public void commit()
CompensatingTransactionOperationManager
commit
in interface CompensatingTransactionOperationManager