尝试这个:
if(AopUtils.isAopProxy(a) && a instanceof Advised) { Object target = ((Advised)a).getTargetSource().getTarget(); AImpl ai = (AImpl)target;}奖励:在Scala中,我出于相同的目的使用以下等效函数:
def unwrapProxy(a: AnyRef) = a match { case advised: Advised if(AopUtils.isAopProxy(advised)) => advised.getTargetSource.getTarget case notProxy => notProxy}


