コード例 #1
0
 public String[] getStatisticNames() {
   Stats stats = delegate.getStats();
   if (stats != null) {
     return stats.getStatisticNames();
   } else {
     return null;
   }
 }
コード例 #2
0
  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;
  }
コード例 #3
0
  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);
  }
コード例 #4
0
 StatsHolderMBeanImpl(StatsHolder delegate) {
   assert (delegate != null);
   this.delegate = delegate;
   this.mediator = new StatsMediatorImpl(delegate.getStats(), delegate.getStatsClass());
   changeState(INITIALIZED);
 }