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


Java ServiceDependency类代码示例

本文整理汇总了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;未经允许,请勿转载。