• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ServiceDependency类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getComponents

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
/**
 *  -- IMPLEMENT FUNCTIONS
 */
public List<ServiceDependency> getComponents(DependencyManager dm){
    List<ServiceDependency> components = new ArrayList<ServiceDependency>()   ;
    components.add(dm.createServiceDependency()
                    .setService(Radar.class)
                    .setRequired(true)
            );
    components.add(dm.createServiceDependency()
                    .setService(GPS.class)
                    .setRequired(true)
            );
    components.add(dm.createServiceDependency()
                    .setService(Engine.class)
                    .setRequired(true)
            );
    components.add(dm.createServiceDependency()
                    .setService(Gun.class)
                    .setRequired(true)
            );
    return components;
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:24,代码来源:SimpleTactic.java


示例2: handleDependencies

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
private void handleDependencies(Component component, Object service){
	Dependency annotation = service.getClass().getAnnotation(Dependency.class);
	if (annotation != null){
		ServiceDependency serviceDependency = manager.createServiceDependency();
		String filter = annotation.filter();
		if (StringUtils.isNotEmpty(filter)){
			serviceDependency.setService(annotation.serviceName(), filter);
		} else {
			serviceDependency.setService(annotation.serviceName());
		}
		serviceDependency.setRequired(annotation.mandatory());
		
		String added = StringUtils.isNotEmpty(annotation.addedCallbackMethod()) ? annotation.addedCallbackMethod() : null ;
		String changed = StringUtils.isNotEmpty(annotation.changedCallbackMethod()) ? annotation.changedCallbackMethod() : null ;
		String removed = StringUtils.isNotEmpty(annotation.removedCallbackMethod()) ? annotation.removedCallbackMethod() : null ;
		serviceDependency.setCallbacks(service, added, changed, removed);

		component.add(serviceDependency);
	}
}
 
开发者ID:beinformed,项目名称:osgitest,代码行数:21,代码来源:TestAnnotationProcessor.java


示例3: init

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@Override
public void init(BundleContext bundleContext, DependencyManager dependencyManager) throws Exception {
    Tactic tactic = new SimpleTactic();


    Component component = createComponent()
                           .setInterface(Tactic.class.getName(), null)
                           .setImplementation(tactic)
                           .setCallbacks("init", "startTactic", "stopTactic", "destroy");

    for(ServiceDependency dep : tactic.getComponents(dependencyManager)) {
        component.add(dep);
    }

    component.add(
        createServiceDependency()
        .setService(ArchitectureEventController.class)
        .setRequired(true)
    );

    component.add(
        createServiceDependency()
        .setService(Subscriber.class)
        .setRequired(true)
    );

    component.add(
        createServiceDependency()
        .setService(Discoverer.class)
        .setRequired(true)
    );

    component.add(
        createServiceDependency()
        .setService(DroneInit.class)
        .setRequired(true)
    );

    dependencyManager.add(component);
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:41,代码来源:Activator.java


示例4: setService

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@SuppressWarnings("rawtypes") // can't change org.apache.felix.dm.ServiceDependency
@Override
public ServiceDependency setService(Class serviceName) {
    this.m_dep.setService(serviceName, "(containerName="
            + this.containerName + ")");
    return this;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:8,代码来源:ContainerServiceDependency.java


示例5: ContainerServiceDependency

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
private ContainerServiceDependency(ServiceDependency explicitDependency,
        String containerName) {
    this.m_dep = explicitDependency;
    this.containerName = containerName;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:6,代码来源:ContainerServiceDependency.java


示例6: setDefaultImplementation

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@Override
public ServiceDependency setDefaultImplementation(Object implementation) {
    this.m_dep.setDefaultImplementation(implementation);
    return this;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:6,代码来源:ContainerServiceDependency.java


示例7: setRequired

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@Override
public ServiceDependency setRequired(boolean required) {
    this.m_dep.setRequired(required);
    return this;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:6,代码来源:ContainerServiceDependency.java


示例8: setAutoConfig

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@Override
public ServiceDependency setAutoConfig(boolean autoConfig) {
    this.m_dep.setAutoConfig(autoConfig);
    return this;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:6,代码来源:ContainerServiceDependency.java


示例9: setCallbacks

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@Override
public ServiceDependency setCallbacks(String added, String removed) {
    this.m_dep.setCallbacks(added, removed);
    return this;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:6,代码来源:ContainerServiceDependency.java


示例10: setPropagate

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@Override
public ServiceDependency setPropagate(boolean propagate) {
    this.m_dep.setPropagate(propagate);
    return this;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:6,代码来源:ContainerServiceDependency.java


示例11: setInstanceBound

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@Override
public ServiceDependency setInstanceBound(boolean isInstanceBound) {
    this.m_dep.setInstanceBound(isInstanceBound);
    return this;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:6,代码来源:ContainerServiceDependency.java


示例12: createCopy

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
@Override
public Dependency createCopy() {
    return new ContainerServiceDependency((ServiceDependency) this.m_dep
            .createCopy(), this.containerName);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:6,代码来源:ContainerServiceDependency.java


示例13: createContainerServiceDependency

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
/**
 * Return a ServiceDependency customized ad hoc for slicing, this
 * essentially the same org.apache.felix.dm.ServiceDependency just
 * with some filters pre-set
 *
 * @param containerName containerName for which we want to create the dependency
 *
 * @return a ServiceDependency
 */
protected ServiceDependency createContainerServiceDependency(
        String containerName) {
    return (new ContainerServiceDependency(this.dm, containerName));
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:14,代码来源:ComponentActivatorAbstractBase.java


示例14: createServiceDependency

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
/**
 * Return a ServiceDependency as provided by Dependency Manager as it's
 *
 *
 * @return a ServiceDependency
 */
protected ServiceDependency createServiceDependency() {
    return this.dm.createServiceDependency();
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:10,代码来源:ComponentActivatorAbstractBase.java


示例15: getComponents

import org.apache.felix.dm.ServiceDependency; //导入依赖的package包/类
public abstract Iterable<? extends ServiceDependency> getComponents(DependencyManager dependencyManager); 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:2,代码来源:Tactic.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ValidateEditException类代码示例发布时间:2022-05-22
下一篇:
Java CSVParser类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap