zoukankan      html  css  js  c++  java
  • Spring 创建 JDK- and CGLIB-based proxies的区别

    几条原则:

    1.  If the class of a target object that is to be proxied (hereafter simply referred to as the target class) doesn't implement any interfaces, then a CGLIB-based proxy will be created.【原因是:This is the easiest scenario, because JDK proxies are interface based, and no interfaces means JDK proxying isn't even possible. 
    2. If the proxyTargetClass property of the ProxyFactoryBean has been set to true, then a CGLIB-based proxy will be created. 【无视ProxyFactoryBean的属性proxyInterfaces是否有设置成为某一个或多个接口名
    3. If the proxyInterfaces property of the ProxyFactoryBean has been set to one or more fully qualified interface names, then a JDK-based proxy will be created.
    4. If the proxyInterfaces property of the ProxyFactoryBean has not been set but the target class does implement one (or more) interfaces, then the ProxyFactoryBean will auto-detect the fact that the target class does actually implement at least one interface, and a JDK-based proxy will be created, or a CGLIB-based proxy will be created.【如果是JDK代理这一条和第三条行为一致】



  • 相关阅读:
    ubuntu 1510
    创业者的困境
    创业者的窘境
    (转)Ubuntu 16.04下搭建Web服务器(MySQL+PHP+Apache)
    ESP8266的smartconfig过程(使用esptouch)
    Virtualbox下ubuntu识别USB设备
    红外人体检测
    树莓派跑讯飞语音识别(2麦阵列)
    R16平台中断
    语音识别下的智能家居
  • 原文地址:https://www.cnblogs.com/bbsno1/p/3260256.html
Copyright © 2011-2022 走看看