All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.n3r.eql.trans.spring.EqlTransactionAdvisor Maven / Gradle / Ivy

There is a newer version: 0.1.19
Show newest version
package org.n3r.eql.trans.spring;

import org.aopalliance.aop.Advice;
import org.n3r.eql.trans.spring.annotation.EqlTransactional;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.AbstractPointcutAdvisor;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.beans.factory.annotation.Autowired;

import java.lang.reflect.Method;

public class EqlTransactionAdvisor extends AbstractPointcutAdvisor {
    final StaticMethodMatcherPointcut pointcut = new StaticMethodMatcherPointcut() {

        @Override
        public boolean matches(Method method, Class targetClass) {
            return method.isAnnotationPresent(EqlTransactional.class);
        }
    };

    @Autowired EqlTransactionInterceptor interceptor;

    @Override
    public Pointcut getPointcut() {
        return this.pointcut;
    }

    @Override
    public Advice getAdvice() {
        return this.interceptor;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy