2011-05-24 149 views
1

在使用AopAlliance進行方法攔截時,是否有方法從方法被攔截的類調用方法?AopAlliance(Guice):從截獲的方法中調用另一種方法

例如:

public class MyClass { 
    public void interceptMe() {} 
    public void invokeMe() {} 
} 

public class MyInterceptor implements MethodInterceptor { 
    public Object invoke(MethodInvocation invocation) throws Throwable { 
      // This is where MyClass.interceptMe() is intercepted 
      // I would like to call MyClass.invokeMe() for the instance of the class who's method was intercepted 
    } 
} 

,我會很高興,如果需要提供更多的細節。

回答