Package javax.management.j2ee.statistics

Examples of javax.management.j2ee.statistics.Statistic


   
    final String[]  names  = mon.getStatisticNames();
    for( int i = 0; i < names.length; ++i )
    {
      final String  name  = names[ i ];
      final Statistic  s  = mon.getStatistic( name );
      assert( s != null );
      assert( s.getName().equals( name ) );
     
      checkLegalStatistic( objectName, s );
    }
  }
View Full Code Here


    final ObjectName  objectName  = Util.getObjectName( mon );
   
    final String[]  names  = stats.getStatisticNames();
    for( int i = 0; i < names.length; ++i )
    {
      final Statistic  s  = stats.getStatistic( names[ i ] );
      assert( s != null );
      assert( s.getName().equals( names[ i ] ) );
     
      checkLegalStatistic( objectName, s );
    }
  }
View Full Code Here

    for( int i = 0; i < names.length; ++i )
    {
      final String  name  = names[ i ];
     
      final CompositeData  d  = mon.getOpenStatistic( name );
      final Statistic  s    = StatisticFactory.create( d );
      final Statistic  s2    = mon.getStatistic( name );
     
      assert( s.getName().equals( name ) );
      // values may have changed, but check the static fields
    }
   
View Full Code Here

       
        assert( returnType.isAssignableFrom( o.getClass() ) ) :
          "Method " + methodName + " of MBean " + objectName +
          " returned object not assignable to " + returnType.getName();

        final Statistic  stat  = (Statistic)method.invoke( stats, (Object[])null );
        assert( method.getReturnType().isAssignableFrom( stat.getClass() ) );
       
        final Statistic s  = mon.getStatistic( stat.getName() );
        assert( returnType.isAssignableFrom( s.getClass() ) ) :
          "getStatistic() of MBean " + objectName +
          " returned Statistic not assignable to " + returnType.getName();
         
        //printVerbose( "Verified " + stat.getClass().getName()  + " " + stat.getName() );
      }
View Full Code Here

      private void
    checkOpenDataConversion( final Statistic s )
      throws OpenDataException
    {
      final CompositeData  d  = J2EEUtil.statisticToCompositeData( s );
      final Statistic  roundTrip  = StatisticFactory.create( d );
     
    assert( s.equals( roundTrip ) ) :
      "Conversion to CompositeData and back to Statistic failed:\n" +
      toString( s ) + " != " + toString( roundTrip );
    }
View Full Code Here

    final String  fieldName )
    throws AttributeNotFoundException
  {
    try
    {
      final Statistic s  = getStatistic( statisticName );
      assert( s instanceof MapStatistic );
     
      final String  methodName  = JMXUtil.GET + fieldName;
      final Method  m  = s.getClass().getMethod( methodName, (Class[])null);
     
      //final MapStatisticImpl  ms  = new MapStatisticImpl( s );
      final Object result  = m.invoke( s, (Object[])null );
      return( result );
    }
View Full Code Here

  }

    public CompositeDataSupport
  getOpenStatistic(String name)
  {
    final Statistic statistic = getStatistic( name );
   
    try
    {
      return J2EEUtil.statisticToCompositeData(statistic);
    }
View Full Code Here

    final Stats      stats  = getStats();
    final Statistic[]  result  = new Statistic[ desiredNames.length ];
   
    for( int i = 0; i < desiredNames.length; ++i )
    {
      final Statistic  statistic  = stats.getStatistic( desiredNames[ i ] );
     
      // OK to return null if not found--see Javadoc
      result[ i = statistic;
    }
   
View Full Code Here

    protected Statistic[] getStatisticsFromImpl(CustomStatsImpl customStatsImpl) {
        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);
View Full Code Here

    @param  mappings    a Map containing keys of type String and their Object values
   */
    public static Statistic
  create( Class<? extends Statistic> theInterface, final Map<String,?> mappings )
  {
    Statistic  result  = null;
   
    // hopefully specific classes are faster than a proxy...
    if ( theInterface == CountStatistic.class )
    {
      result  = new CountStatisticImpl( mappings );
View Full Code Here

TOP

Related Classes of javax.management.j2ee.statistics.Statistic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.