}
// NOTE: MBeans unregistered asynchronously by AMXConfigLoader
// enforce synchronous semantics to clients by waiting until this happens
// the listener is smart enough not to wait if it's already unregistered
final UnregistrationListener myListener = new UnregistrationListener(getMBeanServer(), childObjectName);
final long TIMEOUT_MILLIS = 10 * 1000;
final boolean unregisteredOK = myListener.waitForUnregister(TIMEOUT_MILLIS);
//cdebug( "Waiting for child to be unregistered: " + childObjectName );
if (!unregisteredOK)
{
throw new RuntimeException("Something went wrong unregistering MBean " + JMXUtil.toString(childObjectName));
}