package jnpf.elnController;
|
|
import jnpf.database.util.NotTenantPluginHolder;
|
import jnpf.database.util.TenantDataSourceUtil;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.annotation.Around;
|
import org.aspectj.lang.annotation.Aspect;
|
import org.springframework.core.annotation.Order;
|
import org.springframework.stereotype.Component;
|
|
@Aspect
|
@Component
|
@Order(1)
|
public class ElnNoDataSourceBindAspect {
|
|
@Around("execution(public * jnpf.elnController..*(..))"
|
+ " && (@within(jnpf.util.NoDataSourceBind)"
|
+ " || @annotation(jnpf.util.NoDataSourceBind))")
|
public Object withoutDataSourceBinding(ProceedingJoinPoint joinPoint) throws Throwable {
|
try {
|
NotTenantPluginHolder.setNotSwitchAlwaysFlag();
|
TenantDataSourceUtil.clearLocalTenantInfo();
|
return joinPoint.proceed();
|
} finally {
|
NotTenantPluginHolder.clearNotSwitchAlwaysFlag();
|
}
|
}
|
}
|