Package network.oxalis.persistence.aop
Class TransactionalMethodInterceptor
- java.lang.Object
-
- network.oxalis.persistence.aop.TransactionalMethodInterceptor
-
- All Implemented Interfaces:
org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor
public class TransactionalMethodInterceptor extends Object implements org.aopalliance.intercept.MethodInterceptor
Looks for all @Transactional annotations and injects code for starting and stopping transactions.User: andy Date: 8/13/12 Time: 2:19 PM
-
-
Constructor Summary
Constructors Constructor Description TransactionalMethodInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectinvoke(org.aopalliance.intercept.MethodInvocation invocation)Starts a jdbc transaction if a transaction doesnt already exist.
-
-
-
Method Detail
-
invoke
public Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
Starts a jdbc transaction if a transaction doesnt already exist. Joins the transaction if one exists.- Specified by:
invokein interfaceorg.aopalliance.intercept.MethodInterceptor- Parameters:
invocation- the method invocation joinpoint- Returns:
- the result of the call to
Joinpoint.proceed(), might be intercepted by the interceptor. - Throws:
Throwable- if the interceptors or the target-object throws an exception. IllegalStateException if there already exists a connection which is not transactional
-
-