Welcome Dani
I have to say you nearly got me on this one. :-) However it seems that
MonitoringInterceptor has this constructor:
public MonitoringInterceptor(MonitorSource<MethodInvocation,
Stopwatch> stopwatchSource) {
this.stopwatchTemplate = new
StopwatchTemplate<MethodInvocation>(stopwatchSource);
}
That means, that adding constructor arg into this bean definition shoudl help:
<bean id="monitoringInterceptor"
class="org.javasimon.spring.MonitoringInterceptor">
<constructor-arg>
<bean class="sk.posam.cruz.FunnyStopwatchSource"/>
</constructor-arg>
</bean>
My quick and dirty and probably not quite threadsafe source (but made
just for you ;-)):
package sk.posam.cruz;
import org.aopalliance.intercept.MethodInvocation;
import org.javasimon.SimonManager;
import org.javasimon.source.AbstractStopwatchSource;
public class FunnyStopwatchSource extends
AbstractStopwatchSource<MethodInvocation> {
private int counter = 0;
public FunnyStopwatchSource() {
super(SimonManager.manager());
}
@Override
protected String getMonitorName(MethodInvocation invocation) {
return "whatever." + invocation.getMethod().getName()+ '.' + counter++;
}
}
I have to say I learned something new now as well about our lib. ;-)
Can you please confirm success so we can celebrate with you?
Cheers
Virgo
> --
> You received this message because you are subscribed to the Google Groups "javasimon" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
javasimon+...@googlegroups.com.
> To post to this group, send email to
java...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/javasimon?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>