Spring學(xué)習(xí)心得(三)
在Around advice 的invoke方法中,對(duì)象MethodInvocation很重要,getArgument()方法可以得到攔截調(diào)用方法的參數(shù),如:methodinvocation.getArgument()[]isAssignableForm可以對(duì)兩個(gè)Class進(jìn)行比較,比如:XXX.class.isAssignableFrom(methodinvocation.getMethod().getDeclaringClass())
在Before advice的public void before(Method m, Object[] args, Object target) throws Throwable {}中可以用以下方法進(jìn)行比較:target instanceof XXX
posted on 2007-09-04 17:27 劉錚 閱讀(169) 評(píng)論(0) 編輯 收藏 所屬分類: Spring