*/
public JCAConnectionPoolStatsImpl getPoolStats(ObjectName poolServiceName)
{
TimeStatisticImpl waitTime = null;
TimeStatisticImpl useTime = null;
CountStatisticImpl closeCount = null;
CountStatisticImpl createCount = null;
BoundedRangeStatisticImpl freePoolSize = null;
BoundedRangeStatisticImpl poolSize = null;
RangeStatisticImpl waitingThreadCount = null;
try
{
if (poolStats == null)
{
Integer max = (Integer) server.getAttribute(poolServiceName, "MaxSize");
freePoolSize = new BoundedRangeStatisticImpl("FreePoolSize", "1",
"The free connection count", 0, max.longValue());
poolSize = new BoundedRangeStatisticImpl("PoolSize", "1",
"The connection count", 0, max.longValue());
poolStats = new JCAConnectionPoolStatsImpl(getobjectName(), jsr77MCFName,
waitTime, useTime, closeCount, createCount, freePoolSize, poolSize,
waitingThreadCount);
}
createCount = (CountStatisticImpl) poolStats.getCreateCount();
closeCount = (CountStatisticImpl) poolStats.getCloseCount();
freePoolSize = (BoundedRangeStatisticImpl) poolStats.getFreePoolSize();
poolSize = (BoundedRangeStatisticImpl) poolStats.getPoolSize();
// Update the stats
Integer isize = (Integer) server.getAttribute(poolServiceName, "ConnectionCreatedCount");
createCount.set(isize.longValue());
isize = (Integer) server.getAttribute(poolServiceName, "ConnectionDestroyedCount");
closeCount.set(isize.longValue());
isize = (Integer) server.getAttribute(poolServiceName, "ConnectionCount");
poolSize.set(isize.longValue());
Long lsize = (Long) server.getAttribute(poolServiceName, "AvailableConnectionCount");