当前位置: 首页>>代码示例>>Java>>正文


Java ConfigRegistryJMXClient类代码示例

本文整理汇总了Java中org.opendaylight.controller.config.util.ConfigRegistryJMXClient的典型用法代码示例。如果您正苦于以下问题:Java ConfigRegistryJMXClient类的具体用法?Java ConfigRegistryJMXClient怎么用?Java ConfigRegistryJMXClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConfigRegistryJMXClient类属于org.opendaylight.controller.config.util包,在下文中一共展示了ConfigRegistryJMXClient类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initConfigTransactionManagerImpl

import org.opendaylight.controller.config.util.ConfigRegistryJMXClient; //导入依赖的package包/类
protected void initConfigTransactionManagerImpl(final ModuleFactoriesResolver resolver) {

        final MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();

        this.configRegistryJMXRegistrator = new ConfigRegistryJMXRegistrator(platformMBeanServer);
        initBundleContext();

        this.baseJmxRegistrator = new BaseJMXRegistrator(platformMBeanServer);

        this.configRegistry = new ConfigRegistryImpl(resolver, platformMBeanServer, this.baseJmxRegistrator,
                new BindingContextProvider() {
                    @Override
                    public synchronized void update(final ClassLoadingStrategy classLoadingStrategy,
                            final SchemaContextProvider ctxProvider) {
                        // NOOP
                    }

                    @Override
                    public synchronized BindingRuntimeContext getBindingContext() {
                        return getBindingRuntimeContext();
                    }
                });
        this.notifyingConfigRegistry = new JMXNotifierConfigRegistry(this.configRegistry, platformMBeanServer);

        try {
            this.configRegistryJMXRegistrator.registerToJMXNoNotifications(this.configRegistry);
            this.configRegistryJMXRegistrator.registerToJMX(this.notifyingConfigRegistry);
        } catch (final InstanceAlreadyExistsException e) {
            throw new RuntimeException(e);
        }
        this.configRegistryClient = new ConfigRegistryJMXClient(platformMBeanServer);
        this.currentBundleContextServiceRegistrationHandler = new RecordingBundleContextServiceRegistrationHandler();
    }
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:34,代码来源:AbstractConfigTest.java

示例2: setup

import org.opendaylight.controller.config.util.ConfigRegistryJMXClient; //导入依赖的package包/类
@Before
@SuppressWarnings("IllegalCatch")
public void setup() throws Exception {
    String moduleName = getModuleName();
    String instanceName = getInstanceName();
    if (moduleName == null || instanceName == null) {
        return;
    }

    LOG.info("Module: {} Instance: {} attempting to configure.", moduleName, instanceName);
    Stopwatch stopWatch = Stopwatch.createStarted();
    ObjectName objectName = null;
    for (int i = 0; i < MODULE_TIMEOUT_MILLIS; i++) {
        try {
            ConfigRegistry configRegistryClient = new ConfigRegistryJMXClient(
                    ManagementFactory.getPlatformMBeanServer());
            objectName = configRegistryClient.lookupConfigBean(moduleName, instanceName);
            LOG.info("Module: {} Instance: {} ObjectName: {}.", moduleName, instanceName, objectName);
            break;
        } catch (final Exception e) {
            if (i < MODULE_TIMEOUT_MILLIS) {
                Thread.sleep(1);
                continue;
            } else {
                throw e;
            }
        }
    }
    if (objectName != null) {
        LOG.info("Module: {} Instance: {} configured after {} ms", moduleName, instanceName,
                stopWatch.elapsed(TimeUnit.MILLISECONDS));
    } else {
        throw new RuntimeException("NOT FOUND Module: " + moduleName + " Instance: " + instanceName
                + " configured after " + stopWatch.elapsed(TimeUnit.MILLISECONDS) + " ms");
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:37,代码来源:AbstractConfigTestBase.java

示例3: restartConfigModules

import org.opendaylight.controller.config.util.ConfigRegistryJMXClient; //导入依赖的package包/类
private void restartConfigModules(final List<Entry<String, ModuleIdentifier>> configModules,
        final ConfigSubsystemFacade configFacade) throws ParserConfigurationException, DocumentedException,
                ValidationException, ConflictingVersionException {

    Document document = XmlUtil.newDocument();
    Element dataElement = XmlUtil.createElement(document, XmlMappingConstants.DATA_KEY, Optional.<String>absent());
    Element modulesElement = XmlUtil.createElement(document, XmlMappingConstants.MODULES_KEY,
            Optional.of(XmlMappingConstants.URN_OPENDAYLIGHT_PARAMS_XML_NS_YANG_CONTROLLER_CONFIG));
    dataElement.appendChild(modulesElement);

    Config configMapping = configFacade.getConfigMapping();

    ConfigRegistry configRegistryClient = new ConfigRegistryJMXClient(ManagementFactory.getPlatformMBeanServer());
    for (Entry<String, ModuleIdentifier> entry : configModules) {
        String moduleNamespace = entry.getKey();
        ModuleIdentifier moduleId = entry.getValue();
        try {
            ObjectName instanceON = configRegistryClient.lookupConfigBean(moduleId.getFactoryName(),
                    moduleId.getInstanceName());

            LOG.debug("Found config module instance ObjectName: {}", instanceON);

            Element moduleElement = configMapping.moduleToXml(moduleNamespace, moduleId.getFactoryName(),
                    moduleId.getInstanceName(), instanceON, document);
            modulesElement.appendChild(moduleElement);
        } catch (final InstanceNotFoundException e) {
            LOG.warn("Error looking up config module: namespace {}, module name {}, instance {}",
                    moduleNamespace, moduleId.getFactoryName(), moduleId.getInstanceName(), e);
        }
    }

    if (LOG.isDebugEnabled()) {
        LOG.debug("Pushing config xml: {}", XmlUtil.toString(dataElement));
    }

    ConfigExecution execution = new ConfigExecution(configMapping, XmlElement.fromDomElement(dataElement),
            TestOption.testThenSet, EditStrategyType.recreate);
    configFacade.executeConfigExecution(execution);
    configFacade.commitSilentTransaction();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:41,代码来源:BlueprintContainerRestartServiceImpl.java

示例4: ConfigSubsystemFacadeFactory

import org.opendaylight.controller.config.util.ConfigRegistryJMXClient; //导入依赖的package包/类
public ConfigSubsystemFacadeFactory(final ConfigRegistryClient cfgRegClient,
        final ConfigRegistryJMXClient jmxClientNoNotifications, final YangStoreService yangStoreService) {
    this.cfgRegClient = cfgRegClient;
    this.cfgRegClientNoNotifications = jmxClientNoNotifications;
    this.yangStoreService = yangStoreService;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:ConfigSubsystemFacadeFactory.java


注:本文中的org.opendaylight.controller.config.util.ConfigRegistryJMXClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。