FileDocCategorySizeDatePackage
UpdateStatusImpl.javaAPI DocGlassfish v2 API3664Fri May 04 22:23:28 BST 2007com.sun.enterprise.management.ext.update

UpdateStatusImpl

public final class UpdateStatusImpl extends com.sun.enterprise.management.support.AMXImplBase implements com.sun.appserv.management.ext.update.UpdateStatus

Fields Summary
Constructors Summary
public UpdateStatusImpl()

        super( );
    
Methods Summary
public final java.lang.StringgetGroup()

        return( AMX.GROUP_UTILITY );
    
public intgetNumModules()


       // Even though Update Center jars are packaged with Application Server.
       // They could be un-installed. Doing a reflection based  implementation
       // is better that way. 

       int num = 0;
       try {
           final Class c = Class.forName(
            "com.sun.enterprise.update.schedule.SchedulerImpl");
           final Object s = c.newInstance();

           if (s != null) {
                // call getNumberOfModules with zero arguments
                final Class[] paramTypes = null;
                final  Object[] argTypes = null;

                final Method m = c.getMethod("runUpdateCheck", paramTypes);
                final Integer retval = (Integer) m.invoke(s, argTypes);
                num =  retval.intValue();
           }
       } catch(Throwable t) {
            getMBeanLogger().warning(t.getMessage());
            if(getMBeanLogger().isLoggable(Level.FINE))
                t.printStackTrace();

       } 
       return num;