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

Java DependencyManager类代码示例

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

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



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

示例1: getComponents

import org.apache.felix.dm.DependencyManager; //导入依赖的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: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext bundleContext, DependencyManager dependencyManager) throws Exception {
    dependencyManager.add(createComponent()
            .setInterface(Gun.class.getName(), null)
            .setImplementation(Gun.class)
            .add(createServiceDependency()
                    .setService(DroneInit.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                    .setService(Publisher.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                    .setService(GPS.class)
                    .setRequired(true)
            )
            .setCallbacks("init", "start", "stop", "destroy")
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:21,代码来源:Activator.java


示例3: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext bundleContext, DependencyManager dependencyManager) throws Exception {
    dependencyManager.add(createComponent()
            .setInterface(org.inaetics.dronessimulator.drone.components.engine.Engine.class.getName(), null)
            .setImplementation(Engine.class)
            .add(createServiceDependency()
                    .setService(DroneInit.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                    .setService(Publisher.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                    .setService(GPS.class)
                    .setRequired(true)
            )
            .setCallbacks("init", "start", "stop", "destroy")
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:21,代码来源:Activator.java


示例4: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext bundleContext, DependencyManager dependencyManager) throws Exception {
    dependencyManager.add(createComponent()
            .setInterface(Radio.class.getName(), null)
            .setImplementation(Radio.class)
            .add(createServiceDependency()
                    .setService(DroneInit.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                    .setService(Publisher.class)
                    .setRequired(true)
            ).add(createServiceDependency()
                    .setService(Subscriber.class)
                    .setRequired(true)
            ).setCallbacks("init", "start", "stop", "destroy")
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:19,代码来源:Activator.java


示例5: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext bundleContext, DependencyManager dependencyManager) throws Exception {
    dependencyManager.add(createComponent()
            .setInterface(Radar.class.getName(), null)
            .setImplementation(Radar.class)
            .add(createServiceDependency()
                    .setService(DroneInit.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                    .setService(Subscriber.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                    .setService(Discoverer.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                .setService(ArchitectureEventController.class)
                .setRequired(true)
            )
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:24,代码来源:Activator.java


示例6: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext bundleContext, DependencyManager dependencyManager) throws Exception {
    dependencyManager.add(createComponent()
        .setInterface(IPhysicsEngineDriver.class.getName(), null)
        .setImplementation(PhysicsEngineDriver.class)
        .add(createServiceDependency()
            .setService(IPhysicsEngine.class)
            .setRequired(true)
        )
        .add(createServiceDependency()
            .setService(IGameStateManager.class)
            .setRequired(true)
        )
        .add(createServiceDependency()
            .setService(IdentifierMapper.class)
            .setRequired(true)
        )
        .add(createServiceDependency()
            .setService(ArchitectureEventController.class)
            .setRequired(true)
        )
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:24,代码来源:Activator.java


示例7: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext bundleContext, DependencyManager dependencyManager) throws Exception {
    dependencyManager.add(
        createComponent()
        .setInterface(IRuleProcessors.class.getName(), null)
        .setImplementation(RuleProcessors.class)
        .setCallbacks("init", "start", "quit", "destroy")
        .add(createServiceDependency()
             .setService(IPhysicsEngineDriver.class)
             .setRequired(true)
         )
         .add(createServiceDependency()
              .setService(Publisher.class)
              .setRequired(true)
         )
         .add(createServiceDependency()
              .setService(IdentifierMapper.class)
              .setRequired(true)
         )
         .add(createServiceDependency()
              .setService(ArchitectureEventController.class)
              .setRequired(true)
         )

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


示例8: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext bc, DependencyManager manager) throws Exception {
  Properties properties = new Properties();
  properties.setProperty(Constants.SERVICE_PID, PID);

  manager.add(createComponent()
      .setInterface(new String[]{
              DeviceDriverManager.class.getName(),
              ManagedService.class.getName()},
          properties)
      .setImplementation(DriverManagerImpl.class)
      .add(createServiceDependency()
          .setService(DirectoryService.class)
          .setRequired(true))
      .add(createConfigurationDependency().setPid(PID)));
}
 
开发者ID:semiotproject,项目名称:semiot-platform,代码行数:17,代码来源:Activator.java


示例9: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext bc, DependencyManager manager) throws Exception {
  //RemoveServiceImpl
  manager.add(createComponent()
      .setInterface(Object.class.getName(), new Properties())
      .setImplementation(RemoveServiceImpl.class)
      .add(createServiceDependency()
          .setService(DeviceDriverManager.class)
          .setRequired(true)));

  //StatusResource
  manager.add(createComponent()
      .setInterface(Object.class.getName(), new Properties())
      .setImplementation(StatusResource.class));

  //CommandAPI
  manager.add(createComponent()
      .setInterface(Object.class.getName(), new Properties())
      .setImplementation(CommandAPI.class)
      .add(createServiceDependency()
          .setService(DeviceDriverManager.class)
          .setRequired(true)));
}
 
开发者ID:semiotproject,项目名称:semiot-platform,代码行数:24,代码来源:Activator.java


示例10: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext context, DependencyManager manager) throws Exception {

    manager.add(createComponent().setInterface(UserDAO.class.getName(), null)
            .setImplementation(UserDAOMockImpl.class));

    manager.add(createComponent().setInterface(UUIDLocationDAO.class.getName(), null)
            .setImplementation(UUIDLocationDAOMockImpl.class));

    manager.add(createComponent().setInterface(UUIDWiFiProfileDAO.class.getName(), null)
            .setImplementation(UUIDWiFiProfileDAOMockImpl.class));

    manager.add(createComponent().setInterface(LocationProfileDAO.class.getName(), null)
            .setImplementation(LocationProfileDAOMockImpl.class));

    manager.add(createComponent().setInterface(RawLocationProfileDAO.class.getName(), null)
            .setImplementation(RawLocationProfileDAOMockImpl.class));
}
 
开发者ID:INAETICS,项目名称:AILS_Demonstrator,代码行数:19,代码来源:DAOActivator.java


示例11: destroy

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void destroy(BundleContext context, DependencyManager manager) throws Exception {
    logger.info("Hobson core is shutting down");

    unregisterRestletApplication(ApiV1Application.API_ROOT);
    unregisterRestletApplication("");

    for (org.apache.felix.dm.Component c : registeredComponents) {
        manager.remove(c);
    }

    component.stop();

    if (presenceTracker != null) {
        presenceTracker.close();
    }
    if (applicationTracker != null) {
        applicationTracker.close();
    }
    if (hubManagerTracker != null) {
        hubManagerTracker.close();
    }
}
 
开发者ID:whizzosoftware,项目名称:hobson-hub-core,代码行数:24,代码来源:Activator.java


示例12: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(final BundleContext context, final DependencyManager manager) throws Exception
{
    System.out.println(context.getBundle().getSymbolicName() + " started");

    Dictionary props = new Hashtable();
    props.put("service.pid", Client.class.getCanonicalName());

    client = new Client();

    manager.add(createComponent()
            .setInterface(Object.class.getName(), props)
            .setImplementation(client)
            .add(createServiceDependency().setService(ChannelFactory.class).setRequired(false))
            .add(createServiceDependency().setService(Stat.class).setRequired(true))
    );
}
 
开发者ID:bandesz,项目名称:gradle-osgi-demo,代码行数:18,代码来源:Activator.java


示例13: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext context, DependencyManager manager)
		throws Exception {
	
	manager.add(createComponent()
					.setImplementation(ProcessDefinitionDeployerImpl.class)
					.setInterface(ProcessDefinitionDeployer.class.getName(), null)
					.add(createServiceDependency()
							.setService(ProcessEngine.class)
							.setRequired(true)));
	
	manager.add(createComponent()
					.setImplementation(ProcessDefinitionCheckerImpl.class)
					.add(createBundleDependency()
							.setCallbacks("checkBundle","checkBundle", "bundleRemoved"))
					.add(createServiceDependency()
							.setService(ProcessDefinitionDeployer.class)
							.setRequired(true)));

	manager.add(createComponent()
					.setImplementation(ScriptEngineBundleScanner.class)
					.add(createBundleDependency()
							.setCallbacks("addBundle", "modifiedBundle", "removedBundle")));
	
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform-osgi,代码行数:26,代码来源:Activator.java


示例14: assertAllTestSuitesAvailable

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
/**
 * Asserts that there are no unavailable TestSuites due to missing dependencies.
 * @param monitor
 */
public void assertAllTestSuitesAvailable(TestMonitor monitor) {
	Map<String, List<String>> missingTestSuitesAndDeps = new LinkedHashMap<String, List<String>>();

	List<DependencyManager> managers = DependencyManager.getDependencyManagers();
	for (DependencyManager manager : managers) {
		for (Object componentObject : new ArrayList<Object>(manager.getComponents())) {
			Component component = (Component) componentObject;

			for (DependencyContext dependencyContext : ((ComponentContext)component).getDependencies()) {
				if (dependencyContext.isRequired() && !dependencyContext.isAvailable()) {
					String componentName = ((ComponentDeclaration) component).getName();
					if (componentName.contains(TestSuite.class.getName())) {
						addMissingTestSuite(missingTestSuitesAndDeps, component, dependencyContext);
					}

				}
			}
		}
	}

	if (!missingTestSuitesAndDeps.isEmpty()) {
		reportMissingTestSuites(monitor, missingTestSuitesAndDeps);
	}
}
 
开发者ID:beinformed,项目名称:osgitest,代码行数:29,代码来源:AllTestSuitesAvailableAsserter.java


示例15: setup

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void setup(final DependencyManager dependencyManager) {
	LOGGER.info("setup...");
	new Thread(() -> {
		LOGGER.info("pausing component publishing...");
		try {
			Thread.sleep(2000);
		} catch (Exception e) {
		}
		LOGGER.info("publising component...");
		Properties properties = new Properties();
		properties.setProperty("key", "bla");
		dependencyManager.add(dependencyManager.createComponent()
				.setImplementation(this)
				.setInterface(Object.class.getName(), properties));
	}).start();
}
 
开发者ID:beinformed,项目名称:osgitest,代码行数:18,代码来源:MyBaseClassBasedLifecycleTestSuite.java


示例16: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext ctx, DependencyManager manager)
		throws Exception {
	
	manager.add(manager.createComponent().setInterface(TestSuite.class.getName(), null)
			.setImplementation(SimpleCodedTestSuite.class));
	
	manager.add(manager.createComponent().setInterface(MyAnnotationBasedTestSuite.class.getName(), null)
			.setImplementation(MyAnnotationBasedTestSuite.class));
	
	TestSuite testSuite = new MyBaseClassBasedTestSuite("My base class based testsuite");
	manager.add(manager.createComponent().setInterface(TestSuite.class.getName(), null)
			.setImplementation(testSuite));
	
	TestSuite lifecycleTestSuite = new MyBaseClassBasedLifecycleTestSuite("My base class lifecycle based testsuite");
	manager.add(manager.createComponent().setInterface(TestSuite.class.getName(), null)
			.setImplementation(lifecycleTestSuite));
	
	TestSuite lifecycleTestSuiteUnresolvableDependency = new MyBaseClassBasedLifecycleTestSuiteWithUnresolvableDependency("My base class lifecycle based testsuite with unresolvable dependency.");
	manager.add(manager.createComponent().setInterface(TestSuite.class.getName(), null)
			.setImplementation(lifecycleTestSuiteUnresolvableDependency));
}
 
开发者ID:beinformed,项目名称:osgitest,代码行数:23,代码来源:Activator.java


示例17: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext context, DependencyManager manager) throws Exception {
    // Register discoverer service
    manager.add(createComponent()
            .setImplementation(ArchitectureManager.class)
            .add(createServiceDependency()
                    .setService(Discoverer.class)
                    .setRequired(true)
            )
            .add(createServiceDependency()
                    .setService(Subscriber.class)
                    .setRequired(true)
            )
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:16,代码来源:Activator.java


示例18: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
public void init(BundleContext bundleContext, DependencyManager dependencyManager) throws Exception {
    dependencyManager.add(
        createComponent()
        .setInterface(ArchitectureEventController.class.getName(), null)
        .setImplementation(ArchitectureEventControllerService.class)
        .add(
            createServiceDependency()
            .setService(Discoverer.class)
            .setRequired(true)
        )
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:13,代码来源:Activator.java


示例19: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext context, DependencyManager manager) throws Exception {
    manager.add(createComponent()
            .setInterface(Publisher.class.getName(), null)
            .setImplementation(RabbitPublisher.class)
            .add(createServiceDependency()
                    .setService(Serializer.class)
                    .setRequired(true))
            .add(createConfigurationDependency()
                    .setPid("rabbitmq.broker.default")
                    .setRequired(true)
                    .setCallback("setConfig"))
            .setCallbacks("init", "connect", "disconnect", "destroy") // Init and destroy do not actually exist
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:16,代码来源:Activator.java


示例20: init

import org.apache.felix.dm.DependencyManager; //导入依赖的package包/类
@Override
public void init(BundleContext context, DependencyManager manager) throws Exception {
    manager.add(createComponent()
            .setInterface(Subscriber.class.getName(), null)
            .setImplementation(RabbitSubscriber.class)
            .add(createServiceDependency()
                    .setService(Serializer.class)
                    .setRequired(true))
            .add(createConfigurationDependency()
                    .setPid("rabbitmq.broker.default")
                    .setRequired(true)
                    .setCallback("setConfig"))
            .setCallbacks("init", "connect", "disconnect", "destroy") // Init and destroy do not actually exist
    );
}
 
开发者ID:INAETICS,项目名称:Drones-Simulator,代码行数:16,代码来源:Activator.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java CPropertyInfo类代码示例发布时间:2022-05-22
下一篇:
Java BitmapTextMultiline类代码示例发布时间: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