Hello Henning!
I'm glad that you find JCarder useful and it is an interesting feature
that you suggest.
I don't have time to implement it right now and I think we would have
to find a convenient way for the user to configure which classes to
check on instance level and which to check on class level. Do you have
any ideas about that?
However, if you would like to make some small modifications to JCarder
for your special case, you might look at the method beforeMonitorEnter
in com.enea.jcarder.agent.StaticEventListener and maybe replace the
call to:
listener.beforeMonitorEnter(monitor, lockingContext);
with something like:
listener.beforeMonitorEnter(monitor.getClass(), lockingContext);
I have not tried it, but think it would work. The monitor parameter is
the object that is being synchronized on.
It should be possible to use instanceof, getClass().getName() or
checking the lockReference or the methodWithClass string variables in
order to have special cases for some specific classes.
You might also have to check that monitor is not null.
Good luck and please tell if it works or not!
/Ulrik