Willem,
Just a quick note....
Did you give any thought of using an
java.util.concurrent.atomic.AtomicInteger for the invocations count?
You could then avoid the synchronized stuff.
Dan
On Monday 14 May 2007 03:11, [EMAIL PROTECTED] wrote:
> +public class PerformanceCounter implements PerformanceCounterMBean,
> Counter { + private int invocations;
> + private ObjectName objectName;
> +
> + public PerformanceCounter(ObjectName on) {
> + objectName = on;
> + }
> +
> + public Number getNumInvocations() {
> + return invocations;
> + }
> +
> + public synchronized void increase(MessageHandlingTimeRecorder
> mhtr) { + invocations++;
> + }
> +
> + public ObjectName getObjectName() throws JMException {
> + return objectName;
> + }
--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727 C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog