Java EE 5 SDK

com.sun.appserv.management.j2ee.statistics
Class StatsImpl

java.lang.Object
  extended by com.sun.appserv.management.j2ee.statistics.GetterInvocationHandler<T>
      extended by com.sun.appserv.management.j2ee.statistics.MapGetterInvocationHandler<Statistic>
          extended by com.sun.appserv.management.j2ee.statistics.StatsImpl
All Implemented Interfaces:
Serializable, InvocationHandler, Stats

public class StatsImpl
extends MapGetterInvocationHandler<Statistic>
implements Stats, Serializable

Generic implementation of Stats based on either a Map or a CompositeData. There are two ways to implement a specific type of Stats object:

In addition to the standard JSR 77 Stats interfaces, the following specific Stats interfaces are available:

See Also:
Serialized Form

Constructor Summary
StatsImpl(CompositeData compositeData)
          Create a Stats from a CompositeData, whose keys are the Statistic names and whose values are CompositeData for the Statistic.
StatsImpl(Map<String,Statistic> statisticsIn)
          Create a Stats from a Map, whose keys are the Statistic names and whose values are the Statistics.
StatsImpl(Statistic[] statistics)
           
 
Method Summary
 boolean equals(Object rhs)
           
 Statistic getStatistic(String statisticName)
          Get a Statistic by name.
 String[] getStatisticNames()
          Returns an array of Strings which are the names of the attributes from the specific Stats submodel that this object supports.
 Statistic[] getStatistics()
          Returns an array containing all of the Statistic objects supported by this Stats object.
 Object invoke(Object myProxy, Method method, Object[] args)
           
 String toString()
           
 
Methods inherited from class com.sun.appserv.management.j2ee.statistics.MapGetterInvocationHandler
containsValue, getMap, getValue, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatsImpl

public StatsImpl(CompositeData compositeData)
Create a Stats from a CompositeData, whose keys are the Statistic names and whose values are CompositeData for the Statistic.


StatsImpl

public StatsImpl(Map<String,Statistic> statisticsIn)
Create a Stats from a Map, whose keys are the Statistic names and whose values are the Statistics.


StatsImpl

public StatsImpl(Statistic[] statistics)
Method Detail

getStatistic

public Statistic getStatistic(String statisticName)
Description copied from interface: Stats
Get a Statistic by name.

Specified by:
getStatistic in interface Stats

getStatisticNames

public String[] getStatisticNames()
Description copied from interface: Stats
Returns an array of Strings which are the names of the attributes from the specific Stats submodel that this object supports. Attributes named in the list must correspond to attributes that will return a Statistic object of the appropriate type which contains valid performance data. The return value of attributes in the Stats submodel that are not included in the statisticNames list must be null. For each name in the statisticNames list there must be one Statistic with the same name in the statistics list.

Specified by:
getStatisticNames in interface Stats

getStatistics

public Statistic[] getStatistics()
Description copied from interface: Stats
Returns an array containing all of the Statistic objects supported by this Stats object.

Specified by:
getStatistics in interface Stats

toString

public String toString()
Overrides:
toString in class MapGetterInvocationHandler<Statistic>

equals

public boolean equals(Object rhs)
Overrides:
equals in class MapGetterInvocationHandler<Statistic>

invoke

public Object invoke(Object myProxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Overrides:
invoke in class GetterInvocationHandler<Statistic>
Throws:
Throwable

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.