Home » Documentation » Apache Felix Subproject Documentation » Apache Felix Dependency Manager

Dependency Manager sample projects

You can download this archive which contains the following directories:

All samples can be built using either gradle or maven. To build with gradle, simply type "./gradlew jar", and to build with maven, type "mvn clean install". If you are using an http proxy, you must set the following environment:

Once built, the three jars for all hello projects can be put in the felix-framework-6.0.1/bundles/ directory. Now start felix like this:

cd felix-framework-6.0.1
java -jar bin/felix.jar

You should then see the following logs displayed to stdout:

HelloComponent started using Dependency Manager API
HelloComponent started using Dependency Manager Lambda
HelloComponent started using Dependency Manager Annotations

You can also play with the dm shell commands. First, type "help dm":

g! help dm

dm - List dependency manager components
   scope: dependencymanager
      compact, cp   Displays components using a compact form
      nodeps, nd   Hides component dependencies
      notavail, na   Only displays unavailable components
      stats, stat, st   Displays components statistics
      wtf   Detects where are the root failures
      bundleIds, bid, bi, b   <List of bundle ids or bundle symbolic names to display (comma separated)> [optional]
      componentIds, cid, ci   <List of component identifiers to display (comma separated)> [optional]
      components, c   <Regex(s) used to filter on component implementation class names (comma separated), can be negated using "!" prefix> [optional]
      services, s   <OSGi filter used to filter some service properties> [optional]
      top   <Max number of top components to display (0=all)> This command displays components callbacks (init/start) times> [optional]

Now type "dm" in order to see all dependency manager components:

 g! dm
[1] hello.annotations
 [3] hello.HelloComponent registered
[2] hello.api
 [0] hello.HelloComponent registered
[3] hello.lambda
 [1] hello.HelloComponent registered
[10] org.apache.felix.dependencymanager.runtime
 [2] org.apache.felix.dm.runtime.DependencyManagerRuntime registered
    active (DependencyManager-Component=*) bundle optional available
    org.osgi.service.packageadmin.PackageAdmin service required available
    org.osgi.service.log.LogService service optional unavailable
Rev. 1844708 by pderop on Tue, 23 Oct 2018 22:48:34 +0000
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.