-
Dec 29th, 2011, 06:36 AM
#1
Problem in intercepting target class interface using JDK Proxy
Hi Team,
I want to apply the interceptor for target class interface method. While debugging my
methodEventAspect using MethodInterceptor, i am unable to get this target class,
interface methods in methodInvocation.getMethod().getDeclaringClass().g etName();
INTERFACE
public interface ExampleService{
public void getTest();
}
TARGET CLASS IMPLEMENTS INTERFACE
public class Example extends implements ExampleService {
public void getTest(){
System.out.println("Intercepting interface using JDKProxy");
}
}
APPLICATIONCONTEXT.xml
<bean id="example " class="test.Example ">
</bean>
<bean id="methodEventAspect"
class="com.telenor.nettforhandler.integration.comm on.MethodEventAspect" />
<bean id="methodEventAdvisor"
class="org.springframework.aop.support.RegexpMetho dPointcutAdvisor">
<property name="advice" ref="methodEventAspect" />
<property name="pattern" value=".*" />
</bean>
<bean id="exampleService" class="org.springframework.aop.framework.ProxyFact oryBean">
<property name="target" ref="example" />
<property name="interceptorNames">
<list>
<value>methodEventAdvisor</value>
</list>
</property>
</bean>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules