You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Willem Jiang <ni...@iona.com> on 2007/05/15 09:42:38 UTC

Re: svn commit: r537737 [1/2]

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, ningjiang@apache.org 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;
>> +    }
>>     
>
>