Skip to content

Instantly share code, notes, and snippets.

@krams915
Created September 15, 2011 04:54
Show Gist options
  • Save krams915/1218576 to your computer and use it in GitHub Desktop.
Save krams915/1218576 to your computer and use it in GitHub Desktop.
trace-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
<!-- Cross-cutting Concerns-->
<!-- For parsing classes with @Aspect annotation -->
<aop:aspectj-autoproxy/>
<!-- See http://static.springsource.org/spring-data/data-jpa/docs/current/reference/html/#faq -->
<!-- See http://idevone.wordpress.com/2009/09/02/howto-simple-profiling-with-spring-aop/ -->
<!-- See http://stackoverflow.com/questions/1366354/do-method-profiling-basic-execution-time-with-spring-aop -->
<bean id="customizableTraceInterceptor" class="org.krams.tutorial.aop.TraceInterceptor"
p:enterMessage="Entering $[targetClassShortName].$[methodName]($[arguments])"
p:exitMessage="Leaving $[targetClassShortName].$[methodName](): $[returnValue]"/>
<aop:config>
<aop:advisor advice-ref="customizableTraceInterceptor"
pointcut="execution(public * org.krams.tutorial.service..*(..))"/>
<aop:advisor advice-ref="customizableTraceInterceptor"
pointcut="execution(public * org.krams.tutorial.controller.EventController.*(..))"/>
<aop:advisor advice-ref="customizableTraceInterceptor"
pointcut="execution(public * org.krams.tutorial.controller.JqgridEventController.*(..))"/>
<aop:advisor advice-ref="customizableTraceInterceptor"
pointcut="execution(public * org.krams.tutorial.controller.MainController.*(..))"/>
</aop:config>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment