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


Java Component.getServiceProperties方法代码示例

本文整理汇总了Java中org.apache.felix.dm.Component.getServiceProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Component.getServiceProperties方法的具体用法?Java Component.getServiceProperties怎么用?Java Component.getServiceProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.felix.dm.Component的用法示例。


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

示例1: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
void init(Component c) {
    Dictionary props = c.getServiceProperties();
    if (props != null) {
        this.containerName = (String) props.get("containerName");
        logger.debug("Running containerName: {}", this.containerName);
    } else {
        // In the Global instance case the containerName is empty
        this.containerName = "";
    }
    if (this.clusterService != null) {
        this.coordinatorChangeListener = new ListenCoordinatorChange();
        try {
            this.clusterService
                    .listenRoleChange(this.coordinatorChangeListener);
            logger.debug("Coordinator change handler registered");
        } catch (ListenRoleChangeAddException ex) {
            logger.error("Could not register coordinator change");
        }
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:26,代码来源:ClusterManagerCommon.java

示例2: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
void init(Component c) {

    allocateCaches();
    retrieveCaches();

    String containerName = null;
    Dictionary<?, ?> props = c.getServiceProperties();
    if (props != null) {
        containerName = (String) props.get("containerName");
    } else {
        // In the Global instance case the containerName is empty
        containerName = "UNKNOWN";
    }

    userLinksFileName = ROOT + "userTopology_" + containerName + ".conf";
    registerWithOSGIConsole();
    loadConfiguration();
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:24,代码来源:TopologyManagerImpl.java

示例3: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
@SuppressWarnings("rawtypes")
void init(Component c) {
    logger.trace("INIT called!");

    Dictionary props = c.getServiceProperties();
    if (props != null) {
        containerName = (String) props.get("containerName");
        if (containerName != null) {
            isDefaultContainer = containerName.equals(GlobalConstants.DEFAULT
                    .toString());
        }
    }

    nodeProps = new ConcurrentHashMap<Node, Map<String, Property>>();
    nodeConnectorProps = new ConcurrentHashMap<NodeConnector, Map<String, Property>>();
    pluginOutInventoryServices = new CopyOnWriteArraySet<IPluginOutInventoryService>();
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:23,代码来源:InventoryService.java

示例4: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
void init(Component c) {
    String containerName = null;
    Dictionary props = c.getServiceProperties();
    if (props != null) {
        containerName = (String) props.get("containerName");
    } else {
        // In the Global instance case the containerName is empty
        containerName = "";
    }

    staticRoutesFileName = ROOT + "staticRouting_" + containerName
            + ".conf";

    log.debug("forwarding.staticrouting starting on container {}",
              containerName);
    //staticRoutes = new ConcurrentHashMap<String, StaticRoute>();
    allocateCaches();
    retrieveCaches();
    this.executor = Executors.newFixedThreadPool(1);
    if (staticRouteConfigs.isEmpty())
        loadConfiguration();

    /*
     *  Slow probe to identify any gateway that might have silently appeared
     *  after the Static Routing Configuration.
     */
    gatewayProbeTimer = new Timer();
    gatewayProbeTimer.schedule(new TimerTask() {
        @Override
        public void run() {
            for (StaticRoute s : staticRoutes.values()) {
                if ((s.getType() == StaticRoute.NextHopType.IPADDRESS)
                        && s.getHost() == null) {
                    checkAndUpdateListeners(s, true);
                }
            }
        }
    }, 60 * 1000, 60 * 1000);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:45,代码来源:StaticRoutingImplementation.java

示例5: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
void init(Component c) {
    Dictionary<?, ?> props = c.getServiceProperties();
    if (props != null) {
        this.containerName = (String) props.get("containerName");
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:12,代码来源:ContainerImpl.java

示例6: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
void init(Component c) {
    Dictionary props = c.getServiceProperties();
    if (props != null) {
        this.containerName = (String) props.get("containerName");
        logger.debug("Running containerName: {}", this.containerName);
    } else {
        // In the Global instance case the containerName is empty
        this.containerName = "";
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:16,代码来源:ClusterManagerCommon.java

示例7: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
void init(Component c) {
    Dictionary<?, ?> props = c.getServiceProperties();
    if (props != null) {
        this.containerName = (String) props.get("containerName");
        log.trace("Running containerName: {}", this.containerName);
    } else {
        // In the Global instance case the containerName is empty
        this.containerName = "";
    }
    isDefaultContainer = containerName.equals(GlobalConstants.DEFAULT
            .toString());

    startUp();
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:20,代码来源:SwitchManagerImpl.java

示例8: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
void init(Component c) {
    Dictionary<?, ?> props = c.getServiceProperties();
    if (props != null) {
        this.containerName = (String) props.get("containerName");
        logger.debug("Running containerName: {}", this.containerName);
    } else {
        // In the Global instance case the containerName is empty
        this.containerName = "";
    }
    startUp();
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:17,代码来源:HostTracker.java

示例9: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
@SuppressWarnings("unchecked")
void init(Component c) {
    Dictionary<Object, Object> props = c.getServiceProperties();
    containerName = (props != null) ? (String) props.get("containerName")
            : null;
    pluginOutReadServices = new CopyOnWriteArraySet<IPluginOutReadService>();
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:13,代码来源:ReadService.java

示例10: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
@SuppressWarnings("unchecked")
void init(Component c) {
    logger.trace("INIT called!");
    Dictionary<Object, Object> props = c.getServiceProperties();
    containerName = (props != null) ? (String) props.get("containerName")
            : null;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:13,代码来源:TopologyServices.java

示例11: init

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Function called by the dependency manager when all the required
 * dependencies are satisfied
 *
 */
void init(Component c) {
    Dictionary<?, ?> props = c.getServiceProperties();
    if (props != null) {
        this.containerName = (String) props.get("containerName");

        lbsLogger.info("Running container name:" + this.containerName);
    }else {

        // In the Global instance case the containerName is empty
        this.containerName = "";
    }
    lbsLogger.info(configManager.toString());
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:19,代码来源:LoadBalancerService.java

示例12: containerCreate

import org.apache.felix.dm.Component; //导入方法依赖的package包/类
/**
 * Method of IContainerAware called when a new container is available
 *
 * @param containerName Container being created
 */
@Override
public void containerCreate(String containerName) {
    try {
        Object[] imps = getImplementations();
        logger.trace("Creating instance {}", containerName);
        if (imps != null) {
            for (int i = 0; i < imps.length; i++) {
                ImmutablePair<String, Object> key = new ImmutablePair<String, Object>(
                        containerName, imps[i]);
                Component c = this.dbInstances.get(key);
                if (c == null) {
                    c = this.dm.createComponent();
                    c.addStateListener(new ListenerComponentStates());
                    // Now let the derived class to configure the
                    // dependencies it wants
                    configureInstance(c, imps[i], containerName);
                    // Set the implementation so the component can manage
                    // its lifecycle
                    if (c.getService() == null) {
                        logger.trace("Setting implementation to: {}",
                                      imps[i]);
                        c.setImplementation(imps[i]);
                    }

                    //Set the service properties to include the containerName
                    //in the service, that is fundamental for supporting
                    //multiple services just distinguished via a container
                    Dictionary<String, String> serviceProps = c
                            .getServiceProperties();
                    if (serviceProps != null) {
                        logger.trace("Adding new property for container");
                        serviceProps.put("containerName", containerName);
                    } else {
                        logger
                                .trace("Create a new properties for the service");
                        serviceProps = new Hashtable<String, String>();
                        serviceProps.put("containerName", containerName);
                    }
                    c.setServiceProperties(serviceProps);

                    // Now add the component to the dependency Manager
                    // which will immediately start tracking the dependencies
                    this.dm.add(c);

                    //Now lets keep track in our shadow database of the
                    //association
                    this.dbInstances.put(key, c);
                } else {
                    logger
                            .error("I have been asked again to create an instance "
                                    + "on: "
                                    + containerName
                                    + "for object: "
                                    + imps[i]
                                    + "when i already have it!!");
                }
            }
        }
    } catch (Exception ex) {
        logger
                .error("During containerDestroy invocation caught exception: "
                        + ex
                        + "\nStacktrace:"
                        + stackToString(ex.getStackTrace()));
    }
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:72,代码来源:ComponentActivatorAbstractBase.java


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