Class GenericStatsImpl
- java.lang.Object
-
- org.glassfish.enterprise.iiop.util.GenericStatsImpl
-
- All Implemented Interfaces:
org.glassfish.external.statistics.Stats
public class GenericStatsImpl extends Object implements org.glassfish.external.statistics.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 thejavax.management.j2ee.statistics.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
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 org.glassfish.external.statistics.Statistic
getStatistic(String statisticName)
String[]
getStatisticNames()
org.glassfish.external.statistics.Statistic[]
getStatistics()
-
-
-
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 org.glassfish.external.statistics.Statistic getStatistic(String statisticName)
- Specified by:
getStatistic
in interfaceorg.glassfish.external.statistics.Stats
-
getStatisticNames
public String[] getStatisticNames()
- Specified by:
getStatisticNames
in interfaceorg.glassfish.external.statistics.Stats
-
getStatistics
public org.glassfish.external.statistics.Statistic[] getStatistics()
- Specified by:
getStatistics
in interfaceorg.glassfish.external.statistics.Stats
-
-