FileDocCategorySizeDatePackage
CompositeDataStats.javaAPI DocGlassfish v2 API3694Fri May 04 22:30:52 BST 2007com.sun.appserv.management.j2ee.statistics

CompositeDataStats

public final class CompositeDataStats extends Object implements javax.management.j2ee.statistics.Stats
Implementation of Stats which expects a CompositeData to contain the Statistics keyed by name, with values of CompositeData.

Fields Summary
final Map
mItems
Constructors Summary
public CompositeDataStats(CompositeData compositeData)
Create a new CompositeDataStats using the specified CompositeData

		mItems	= OpenMBeanUtil.compositeDataToMap( compositeData );
	
Methods Summary
public javax.management.j2ee.statistics.StatisticgetStatistic(java.lang.String statisticName)

		final CompositeData	statData	= (CompositeData)mItems.get( statisticName );
		if ( statData == null && ! mItems.containsKey( statisticName ) )
		{
			throw new IllegalArgumentException( statisticName );
		}
		
		return( new CompositeDataStatistic( statData ) );
	
public java.lang.String[]getStatisticNames()

		final Set<String>	nameSet	= mItems.keySet();
		
		return( (String[])nameSet.toArray( new String[ nameSet.size() ] ) );
	
public javax.management.j2ee.statistics.Statistic[]getStatistics()

		final String[]		names		= getStatisticNames();
		final Statistic[]	statistics	= new Statistic[ names.length ];
		
		for( int i = 0; i < names.length; ++i )
		{
			statistics[ i ]	= getStatistic( names[ i ] );
		}
		
		return( statistics );