Hi Dan,

Thanks for your note.
I will do a quick update for it.

Cheers,

Willem.
Daniel Kulp wrote:
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;
+    }



Reply via email to