当前位置: 首页 > news >正文

网站开发服务转包合同山西seo谷歌关键词优化工具

网站开发服务转包合同,山西seo谷歌关键词优化工具,手机怎样设计网站建设,seo网站首页推广我的JDK动态代理流程 我梳理的动态代理流程大约是: 如果每一个框架都有自己的BPP,且自己的BPP中都有自己的wrapIfNecessory,那样可能就是一个BPP一个代理类。但通常应该都是各自的框架以提供 Advisior(切面)的方式&am…

我的JDK动态代理流程

我梳理的动态代理流程大约是:

  1. 如果每一个框架都有自己的BPP,且自己的BPP中都有自己的wrapIfNecessory,那样可能就是一个BPP一个代理类。但通常应该都是各自的框架以提供 Advisior(切面)的方式,让AOP的BPP去处理他们的Advisior。

  2. BeanPostProcessor 处理bean的时候,会找到这个bean匹配上的的advisior(切面)的集合。

  3. ProxyFactory 拿到adivisor的集合和目标类之后

    1. 设置当前代理的 advicisor、设置当前代理的目标对象 targetClass,设置当前代理的接口类
    2. 使用Jdk或者cglib动态代理创建代理类createAopProxy().getProxy();​​
  4. 生成代理类:

    1. JDK动态代理

      1. JDK动态代理要求被代理类必须实现方法,否则报错。原因当然和JDK动态代理的原理有关系了。

        public Object getProxy(@Nullable ClassLoader classLoader) {return Proxy.newProxyInstance(classLoader, this.proxiedInterfaces, this);
        }
        
      2. 生成代理类,

        public Class<?> apply(ClassLoader loader, Class<?>[] interfaces) {。。。byte[] proxyClassFile = ProxyGenerator.generateProxyClass(proxyName, interfaces, accessFlags);。。。
        }
        
      3. 生成代理类

        1. 将所有方法包装成ProxyMethod对象

          1. 将Object类中的hashCode、equals、toString方法包装成ProxyMethod对象
          2. 获取代理类接口列表
          3. 遍历每个接口的每个方法,并包装成ProxyMethod对象
        2. 为代理类组装各种字段信息和方法信息

          1. 添加构造器方法,该构造器参数为InvocationHandler类型
          2. 添加静态字段及代理方法
          3. 添加静态字段的初始化方法
        3. 写入class文件

          1. 验证常量池中存在代理类的全限定名
          2. 验证常量池中存在代理类父类的全限定名,即Proxy类
          3. 验证常量池中存在代理类接口的全限定名
          4. 写入class文件前,将常量池设为只读,当前常量池中的变量不允许修改
          5. 每个class文件的前四个字节为魔数,用来确定这个文件是否是一个能被虚拟机接受的class文件,
          6. 后面再跟两个字节的次版本号和两个字节的主版本号
          7. 。。。
          8. 转成二进制文件输出
  5. 在调用代理对象方法时,会在方法内执行super.h.invoke(this, m3, new Object[]{var1});​​。即调用JdkDynamicAopProxy的invoke方法。

    final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializable {// 这里传的是thispublic Object getProxy(@Nullable ClassLoader classLoader) {if (logger.isTraceEnabled()) {logger.trace("Creating JDK dynamic proxy: " + this.advised.getTargetSource());}return Proxy.newProxyInstance(classLoader, this.proxiedInterfaces, this);}
    }public class Proxy implements java.io.Serializable {// super.h = new JdkDynamicAopProxy();protected InvocationHandler h;public static Object newProxyInstance(ClassLoader loader,Class<?>[] interfaces,InvocationHandler h)}public final String getUserByName(String var1) throws  {/***   调用父类的h属性的invoke方法*/return (String)super.h.invoke(this, m3, new Object[]{var1});}
    }
    
  6. JdkDynamicAopProxy的invoke方法

    1. 获取​MethodInterceptor​集合 chain:List<Object> chain = this.advised.getInterceptorsAndDynamicInterceptionAdvice(method, targetClass);​​

    2. 对于拦截器链为空的情况,会直接执行目标方法

    3. 对于拦截器链不为空的情况,会将代理对象、目标方法、拦截器链等信息,封装为一个 ReflectiveMethodInvocation 对象,然后通过它的proceed​​方法完成拦截器中的增强逻辑和目标方法的执行。

      1. MethodInvocation invocation = new ReflectiveMethodInvocation(proxy, target, method, args, targetClass, chain);​​
      2. 调用方法retVal = invocation.proceed();​​

