Class 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 Detail

      • TransactionalMethodInterceptor

        public TransactionalMethodInterceptor()
    • 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:
        invoke in interface org.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