use of org.apache.wiki.event.WikiEngineEvent in project jspwiki by apache.
the class DefaultAdminBeanManager method actionPerformed.
/* (non-Javadoc)
* @see org.apache.wiki.ui.admin.AdminBeanManager#actionPerformed(org.apache.wiki.event.WikiEvent)
*/
@Override
public void actionPerformed(WikiEvent event) {
if (event instanceof WikiEngineEvent) {
if (((WikiEngineEvent) event).getType() == WikiEngineEvent.SHUTDOWN) {
for (Iterator<AdminBean> i = m_allBeans.iterator(); i.hasNext(); ) {
try {
AdminBean ab = i.next();
ObjectName on = getObjectName(ab);
if (m_mbeanServer.isRegistered(on)) {
m_mbeanServer.unregisterMBean(on);
log.info("Unregistered AdminBean " + ab.getTitle());
}
} catch (MalformedObjectNameException e) {
log.error("Malformed object name when unregistering", e);
} catch (InstanceNotFoundException e) {
log.error("Object was registered; yet claims that it's not there", e);
} catch (MBeanRegistrationException e) {
log.error("Registration exception while unregistering", e);
}
}
}
}
}
Aggregations