Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (33 sloc) 2.2 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
<!-- monitoMe is the bean we will monitor -->
<bean id="monitorMe" class="org.automon.spring_aop.MonitorMe"/>
<bean id="automonSpringAspect" class="org.automon.aspects.AutomonSpringAspect"/>
<!-- Link the Automon Aspect to any beans you want monitored. Copy this into your applicationContext.xml and
Define 'monitoredMethods' and 'exceptionTrackedMethods' pointcuts.
- 'monitoredMethods' is a pointcut that tracks execution time of the methods.
- 'exceptionTrackedMethods' is a pointcut that tracks any exceptions that are thronw.
Typically both of these pointcuts would be the same though they don't need to be.
There are many ways of defining aspectJ pointcut syntax. For example annotations or packages
can be specified. You can also use the '||' conditional to monitor many beans.
Example1: <aop:pointcut id="monitoredMethods" expression="bean(monitorMe)"/>
Example2: <aop:pointcut id="monitoredMethods" expression="bean(monitorMe4) || bean(monitorMe3)"/>
<aop:pointcut id="monitoredMethods" expression="execution(* org.automon.spring_aop.MonitorMe.*(..))"/>
<aop:pointcut id="exceptionTrackedMethods" expression="execution(* org.automon.spring_aop.MonitorMe.*(..))"/>
<aop:aspect id="automonAspect" ref="automonSpringAspect">
<aop:around pointcut-ref="monitoredMethods" method="monitor"/>
<aop:after-throwing pointcut-ref="exceptionTrackedMethods" method="throwing" throwing="exceptionArg"/>