delegate_ = delegate;
}
public JMXRegistrationInfo provide(PicoContainer picoContainer, ComponentAdapter componentAdapter)
{
final JMXRegistrationInfo _info = delegate_.provide(picoContainer, componentAdapter);
if (_info != null)
{
try
{
final JMXManageable manageable =
(JMXManageable) componentAdapter.getComponentInstance(picoContainer);
manageable.registerDisposable(new Disposable()
{
public void dispose()
{
try
{
logger_.info("Unregister MBean " + _info.getObjectName());
mbeanServer_.unregisterMBean(_info.getObjectName());
} catch (InstanceNotFoundException e)
{
logger_.error("Error while unregistering MBean "
+ _info.getObjectName(), e);
} catch (MBeanRegistrationException e)
{
logger_.error("Error while unregistering MBean "
+ _info.getObjectName(), e);
}
}
});
} catch (ClassCastException e)
{