Class GenericStatsImpl
- java.lang.Object
-
- com.sun.enterprise.admin.monitor.stats.GenericStatsImpl
-
- All Implemented Interfaces:
Stats
public class GenericStatsImpl extends Object implements Stats
Provides for generic implementation of any Stats interface. This class facilitates composition over inheritance for all the classes that implement their specific Stats interfaces. None of them has to implement the methods defined by theStats
interface. This class implements the same interface and does that job. All that implementing classes have to do is implement the specific accessing methods in their Stats interfaces and delegate the rest to this class. This class invokes all these methods in implementing class through introspection.- Since:
- S1AS8.0
- Version:
- $Version$
- Author:
- Kedar Mhaswade
-
-
Constructor Summary
Constructors Constructor Description GenericStatsImpl(Class statsInterface, Object statsProvider)
Constructs a new instance of this class for a given interface and its implementation.GenericStatsImpl(String statsInterfaceName, ClassLoader loader, Object statsProvider)
GenericStatsImpl(String statsInterfaceName, Object statsProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
Constructor Detail
-
GenericStatsImpl
public GenericStatsImpl(String statsInterfaceName, Object statsProvider) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
GenericStatsImpl
public GenericStatsImpl(String statsInterfaceName, ClassLoader loader, Object statsProvider) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
GenericStatsImpl
public GenericStatsImpl(Class statsInterface, Object statsProvider)
Constructs a new instance of this class for a given interface and its implementation. It is mandatory that following contract is satisfied to call this satisfactorily:- None of the parameters are null.
- Given statsProvider implements the given statsInterface.
- Given statsInterface has to extend the @{link Stats} interface.
Statistic
interface.- Throws:
NullPointerException
- if any of the given parameters are nullIllegalArgumentException
- if the contract is not satisfied by given parameters
-
-
Method Detail
-
getStatistic
public Statistic getStatistic(String statisticName)
Description copied from interface:Stats
Get a Statistic by name.- Specified by:
getStatistic
in interfaceStats
-
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 interfaceStats
-
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 interfaceStats
-
-