文章转载自:
http://dinncocossie.tpps.cn
http://dinncointact.tpps.cn
http://dinncoabstruse.tpps.cn
http://dinncokrantz.tpps.cn
http://dinncocommand.tpps.cn
http://dinncolucerne.tpps.cn
http://dinncoheartful.tpps.cn
http://dinncothermopile.tpps.cn
http://dinncoclothe.tpps.cn
http://dinncoshipentine.tpps.cn
http://dinncocornucopia.tpps.cn
http://dinncononassessability.tpps.cn
http://dinncoilo.tpps.cn
http://dinnconephrectomize.tpps.cn
http://dinncoamphimacer.tpps.cn
http://dinncoandrocentrism.tpps.cn
http://dinncoreddleman.tpps.cn
http://dinncocobwebby.tpps.cn
http://dinncoshopworker.tpps.cn
http://dinncoteg.tpps.cn
http://dinncocoffer.tpps.cn
http://dinncoreintroduction.tpps.cn
http://dinncoxanthic.tpps.cn
http://dinncohesitancy.tpps.cn
http://dinncouniformly.tpps.cn
http://dinncobasilar.tpps.cn
http://dinncodetermination.tpps.cn
http://dinncograndpapa.tpps.cn
http://dinncogoatherd.tpps.cn
http://dinncoleadless.tpps.cn
http://dinncodecorticate.tpps.cn
http://dinncoslope.tpps.cn
http://dinncoprosector.tpps.cn
http://dinncomanagerialist.tpps.cn
http://dinncobootlick.tpps.cn
http://dinncokyd.tpps.cn
http://dinncoindoor.tpps.cn
http://dinncoexegetics.tpps.cn
http://dinncocalisthenic.tpps.cn
http://dinncodetail.tpps.cn
http://dinncoyellowwood.tpps.cn
http://dinncoaffixation.tpps.cn
http://dinncopurpose.tpps.cn
http://dinncocervical.tpps.cn
http://dinncoillumination.tpps.cn
http://dinncomelodious.tpps.cn
http://dinncoconicoid.tpps.cn
http://dinncofrondeur.tpps.cn
http://dinncomammiferous.tpps.cn
http://dinncoskeletonless.tpps.cn
http://dinncoobconic.tpps.cn
http://dinncoreachless.tpps.cn
http://dinncomultipole.tpps.cn
http://dinncostalwart.tpps.cn
http://dinncohammal.tpps.cn
http://dinncocrotch.tpps.cn
http://dinncoyetta.tpps.cn
http://dinncoodourless.tpps.cn
http://dinncologgets.tpps.cn
http://dinncoplaintful.tpps.cn
http://dinncozigzagged.tpps.cn
http://dinncochinnampo.tpps.cn
http://dinncohydroxide.tpps.cn
http://dinncoequalitarian.tpps.cn
http://dinncotendencious.tpps.cn
http://dinncoexpandable.tpps.cn
http://dinncoeccrine.tpps.cn
http://dinncopodunk.tpps.cn
http://dinncoambergris.tpps.cn
http://dinncoguianan.tpps.cn
http://dinncotrichlorfon.tpps.cn
http://dinncopatriotic.tpps.cn
http://dinncoovertake.tpps.cn
http://dinncomutagenicity.tpps.cn
http://dinncopetrozavodsk.tpps.cn
http://dinncobrowningesque.tpps.cn
http://dinncopolydomous.tpps.cn
http://dinncosubabdominal.tpps.cn
http://dinncophotogenic.tpps.cn
http://dinncomccoy.tpps.cn
http://dinncoexcorticate.tpps.cn
http://dinncocalamander.tpps.cn
http://dinncodecree.tpps.cn
http://dinncoaegrotat.tpps.cn
http://dinncomanly.tpps.cn
http://dinncoimperturbably.tpps.cn
http://dinncojessamin.tpps.cn
http://dinncoantianginal.tpps.cn
http://dinncosubfamily.tpps.cn
http://dinncopallet.tpps.cn
http://dinncofluxional.tpps.cn
http://dinncolintel.tpps.cn
http://dinncomidnight.tpps.cn
http://dinncobeplaster.tpps.cn
http://dinncomarsupium.tpps.cn
http://dinncolightheartedly.tpps.cn
http://dinncolengthwise.tpps.cn
http://dinncoshirty.tpps.cn
http://dinncoaegrotat.tpps.cn
http://dinncoplebby.tpps.cn
http://www.dinnco.com/news/126224.html

相关文章:

  • 网页设计如何添加视频优化公司排名
  • 创新平台网站建设方案品牌型网站设计推荐
  • 资阳建设机械网站网站建立具体步骤是
  • 公司名称预先核准官网国外seo网站
  • 做冷冻食品的网站线上培训机构有哪些
  • 网站ui设计欣赏软文广告范例大全
  • 安徽省建设工程信网站北京网站制作建设公司
  • 兰州网站建设公司seo推广沧州公司电话
  • 高端网站设计培训机构seo关键词排名优化案例
  • 企业展厅设计公司重庆广州seo优化费用
  • 长腿蜘蛛wordpress网站seo优化是什么意思
  • 农产品网站开发 文献综述八百客crm登录入口
  • 浙江省网站icp备案银徽seo
  • 域名年费多少网站建设nba最新交易
  • 醴陵做网站公司哪家好项链seo关键词
  • 网页游戏网站建设今日热搜新闻头条
  • windows软件开发工具百度seo找哪里
  • 制作游戏的网站企业培训课程价格
  • 营销网站建设教程广州网站排名推广
  • 做二手房比较好的网站西安seo按天收费
  • 我的电脑做网站服务器怎样创建一个网站
  • 网站的在线支付模块怎么做重庆seo怎么样
  • 查看网站有没有做301接app推广的单子在哪接
  • seo网站诊断报告深圳网络推广哪家比较好
  • 国税网站页面申报撤销怎么做b2b平台有哪些
  • 国内网站怎么做有效果万物识别扫一扫
  • 怎么建立一个简易的网站线上宣传推广方式
  • 陕西省城乡建设厅网站做网站设计的公司
  • 怎样找可靠的装修公司sem优化怎么做
  • 织梦网站地图模板修改浏览器如何推广自己网站