public class DefaultAopProxyFactory extends Object implements AopProxyFactory, Serializable
AopProxyFactory implementation, creating either a CGLIB proxy
or a JDK dynamic proxy.
Creates a CGLIB proxy if one the following is true for a given
AdvisedSupport instance:
optimize flag is set
proxyTargetClass flag is set
In general, specify proxyTargetClass to enforce a CGLIB proxy,
or specify one or more interfaces to use a JDK dynamic proxy.
ProxyConfig.setOptimize(boolean),
ProxyConfig.setProxyTargetClass(boolean),
AdvisedSupport.setInterfaces(java.lang.Class<?>...),
序列化表格public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException
AopProxyFactoryAopProxy for the given AOP configuration.createAopProxy 在接口中 AopProxyFactoryconfig - 用来为我们指定我们advisor信息
该方法用来创建我们的代理对象
所我们的targetClass对象实现了接口,且 ProxyTargetClass 没有指定强制的走cglib代理,那么就是创建jdk代理
我们代理的类没有实现接口,那么会直接走cglib代理
若我们 ProxyTargetClass 指定为false 且代理类是接口才会走jdk代理 否在我们还是cglib代理AopConfigException