ImplUtil.getLogger().info("AMXStartupService: has been shut down and all AMX MBeans unregistered, remaining MBeans: " + mMBeanServer.queryNames(allAMXPattern, null));
}
public void postConstruct() {
final TimingDelta delta = new TimingDelta();
SingletonEnforcer.register(this.getClass(), this);
if (mMBeanServer == null) {
throw new Error("AMXStartup: null MBeanServer");
}
try {
// StandardMBean is required because interface and class are in different packages
final StandardMBean mbean = new StandardMBean(this, AMXStartupServiceMBean.class);
mMBeanServer.registerMBean(mbean, OBJECT_NAME);
mMBeanTracker = new MBeanTracker(AMXGlassfish.DEFAULT.amxJMXDomain());
final AmxPref amxPref = InjectedValues.getInstance().getAMXPrefs();
mMBeanTracker.setEmitMBeanStatus(amxPref == null ? false : Boolean.valueOf(amxPref.getEmitRegisrationStatus()));
//final StandardMBean supportMBean = new StandardMBean(mMBeanTracker, MBeanTrackerMBean.class);
mMBeanServer.registerMBean(mMBeanTracker, MBeanTrackerMBean.MBEAN_TRACKER_OBJECT_NAME);
} catch (final Exception e) {
ImplUtil.getLogger().log(Level.INFO, "Fatal error loading AMX", e);
throw new Error(e);
}
//debug( "AMXStartupService.postConstruct(): registered: " + OBJECT_NAME );
ImplUtil.getLogger().info("Initialized AMXStartupServiceNew in " + delta.elapsedMillis() + " ms, registered as " + OBJECT_NAME);
mEvents.register(new ShutdownListener());
}