dev@glassfish.java.net

Re: StatsProvider: return read-only Statistic object

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Mon, 29 Jun 2009 10:44:33 -0700

Moving this to the dev alias.

-marina

Sreenivas Munnangi wrote:
> Ken Cavanaugh wrote:
>
>>
>> On Jun 27, 2009, at 3:35 AM, Jennifer Chou wrote:
>>
>>> When creating StatsProviders....
>>>
>>> Please make sure the statistic getter methods return the read-only
>>> Statistic object instead of the StatisticImpl.
>>> This applies to all the Statistics, like
>>> org.glassfish.api.statistics.CountStatistic, TimeStatistic,
>>> RangeStatistic, BoundedRangeStatistic. Use the statistics from
>>> glassfish-api.
>>> Do this by calling getStatistic() on the StatisticImpl.
>>> I just made this change in HttpServiceStatsProvider and the other
>>> StatsProviders in web/admin.
>>>
>>> @ManagedAttribute(id="requestcount")
>>> @@ -102,7 +102,7 @@
>>> public CountStatistic getRequestCount() {
>>> CountStatisticImpl requestCount = new
>>> CountStatisticImpl("RequestCount", "count", "Cumulative number of
>>> requests processed so far");
>>> requestCount.setCount(requestProcessTime.getCount());
>>> - return requestCount;
>>> + return requestCount.getStatistic();
>>> }
>>>
>>> Thanks,
>>> Jennifer
>>
>>
>> Is glassfish-api built independently of the rest of GFv3?
>> Otherwise I can't use it in the ORB.
>
> Jerome indicated about building glassfish-api separately, I request him
> to update us on current status.
>
>>
>> Thanks,
>>
>> Ken.
>
>