aop部分代码精简
This commit is contained in:
@@ -53,17 +53,13 @@ public class Aop {
|
||||
* @return
|
||||
*/
|
||||
private static ProxyFactory getProxyFactory(Class<?> clazz) {
|
||||
switch (proxyStrategy) {
|
||||
case AUTO: {
|
||||
if (ClassUtil.isInterface(clazz)) {
|
||||
return Proxy.getProxyFactory(ProxyStrategy.JDK_DYNAMIC_PROXY);
|
||||
}
|
||||
return Proxy.getProxyFactory(ProxyStrategy.ASGC_PROXY);
|
||||
if (proxyStrategy == ProxyStrategy.AUTO) {
|
||||
if (ClassUtil.isInterface(clazz)) {
|
||||
return Proxy.getProxyFactory(ProxyStrategy.JDK_DYNAMIC_PROXY);
|
||||
}
|
||||
case ASGC_PROXY: return Proxy.getProxyFactory(ProxyStrategy.ASGC_PROXY);
|
||||
case JDK_DYNAMIC_PROXY: Proxy.getProxyFactory(ProxyStrategy.JDK_DYNAMIC_PROXY);
|
||||
return Proxy.getProxyFactory(ProxyStrategy.ASGC_PROXY);
|
||||
}
|
||||
return null;
|
||||
return Proxy.getProxyFactory(proxyStrategy);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@SuppressWarnings("all")
|
||||
public enum ProxyStrategy {
|
||||
// 在该模式下,代理策略由框架根据一定策略自动选择
|
||||
AUTO(0, "自动选择"),
|
||||
|
||||
Reference in New Issue
Block a user