Announcement Announcement Module
Collapse
No announcement yet.
Cannot seem to weave target Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot seem to weave target

    I'm new to AOP although I have been using spring and springwebflow for a couple of years now. I am working on a project for which we are seeking to monitor performance of the webflow actions. below are snippets of my attempts to use the JamonPerformanceMonitorInterceptor with aop to get the desired results. I cannot seem to get the target objects to weave the aspect.

    aop.xml:
    Code:
    <!-- AOP based logging -->
    <bean id="webflowMonitorPerformanceAdvice" class="com.online.util.interceptor.ProxyTargetLoggingPerformanceMonitorInterceptor">
        <property name="loggerName" value="com.online.webflow.performance"/>
        <property name="trackAllInvocations" value="true"/>
    </bean>
    	
    <aop:config>
        <aop:pointcut id="webflowMethods" expression="execution(* org.springframework.webflow.execution.Event com.online.webflow.*.*(org.springframework.webflow.execution.RequestContext))"/>
    	
        <aop:advisor advice-ref="webflowMonitorPerformanceAdvice" pointcut-ref="webflowMethods"/>
    
    </aop:config>

    ProxyTargetLoggingPerformanceMonitorInterceptor.ja va:
    Code:
    public class ProxyTargetLoggingPerformanceMonitorInterceptor extends JamonPerformanceMonitorInterceptor {
    
        protected String createInvocationTraceName(MethodInvocation invocation)
        {
            String targetClass = AopUtils.getTargetClass(invocation.getThis()).getName();
    
            StringBuffer sb = new StringBuffer(getPrefix());
            sb.append(targetClass);
            sb.append('.').append(invocation.getMethod().getName());
            sb.append(getSuffix());
            return sb.toString();
        }
    
    }
    log4j.properties:
    Code:
    # AOP performance monitoring
    log4j.logger.com.online.webflow.performance=TRACE, WEBFLOW_PERF_STATS
    log4j.additivity.com.online.webflow.performance=false
    
    # BEGIN APPENDER: WEBFLOW_PERF_STATS STATS FILE APPENDER
    log4j.appender.WEBFLOW_PERF_STATS=com.online.util.DailyMaxRollingFileAppender
    log4j.appender.WEBFLOW_PERF_STATS.layout=org.apache.log4j.PatternLayout
    log4j.appender.WEBFLOW_PERF_STATS.layout.ConversionPattern=%d %m%n
    log4j.appender.WEBFLOW_PERF_STATS.File=${catalina.home}/logs/web-action-perf-stats.log
    log4j.appender.WEBFLOW_PERF_STATS.DatePattern='.'yyyy-MM-dd
    log4j.appender.WEBFLOW_PERF_STATS.MaxBackupIndex=14
    Am I missing something obvious? Is there a way to debug the spring aop to see why it's not weaving the targets?

    tia,

    --
    helpguest
    url removed on first post
    See the problem. Fix it. Get paid.

  • #2
    More details ...

    Since I got no response, I thought I'd post some more details that might be useful. We still have not come up with a solution.

    We currently subclass FormAction the (over-simplified) object structure is.

    org.springframework.webflow.action.FormAction implements org.springframework.webflow.action.AbstractAction

    OurWebAction extends FormAction implements IOurWebAction

    what we'd like to have happen is to use the org.springframework.aop.interceptor.JamonPerforman ceMonitorInterceptor Aspect to wrap the methods defined by IOurWebAction.

    By broadening the scope of our pointcut to
    Code:
    <aop:pointcut id="webflowMethods" expression="execution( org.springframework.webflow.execution.Event *.*(..))" />
    we see that the AbstractAction is woven but not IOurWebAction

    The one method from AbstractAction which is pointcut is the execute() method. We can tell because the JamonPerformanceMonitorInterceptor is working as expected around that method.

    How can we get the methods of IOurWebAction to weave?

    --
    helpguest

    Comment

    Working...
    X