2021
10-29
10-29
如何获得spring代理对象的原对象
获得spring代理对象的原对象看代码吧:@SuppressWarnings({"unchecked"})protected<T>TgetTargetObject(Objectproxy,Class<T>targetClass)throwsException{if(AopUtils.isJdkDynamicProxy(proxy)){return(T)((Advised)proxy).getTargetSource().getTarget();}else{return(T)proxy;//expectedtobecglibproxythen,whichissimplyaspecializedclass}}publicclassAopTargetUtils{/*...
继续阅读 >