Get all Statistics from the delegate (our only available call API).
Statistic names are translated appropriately.
try {
final Statistic[] statistics = getStatisticsFromImplRaw(customStatsImpl);
// translate the names to be the ones we expose in MBeanInfo
for(int i = 0; i < statistics.length; ++i) {
final Statistic origStatistic = statistics[i];
final MapStatistic m = new MapStatisticImpl(origStatistic);
final String convertedName = originalToDerivedStatisticName(origStatistic.getName());
if (! convertedName.equals(origStatistic.getName()))
m.setName(convertedName);
final Class<? extends Statistic> theClass =
StatisticFactory.getInterface(origStatistic);
assert(theClass != null);
// this will create one which implements the requisite interfaces
statistics[ i ] = StatisticFactory.create(theClass, m.asMap());
assert(theClass.isAssignableFrom(statistics[ i ].getClass()));
}
return(statistics);
} catch (Exception e) {
final Throwable rootCause = ExceptionUtil.getRootCause(e);
if (!(rootCause instanceof InstanceNotFoundException))
// don't rethrow--will make MBeanServer unuseable as it has a bug if we throw
// an exception of of getMBeanInfo() which halts any further processing of the query
//NOTE: WARNING_CHANGED_TO_FINE
logWarning("Can't get Statistics from impl of " + getObjectName() +
"\n" + rootCause.getMessage() + "\n" + ExceptionUtil.getStackTrace(rootCause));
throw new RuntimeException(e);
}