// 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;