import org.opendaylight.controller.config.api.ModuleIdentifier;
import org.opendaylight.controller.config.manager.impl.jmx.ModuleJMXRegistrator;
+import org.opendaylight.controller.config.manager.impl.jmx.RootRuntimeBeanRegistratorImpl;
import org.opendaylight.controller.config.manager.impl.osgi.BeanToOsgiServiceManager.OsgiRegistration;
import org.opendaylight.yangtools.concepts.Identifiable;
import org.slf4j.Logger;
private final ModuleJMXRegistrator oldJMXRegistrator;
private final OsgiRegistration osgiRegistration;
private final int orderingIdx;
+ private RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator;
public DestroyedModule(ModuleIdentifier identifier, AutoCloseable instance,
- ModuleJMXRegistrator oldJMXRegistrator,
- OsgiRegistration osgiRegistration, int orderingIdx) {
+ ModuleJMXRegistrator oldJMXRegistrator,
+ OsgiRegistration osgiRegistration, int orderingIdx,
+ final RootRuntimeBeanRegistratorImpl runtimeBeanRegistrator) {
this.identifier = identifier;
this.instance = instance;
this.oldJMXRegistrator = oldJMXRegistrator;
this.osgiRegistration = osgiRegistration;
this.orderingIdx = orderingIdx;
+ this.runtimeBeanRegistrator = runtimeBeanRegistrator;
}
@Override
} catch (Exception e) {
LOG.error("Error while closing jmx registrator of {}", identifier, e);
}
+ try {
+ if (runtimeBeanRegistrator != null) {
+ runtimeBeanRegistrator.close();
+ }
+ } catch (Exception e) {
+ LOG.error("Error while closing runtime bean jmx registrator of {}", identifier, e);
+ }
try {
osgiRegistration.close();
} catch (Exception e) {