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

com.feingto.cloud.config.datasource.dynamic.adapter.DataSourceMethodMatcherPointcutAdvisor Maven / Gradle / Ivy

The newest version!
package com.feingto.cloud.config.datasource.dynamic.adapter;

import com.feingto.cloud.config.datasource.dynamic.DataSource;
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
import org.springframework.lang.NonNull;

import java.lang.reflect.Method;

/**
 * 动态数据源切换切入点代理
 *
 * @author longfei
 */
public class DataSourceMethodMatcherPointcutAdvisor extends StaticMethodMatcherPointcutAdvisor {
    private static final long serialVersionUID = -6212402488398549960L;

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy