org.qi4j.api.unitofwork.concern
Class UnitOfWorkConcern
java.lang.Object
org.qi4j.api.concern.ConcernOf<java.lang.reflect.InvocationHandler>
org.qi4j.api.concern.GenericConcern
org.qi4j.api.unitofwork.concern.UnitOfWorkConcern
- All Implemented Interfaces:
- java.lang.reflect.InvocationHandler
@AppliesTo(value=UnitOfWorkPropagation.class)
public class UnitOfWorkConcern
- extends GenericConcern
UnitOfWorkConcern
manages the unit of work complete, discard and retry policy.
- See Also:
UnitOfWorkPropagation
,
UnitOfWorkDiscardOn
Method Summary |
protected void |
discardIfRequired(java.lang.reflect.Method aMethod,
UnitOfWork aUnitOfWork,
java.lang.Throwable aThrowable)
Discard unit of work if the discard policy match. |
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Handles method with UnitOfWorkPropagation annotation. |
protected java.lang.Object |
invokeWithCommit(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args,
UnitOfWork currentUnitOfWork)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnitOfWorkConcern
public UnitOfWorkConcern()
invoke
public java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
- Handles method with
UnitOfWorkPropagation
annotation.
- Parameters:
proxy
- The object.method
- The invoked method.args
- The method arguments.
- Returns:
- The returned value of method invocation.
- Throws:
java.lang.Throwable
- Thrown if the method invocation throw exception.
invokeWithCommit
protected java.lang.Object invokeWithCommit(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args,
UnitOfWork currentUnitOfWork)
throws java.lang.Throwable
- Throws:
java.lang.Throwable
discardIfRequired
protected void discardIfRequired(java.lang.reflect.Method aMethod,
UnitOfWork aUnitOfWork,
java.lang.Throwable aThrowable)
- Discard unit of work if the discard policy match.
- Parameters:
aMethod
- The invoked method. This argument must not be null
.aUnitOfWork
- The current unit of work. This argument must not be null
.aThrowable
- The exception thrown. This argument must not be null
.