public ObjectName[] getChildren() {
   final Collection c = delegate.getAllChildren();
   final ObjectName[] names = new ObjectName[c.size()];
   final Iterator it = c.iterator();
   int i = 0;
   while (it.hasNext()) {
     final StatsHolder s = (StatsHolder) it.next();
     names[i++] = s.getObjectName();
   }
   assert (names.length == i) : "Sizes don't match";
   return (names);
 }
 public String[] getStatisticNames() {
   Stats stats = delegate.getStats();
   if (stats != null) {
     return stats.getStatisticNames();
   } else {
     return null;
   }
 }
 private boolean isJta() {
   boolean isJta = false;
   final Class cl = delegate.getStatsClass();
   if (cl != null) {
     if (com.sun.enterprise.admin.monitor.stats.JTAStats.class.getName().equals(cl.getName())) {
       isJta = true;
     }
   }
   return (isJta);
 }
  public Statistic[] getStatistics() {
    Stats stats = delegate.getStats();
    if (stats == null) {
      return null;
    }

    Statistic[] statArray = stats.getStatistics();
    boolean isSerializable = checkSerializability(statArray);
    if (isSerializable) {
      final Statistic[] hackedArray = StatisticWorkaround.populateDescriptions(statArray);
      return hackedArray;
    } else return null;
  }
  private MBeanOperationInfo[] getOperationInfos() {

    final ArrayList opInfo = new ArrayList();

    opInfo.add(getChildrenInfo());
    opInfo.add(getNameInfo());
    opInfo.add(getTypeInfo());
    // Add the additional ops only for StatsHolders that have an actual Stats object
    // associated with them
    if (delegate.getStats() != null) {
      opInfo.add(getStatisticNameInfo());
      opInfo.add(getStatsInfo());
    }

    MBeanOperationInfo[] mos = new MBeanOperationInfo[opInfo.size()];
    mos = (MBeanOperationInfo[]) opInfo.toArray(mos);

    // if we are dealing with JTAStats, we need to add the additional
    // operations freeze, unfreeze & rollback to the MBeanOerationInfo
    if (isJta()) return (getJTAOperationInfo(mos));

    return (mos);
  }
 public String getType() {
   return delegate.getType().getTypeName();
 }
 public String getName() {
   return delegate.getName();
 }
 public void preDeregister() throws Exception {
   registrar.unregisterDottedName(delegate.getDottedName());
 }
 public void postRegister(Boolean registered) {
   if (registered.equals(Boolean.TRUE)) {
     registrar.registerDottedName(delegate.getDottedName(), delegate.getObjectName());
     changeState(REGISTERED);
   }
 }
 public Object getAttribute(String name)
     throws AttributeNotFoundException, MBeanException, ReflectionException {
   if (name.equals(DOTTED_NAME)) return delegate.getDottedName();
   else return (mediator.getAttribute(name));
 }
 StatsHolderMBeanImpl(StatsHolder delegate) {
   assert (delegate != null);
   this.delegate = delegate;
   this.mediator = new StatsMediatorImpl(delegate.getStats(), delegate.getStatsClass());
   changeState(INITIALIZED);
 }