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


Java IConfigurationContainerAware类代码示例

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


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

示例1: saveConfiguration

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
@Override
public Status saveConfiguration() {
    boolean success = true;
    for (IConfigurationContainerAware configurationAware : configurationAwareList) {
        logger.info("Save Config triggered for {}",
                  configurationAware.getClass().getSimpleName());

        Status status = configurationAware.saveConfiguration();
        if (!status.isSuccess()) {
            success = false;
            logger.info("Failed to save config for {}",
                            configurationAware.getClass().getSimpleName());
        }
    }
    if (success) {
        return new Status(StatusCode.SUCCESS, null);
    } else {
        return new Status(StatusCode.INTERNALERROR,
                    "Failed to Save All Configurations");
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:22,代码来源:ConfigurationContainerImpl.java

示例2: configureInstance

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
 * Function that is called when configuration of the dependencies
 * is required.
 *
 * @param c dependency manager Component object, used for
 * configuring the dependencies exported and imported
 * @param imp Implementation class that is being configured,
 * needed as long as the same routine can configure multiple
 * implementations
 * @param containerName The containerName being configured, this allow
 * also optional per-container different behavior if needed, usually
 * should not be the case though.
 */
public void configureInstance(Component c, Object imp, String containerName) {
    if (imp.equals(StaticRoutingImplementation.class)) {
        Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
        Set<String> propSet = new HashSet<String>();
        propSet.add("forwarding.staticrouting.configSaveEvent");
        props.put("cachenames", propSet);
        // export the service

        c.setInterface(new String[] { ICacheUpdateAware.class.getName(),
                IForwardingStaticRouting.class.getName(),
                IfNewHostNotify.class.getName(),
                IConfigurationContainerAware.class.getName() }, props);

        c.add(createContainerServiceDependency(containerName).setService(
                IClusterContainerServices.class).setCallbacks(
                "setClusterContainerService",
                "unsetClusterContainerService").setRequired(true));

        c.add(createContainerServiceDependency(containerName).setService(
                IfIptoHost.class).setCallbacks("setHostTracker",
                "unsetHostTracker").setRequired(true));

        // Static routing aware there could be many
        c.add(createContainerServiceDependency(containerName).setService(
                IStaticRoutingAware.class).setCallbacks(
                "setStaticRoutingAware", "unsetStaticRoutingAware")
                .setRequired(false));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:43,代码来源:Activator.java

示例3: configureInstance

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
 * Function that is called when configuration of the dependencies
 * is required.
 *
 * @param c dependency manager Component object, used for
 * configuring the dependencies exported and imported
 * @param imp Implementation class that is being configured,
 * needed as long as the same routine can configure multiple
 * implementations
 * @param containerName The containerName being configured, this allow
 * also optional per-container different behavior if needed, usually
 * should not be the case though.
 */
public void configureInstance(Component c, Object imp, String containerName) {
    if (imp.equals(SwitchManagerImpl.class)) {
        Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
        Set<String> propSet = new HashSet<String>();
        propSet.add("switchmanager.configSaveEvent");
        props.put("cachenames", propSet);
        // export the service
        c.setInterface(new String[] {
                IListenInventoryUpdates.class.getName(),
                ISwitchManager.class.getName(),
                ICacheUpdateAware.class.getName(),
                IConfigurationContainerAware.class.getName() }, props);

        // Now lets add a service dependency to make sure the
        // provider of service exists
        c.add(createContainerServiceDependency(containerName).setService(
                IInventoryService.class).setCallbacks(
                "setInventoryService", "unsetInventoryService")
                .setRequired(false));
        c.add(createContainerServiceDependency(containerName).setService(
                ISwitchManagerAware.class).setCallbacks(
                "setSwitchManagerAware", "unsetSwitchManagerAware")
                .setRequired(false));
        c.add(createContainerServiceDependency(containerName).setService(
                IInventoryListener.class).setCallbacks(
                "setInventoryListener", "unsetInventoryListener")
                .setRequired(false));
        c.add(createContainerServiceDependency(containerName).setService(
                ISpanAware.class).setCallbacks("setSpanAware",
                "unsetSpanAware").setRequired(false));
        c.add(createContainerServiceDependency(containerName).setService(
                IClusterContainerServices.class).setCallbacks(
                "setClusterContainerService",
                "unsetClusterContainerService").setRequired(true));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:50,代码来源:Activator.java

示例4: configureInstance

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
 * Function that is called when configuration of the dependencies is
 * required.
 *
 * @param c
 *            dependency manager Component object, used for configuring the
 *            dependencies exported and imported
 * @param imp
 *            Implementation class that is being configured, needed as long
 *            as the same routine can configure multiple implementations
 * @param containerName
 *            The containerName being configured, this allow also optional
 *            per-container different behavior if needed, usually should not
 *            be the case though.
 */
@Override
public void configureInstance(Component c, Object imp, String containerName) {
    if (imp.equals(ForwardingRulesManager.class)) {
        String interfaces[] = null;
        Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
        Set<String> propSet = new HashSet<String>();
        propSet.add("frm.flowsSaveEvent");
        props.put("cachenames", propSet);

        // export the service
        interfaces = new String[] { IContainerListener.class.getName(), ISwitchManagerAware.class.getName(),
                IForwardingRulesManager.class.getName(), IInventoryListener.class.getName(),
                ICacheUpdateAware.class.getName(), IConfigurationContainerAware.class.getName(),
                IFlowProgrammerListener.class.getName() };

        c.setInterface(interfaces, props);

        c.add(createContainerServiceDependency(containerName).setService(IFlowProgrammerService.class)
                .setCallbacks("setFlowProgrammerService", "unsetFlowProgrammerService").setRequired(true));
        c.add(createContainerServiceDependency(containerName).setService(IClusterContainerServices.class)
                .setCallbacks("setClusterContainerService", "unsetClusterContainerService").setRequired(true));
        c.add(createContainerServiceDependency(containerName).setService(ISwitchManager.class)
                .setCallbacks("setSwitchManager", "unsetSwitchManager").setRequired(true));
        c.add(createContainerServiceDependency(containerName).setService(IForwardingRulesManagerAware.class)
                .setCallbacks("setFrmAware", "unsetFrmAware").setRequired(false));
        c.add(createContainerServiceDependency(containerName).setService(IContainer.class)
                .setCallbacks("setIContainer", "unsetIContainer").setRequired(true));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:45,代码来源:Activator.java

示例5: configureInstance

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
 * Function that is called when configuration of the dependencies
 * is required.
 *
 * @param c dependency manager Component object, used for
 * configuring the dependencies exported and imported
 * @param imp Implementation class that is being configured,
 * needed as long as the same routine can configure multiple
 * implementations
 * @param containerName The containerName being configured, this allow
 * also optional per-container different behavior if needed, usually
 * should not be the case though.
 */
public void configureInstance(Component c, Object imp, String containerName) {
    if (imp.equals(ConfigurationContainerImpl.class)) {
        // export the service
        c.setInterface(new String[] {
                IConfigurationContainerService.class.getName(),
                IConfigurationAware.class.getName() }, null);

        c.add(createContainerServiceDependency(containerName).setService(
                IConfigurationContainerAware.class).setCallbacks(
                        "addConfigurationContainerAware",
                        "removeConfigurationContainerAware").setRequired(false));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:27,代码来源:Activator.java

示例6: configureInstance

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
/**
 * Function that is called when configuration of the dependencies
 * is required.
 *
 * @param c dependency manager Component object, used for
 * configuring the dependencies exported and imported
 * @param imp Implementation class that is being configured,
 * needed as long as the same routine can configure multiple
 * implementations
 * @param containerName The containerName being configured, this allow
 * also optional per-container different behavior if needed, usually
 * should not be the case though.
 */
public void configureInstance(Component c, Object imp, String containerName) {
    if (imp.equals(TopologyManagerImpl.class)) {
        // export the service needed to listen to topology updates
        Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
        Set<String> propSet = new HashSet<String>();
        propSet.add("topologymanager.configSaveEvent");
        props.put("cachenames", propSet);

        c.setInterface(new String[] { IListenTopoUpdates.class.getName(),
                ITopologyManager.class.getName(),
                IConfigurationContainerAware.class.getName() }, props);

        c.add(createContainerServiceDependency(containerName).setService(
                ITopologyService.class).setCallbacks("setTopoService",
                "unsetTopoService").setRequired(true));

        // These are all the listeners for a topology manager
        // updates, there could be many or none
        c.add(createContainerServiceDependency(containerName).setService(
                ITopologyManagerAware.class).setCallbacks(
                "setTopologyManagerAware", "unsetTopologyManagerAware")
                .setRequired(false));

        c.add(createContainerServiceDependency(containerName).setService(
                IClusterContainerServices.class).setCallbacks(
                "setClusterContainerService",
                "unsetClusterContainerService").setRequired(true));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:43,代码来源:Activator.java

示例7: addConfigurationContainerAware

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
public void addConfigurationContainerAware(
        IConfigurationContainerAware configurationAware) {
    if (!this.configurationAwareList.contains(configurationAware)) {
        this.configurationAwareList.add(configurationAware);
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:7,代码来源:ConfigurationContainerImpl.java

示例8: removeConfigurationContainerAware

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
public void removeConfigurationContainerAware(
        IConfigurationContainerAware configurationAware) {
    this.configurationAwareList.remove(configurationAware);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:5,代码来源:ConfigurationContainerImpl.java

示例9: testAddRemoveSaveConfiguration

import org.opendaylight.controller.configuration.IConfigurationContainerAware; //导入依赖的package包/类
@Test
public void testAddRemoveSaveConfiguration() {

        ConfigurationContainerImpl configurationContainerImpl = new ConfigurationContainerImpl();
        IConfigurationContainerAware testConfigurationContainerAware = new ConfigurationContainerAwareTest();

        configurationContainerImpl.addConfigurationContainerAware(testConfigurationContainerAware);
        configurationContainerImpl.addConfigurationContainerAware(testConfigurationContainerAware);

        Assert.assertEquals(1, configurationContainerImpl.getConfigurationAwareListSize());

        IConfigurationContainerAware testConfigurationAware1 = new ConfigurationContainerAwareTest();
        configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware1);

        Assert.assertEquals(2, configurationContainerImpl.getConfigurationAwareListSize());

        IConfigurationContainerAware testConfigurationAware2 = new ConfigurationContainerAwareTest();
        configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware2);

        Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());

        IConfigurationContainerAware testConfigurationAware3 = new ConfigurationContainerAwareTest();
        configurationContainerImpl.addConfigurationContainerAware(testConfigurationAware3);

        Assert.assertEquals(4, configurationContainerImpl.getConfigurationAwareListSize());

        configurationContainerImpl.removeConfigurationContainerAware(testConfigurationContainerAware);
        Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());

        configurationContainerImpl.removeConfigurationContainerAware(testConfigurationContainerAware);
        Assert.assertEquals(3, configurationContainerImpl.getConfigurationAwareListSize());

        configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware3);
        Assert.assertEquals(2, configurationContainerImpl.getConfigurationAwareListSize());

        configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware2);
        Assert.assertEquals(1, configurationContainerImpl.getConfigurationAwareListSize());

        configurationContainerImpl.removeConfigurationContainerAware(testConfigurationAware1);
        Assert.assertEquals(0, configurationContainerImpl.getConfigurationAwareListSize());


}
 
开发者ID:lbchen,项目名称:ODL,代码行数:44,代码来源:ConfigurationContainerImplTest.java


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