Class GenericStatsImpl
java.lang.Object
com.sun.enterprise.admin.monitor.stats.GenericStatsImpl
- All Implemented Interfaces:
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 the
Stats 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
ConstructorsConstructorDescriptionGenericStatsImpl(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
Modifier and TypeMethodDescriptiongetStatistic(String statisticName) Get a Statistic by name.String[]Returns an array of Strings which are the names of the attributes from the specific Stats submodel that this object supports.Returns an array containing all of the Statistic objects supported by this Stats object.
-
Constructor Details
-
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
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.
Statisticinterface.- Throws:
NullPointerException- if any of the given parameters are nullIllegalArgumentException- if the contract is not satisfied by given parameters
-
-
Method Details
-
getStatistic
Description copied from interface:StatsGet a Statistic by name.- Specified by:
getStatisticin interfaceStats
-
getStatisticNames
Description copied from interface:StatsReturns 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:
getStatisticNamesin interfaceStats
-
getStatistics
Description copied from interface:StatsReturns an array containing all of the Statistic objects supported by this Stats object.- Specified by:
getStatisticsin interfaceStats
-