本文整理汇总了Java中org.opendaylight.controller.config.manager.impl.dependencyresolver.DestroyedModule.close方法的典型用法代码示例。如果您正苦于以下问题:Java DestroyedModule.close方法的具体用法?Java DestroyedModule.close怎么用?Java DestroyedModule.close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.controller.config.manager.impl.dependencyresolver.DestroyedModule
的用法示例。
在下文中一共展示了DestroyedModule.close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: close
import org.opendaylight.controller.config.manager.impl.dependencyresolver.DestroyedModule; //导入方法依赖的package包/类
/**
* Abort open transactions and unregister read only modules. Since this class is
* not responsible for registering itself under
* {@link org.opendaylight.controller.config.api.ConfigRegistry#OBJECT_NAME}, it
* will not unregister itself here.
*/
@Override
public void close() {
if (!closed.compareAndSet(false, true)) {
return;
}
// abort transactions
Map<String, Entry<ConfigTransactionControllerInternal, ConfigTransactionLookupRegistry>> transactions =
transactionsHolder.getCurrentTransactions();
for (Entry<ConfigTransactionControllerInternal, ConfigTransactionLookupRegistry>
configTransactionControllerEntry : transactions.values()) {
ConfigTransactionControllerInternal configTransactionController = configTransactionControllerEntry.getKey();
configTransactionControllerEntry.getValue().close();
configTransactionController.abortConfig();
}
// destroy all live objects one after another in order of the dependency
// hierarchy, from top to bottom
List<DestroyedModule> destroyedModules = currentConfig.getModulesToBeDestroyed();
LOG.info("ConfigRegistry closing - destroying {} modules", destroyedModules.size());
for (DestroyedModule destroyedModule : destroyedModules) {
destroyedModule.close();
}
// unregister MBeans that failed to unregister properly
baseJMXRegistrator.close();
// remove jmx servers
MBeanServerFactory.releaseMBeanServer(registryMBeanServer);
MBeanServerFactory.releaseMBeanServer(transactionsMBeanServer);
LOG.info("ConfigRegistry closed");
}