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


Java IClusterGlobalServices类代码示例

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


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

示例1: configureGlobalInstance

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
/**
 * Configure the dependency for a given instance Global
 *
 * @param c Component assigned for this instance, this will be
 * what will be used for configuration
 * @param imp implementation to be configured
 * @param containerName container on which the configuration happens
 */
protected void configureGlobalInstance(Component c, Object imp) {
    if (imp.equals(ConfigurationImpl.class)) {
        Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
        Set<String> propSet = new HashSet<String>();
        propSet.add("config.event.save");
        props.put("cachenames", propSet);

        // export the service
        c.setInterface(
                new String[] { IConfigurationService.class.getName(),
                        ICacheUpdateAware.class.getName()},
                        props);

        c.add(createServiceDependency().setService(
                IClusterGlobalServices.class).setCallbacks(
                        "setClusterServices", "unsetClusterServices").setRequired(
                                true));

        c.add(createServiceDependency().setService(
                IConfigurationAware.class).setCallbacks(
                        "addConfigurationAware", "removeConfigurationAware")
                        .setRequired(false));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:33,代码来源:Activator.java

示例2: getScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
public static AbstractScheme getScheme(ConnectionMgmtScheme scheme, IClusterGlobalServices clusterServices) {
    if (scheme == ConnectionMgmtScheme.SINGLE_CONTROLLER) {
        return SingleControllerScheme.getScheme(clusterServices);
    } else if (scheme == ConnectionMgmtScheme.ROUND_ROBIN) {
        return RoundRobinScheme.getScheme(clusterServices);
    } else if (scheme == ConnectionMgmtScheme.LOAD_BALANCED) {
        return LoadBalancedScheme.getScheme(clusterServices);
    } else if (scheme == ConnectionMgmtScheme.ANY_CONTROLLER_ONE_MASTER) {
        return AnyControllerScheme.getScheme(clusterServices);
    }
    return null;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:13,代码来源:SchemeFactory.java

示例3: AbstractScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
protected AbstractScheme(IClusterGlobalServices clusterServices, ConnectionMgmtScheme type) {
    this.clusterServices = clusterServices;
    if (type != null) name = type.name();
    else name = "UNKNOWN";
    if (clusterServices != null) {
        allocateCaches();
        retrieveCaches();
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:10,代码来源:AbstractScheme.java

示例4: configureGlobalInstance

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
/**
 * Configure the dependency for a given instance Global
 *
 * @param c Component assigned for this instance, this will be
 * what will be used for configuration
 * @param imp implementation to be configured
 * @param containerName container on which the configuration happens
 */
protected void configureGlobalInstance(Component c, Object imp) {
    if (imp.equals(ConnectionManager.class)) {
        Dictionary<String, Object> props = new Hashtable<String, Object>();
        Set<String> propSet = new HashSet<String>();
        propSet.add("connectionmanager.nodeconnections");
        props.put("cachenames", propSet);
        props.put("scope", "Global");

        // export the service
        c.setInterface(new String[] { IConnectionManager.class.getName(),
                                      IConnectionListener.class.getName(),
                                      ICoordinatorChangeAware.class.getName(),
                                      IListenInventoryUpdates.class.getName(),
                                      ICacheUpdateAware.class.getName()},
                                      props);

        c.add(createServiceDependency()
                .setService(IClusterGlobalServices.class)
                .setCallbacks("setClusterServices", "unsetClusterServices")
                .setRequired(true));

        c.add(createServiceDependency().setService(IConnectionService.class)
                .setCallbacks("setConnectionService", "unsetConnectionService")
                .setRequired(true));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:35,代码来源:Activator.java

示例5: configureGlobalInstance

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
/**
 * Configure the dependency for a given instance Global
 *
 * @param c Component assigned for this instance, this will be
 * what will be used for configuration
 * @param imp implementation to be configured
 * @param containerName container on which the configuration happens
 */
protected void configureGlobalInstance(Component c, Object imp) {
    if (imp.equals(ContainerManager.class)) {

        // export the service
        c.setInterface(new String[] { IContainerManager.class.getName() },
                null);

        c.add(createServiceDependency().setService(
                IClusterGlobalServices.class).setCallbacks(
                "setClusterServices", "unsetClusterServices").setRequired(
                true));

        // Key kick-starter for container creation in each component
        c.add(createServiceDependency().setService(IContainerAware.class)
                .setCallbacks("setIContainerAware", "unsetIContainerAware")
                .setRequired(false));

        // Optional interface expected to be exported by the
        // protocol plugins to setup proper filtering based on
        // slicing events
        c.add(createServiceDependency()
                .setService(IContainerListener.class).setCallbacks(
                        "setIContainerListener", "unsetIContainerListener")
                .setRequired(false));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:35,代码来源:Activator.java

示例6: areWeReady

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
@Before
public void areWeReady() {
    assertNotNull(bc);
    boolean debugit = false;
    Bundle b[] = bc.getBundles();
    for (int i = 0; i < b.length; i++) {
        int state = b[i].getState();
        if (state != Bundle.ACTIVE && state != Bundle.RESOLVED) {
            log.debug("Bundle:" + b[i].getSymbolicName() + " state:"
                      + stateToString(state));
            debugit = true;
        }
    }
    if (debugit) {
        log.debug("Do some debugging because some bundle is "
                  + "unresolved");
    }

    // Assert if true, if false we are good to go!
    assertFalse(debugit);

    this.clusterServices = (IClusterServices)ServiceHelper
        .getGlobalInstance(IClusterServices.class, this);
    assertNotNull(this.clusterServices);

    this.clusterDefaultServices = (IClusterContainerServices)ServiceHelper
        .getInstance(IClusterContainerServices.class, "default", this);
    assertNotNull(this.clusterDefaultServices);

    this.clusterGlobalServices = (IClusterGlobalServices)ServiceHelper
        .getGlobalInstance(IClusterGlobalServices.class, this);
    assertNotNull(this.clusterGlobalServices);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:34,代码来源:ClusteringServicesIT.java

示例7: configureGlobalInstance

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的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
 */
@Override
public void configureGlobalInstance(Component c, Object imp) {
    if (imp.equals(ClusterManager.class)) {
        // export the service for Apps and Plugins
        c.setInterface(new String[] { IClusterServices.class.getName(), IContainerAware.class.getName() }, null);
    }

    if (imp.equals(ClusterGlobalManager.class)) {
        c.setInterface(new String[] { IClusterGlobalServices.class.getName() }, null);

        c.add(createServiceDependency()
              .setService(IClusterServices.class)
              .setCallbacks("setClusterService", "unsetClusterService")
              .setRequired(true));

        // CacheUpdate services will be none or many so the
        // dependency is optional
        c.add(createServiceDependency()
              .setService(ICacheUpdateAware.class)
              .setCallbacks("setCacheUpdateAware", "unsetCacheUpdateAware")
              .setRequired(false));

        // Coordinator change event can be one or many so
        // dependency is optional
        c.add(createServiceDependency()
              .setService(ICoordinatorChangeAware.class)
              .setCallbacks("setCoordinatorChangeAware", "unsetCoordinatorChangeAware")
              .setRequired(false));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:41,代码来源:Activator.java

示例8: configureGlobalInstance

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
/**
 * Configure the dependency for a given instance Global
 *
 * @param c Component assigned for this instance, this will be
 * what will be used for configuration
 * @param imp implementation to be configured
 * @param containerName container on which the configuration happens
 */
protected void configureGlobalInstance(Component c, Object imp) {
    if (imp.equals(UserManagerImpl.class)) {
        // export the service
        Dictionary<String, Set<String>> props = new Hashtable<String, Set<String>>();
        Set<String> propSet = new HashSet<String>();
        propSet.add("usermanager.localUserSaveConfigEvent");
        propSet.add("usermanager.remoteServerSaveConfigEvent");
        propSet.add("usermanager.authorizationSaveConfigEvent");
        props.put("cachenames", propSet);

        // export the service
        c.setInterface(new String[] { ICacheUpdateAware.class.getName(),
                IUserManager.class.getName(),
                IConfigurationAware.class.getName() }, props);

        c.add(createServiceDependency().setService(
                IClusterGlobalServices.class).setCallbacks(
                "setClusterGlobalService", "unsetClusterGlobalService")
                .setRequired(true));

        c.add(createServiceDependency().setService(IAAAProvider.class)
                .setCallbacks("addAAAProvider", "removeAAAProvider")
                .setRequired(false));

        c.add(createServiceDependency().setService(
                IContainerAuthorization.class).setCallbacks(
                "setContainerAuthClient", "unsetContainerAuthClient")
                .setRequired(false));

        c.add(createServiceDependency().setService(
                IResourceAuthorization.class).setCallbacks(
                "setAppAuthClient", "unsetAppAuthClient")
                .setRequired(false));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:44,代码来源:Activator.java

示例9: SingleControllerScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
protected SingleControllerScheme(IClusterGlobalServices clusterServices) {
    super(clusterServices, ConnectionMgmtScheme.SINGLE_CONTROLLER);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:4,代码来源:SingleControllerScheme.java

示例10: getScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
public static AbstractScheme getScheme(IClusterGlobalServices clusterServices) {
    if (myScheme == null) {
        myScheme = new SingleControllerScheme(clusterServices);
    }
    return myScheme;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:7,代码来源:SingleControllerScheme.java

示例11: LoadBalancedScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
protected LoadBalancedScheme(IClusterGlobalServices clusterServices) {
    super(clusterServices, ConnectionMgmtScheme.LOAD_BALANCED);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:4,代码来源:LoadBalancedScheme.java

示例12: getScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
public static AbstractScheme getScheme(IClusterGlobalServices clusterServices) {
    return null;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:4,代码来源:LoadBalancedScheme.java

示例13: RoundRobinScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
protected RoundRobinScheme(IClusterGlobalServices clusterServices) {
    super(clusterServices, ConnectionMgmtScheme.ROUND_ROBIN);
    // TODO Auto-generated constructor stub
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:5,代码来源:RoundRobinScheme.java

示例14: AnyControllerScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
protected AnyControllerScheme(IClusterGlobalServices clusterServices) {
    super(clusterServices, ConnectionMgmtScheme.ANY_CONTROLLER_ONE_MASTER);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:4,代码来源:AnyControllerScheme.java

示例15: getScheme

import org.opendaylight.controller.clustering.services.IClusterGlobalServices; //导入依赖的package包/类
public static AbstractScheme getScheme(IClusterGlobalServices clusterServices) {
    if (myScheme == null) {
        myScheme = new AnyControllerScheme(clusterServices);
    }
    return myScheme;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:7,代码来源:AnyControllerScheme.java


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