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

com.github.datalking.aop.framework.adapter.MethodBeforeAdviceAdapter Maven / Gradle / Ivy

The newest version!
package com.github.datalking.aop.framework.adapter;

import com.github.datalking.aop.Advisor;
import com.github.datalking.aop.MethodBeforeAdvice;
import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.MethodInterceptor;

import java.io.Serializable;

/**
 * @author yaoo on 4/19/18
 */
public class MethodBeforeAdviceAdapter implements AdvisorAdapter, Serializable {

    @Override
    public boolean supportsAdvice(Advice advice) {
        return (advice instanceof MethodBeforeAdvice);
    }

    @Override
    public MethodInterceptor getInterceptor(Advisor advisor) {
        MethodBeforeAdvice advice = (MethodBeforeAdvice) advisor.getAdvice();
        return new MethodBeforeAdviceInterceptor(advice);
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy