if ("org.apache.catalina.UserDatabase".equals(resource.getType())) {
destroyMBeanUserDatabase(resource.getName());
}
String mname = createManagedName(resource);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, resource);
if( mserver.isRegistered(oname ))
mserver.unregisterMBean(oname);