* (non-Javadoc)
* @see org.apache.jcs.auxiliary.AuxiliaryCache#getStatistics()
*/
public IStats getStatistics()
{
IStats stats = new Stats();
stats.setTypeName( "Remote Cache No Wait" );
ArrayList elems = new ArrayList();
IStatElement se = null;
se = new StatElement();
se.setName( "Status" );
int status = this.getStatus();
if ( status == CacheConstants.STATUS_ERROR )
{
se.setData( "ERROR" );
}
else if ( status == CacheConstants.STATUS_ALIVE )
{
se.setData( "ALIVE" );
}
else if ( status == CacheConstants.STATUS_DISPOSED )
{
se.setData( "DISPOSED" );
}
else
{
se.setData( "" + status );
}
elems.add( se );
// no data gathered here
// get the stats from the cache queue too
// get as array, convert to list, add list to our outer list
IStats cStats = this.cache.getStatistics();
if ( cStats != null )
{
IStatElement[] cSEs = cStats.getStatElements();
List cL = Arrays.asList( cSEs );
elems.addAll( cL );
}
// get the stats from the event queue too
// get as array, convert to list, add list to our outer list
IStats eqStats = this.cacheEventQueue.getStatistics();
IStatElement[] eqSEs = eqStats.getStatElements();
List eqL = Arrays.asList( eqSEs );
elems.addAll( eqL );
se = new StatElement();
se.setName( "Get Count" );
se.setData( "" + this.getCount );
elems.add( se );
se = new StatElement();
se.setName( "Remove Count" );
se.setData( "" + this.removeCount );
elems.add( se );
se = new StatElement();
se.setName( "Put Count" );
se.setData( "" + this.putCount );
elems.add( se );
// get an array and put them in the Stats object
IStatElement[] ses = (IStatElement[]) elems.toArray( new StatElement[elems.size()] );
stats.setStatElements( ses );
return stats;
}