Announcement Announcement Module
Collapse
No announcement yet.
Problem in intercepting target class interface using JDK Proxy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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>
Working...
X