Announcement Announcement Module
Collapse
No announcement yet.
PerformanceMonitorInterceptor implementation problems Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • PerformanceMonitorInterceptor implementation problems

    Hi, i'm trying to obtain an estimate for a particular method's execution time. The performanceMonitorInterceptor seems to be just what i'm looking for.
    My interface is: com.ott.gt.queue.IQueue
    One of the implementing classes: com.ott.gt.queue.SimpleQueue

    Here is my bean spec:
    Code:
    <bean id="performanceInterceptor" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/>
     
    <bean id="simpleQueue" class="com.ott.gt.queue.SimpleQueue"/>
    
    <bean id="pService" class="org.springframework.aop.framework.ProxyFactoryBean">
                <property name="proxyInterfaces">
                    <value>com.ott.gt.queue.IQueue</value>
                </property>
                <property name="target">
                    <ref bean="simpleQueue"/>
                </property>
                <property name="interceptorNames">
                <list>
                    <value>performanceInterceptor</value>
                </list>
                </property>
        </bean>
    I don't see any errors starting up my server , so bean initialization goes ok. But i don't see any log statements when any of the implemented methods from the interface are called in my "target" class.
    I use log4j for our logging. Now, there might be a conflict or a mismatch, i'm not sure, with commons logging.
    Putting the logger for thewhole application in debug, doesn't show me *any* indication that the interceptor method is being called.
    I even subclassed the performanceMonitorInterceptor and changed just the logger to use log4j and still to no avail.
    I even have the latest CGLIB library. I'm not sure what i'm missing.
    Any help or suggestions will be appreciated.
    Thanks
    j

  • #2
    progress...

    I realized that the reason i didn't see the interceptor kicking in at any point was because i was calling the actual bean instead of the proxyFactoryBean. Once i changed that, i can see the stopwatch debug code; but this happens only when *one* of the interface methods is being called, and not the rest. I'm not sure why this is happening.
    Any help would be appreciated. Thanks in advance.

    Comment


    • #3
      got it...

      The xml bean spec i wrote above is right. I found out that there was an error with the way i was testing this.
      Thanks everybody.

      Comment


      • #4
        Have the same problem

        Hi,

        i have the same configuration as you and see no output of the interceptor. For my testcase I set up an application-context, similar to yours and receive my service from this context. I also use the proxy, like pService.

        I don't use log4j. Also the output say to me
        INFO: CGLIB2 available: proxyTargetClass feature enabled

        any suggestions?
        thanks

        Comment

        Working...
        X