Announcement Announcement Module
Collapse
No announcement yet.
Calling inner methods using DefaultAdvisorAutoProxyCreator Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calling inner methods using DefaultAdvisorAutoProxyCreator

    Hi Team,

    I have a class as below.
    Code:
    public class Foo implements IFoo{
    
    	public void  a(){
    		System.out.println("called A now calling b");
    		b();
    	}
    
    	public void b(){
    		System.out.println("called B")
    	}
    
    }
    I have created a Performance Method Interceptor using MethodInterceptor.

    The spring configuration is as below

    Code:
       <!-- Performance Advisor pointcut definition for before advice -->
    	<bean id="performanceAdvisor"
    	class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
    		<property name="advice">
    			<ref local="performanceAdvice"/>
    		</property>
    		<property name="pattern">
    			<value>.+service\..+</value>
    		</property>
    	</bean>
    		<!--PERFORMANCE ADVICE-->
    	<bean id="performanceAdvice" class="com.ams.spring.advice.PerformanceMethodAdvice">
    		<constructor-arg>
    			<value>5000</value>
    		</constructor-arg>
    	</bean>	
    	
    	<bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"/>
    From the client I call method a of class foo. In the logs I can see the time taken by method a but not of method b.

    Please let me know if this can be done.

    Regards
    Om

  • #2
    There are so many threads on this forum about a similar issue...
    Start by taking a look at this paragraph from reference documentation.

    Comment

    Working...
    X