Dependency Manager - Leveraging the shell :: Apache Felix Home Subprojects Dependency Manager Event Admin File Install Framework Gogo Shell Health Checks Inventory Log Logback Maven bundle plugin Maven SCR plugin Metatype Service Preferences Service Remote Shell Script console plugin Lightweight shell Shell TUI Web Console Downloads Documentation Documentation Downloads Getting Started News Community Apache Felix Project Info Contributing Projects Using Felix Development Coding Standards DEPENDENCIES file template Provisional OSGi API Policy Release Management Site How To Using the OSGi Compliance Tests FAQS Apache Felix Bundle Plugin Frequently Asked Questions Apache Felix SCR Plugin Frequently Asked Questions Subprojects Apache Felix Dependency Manager Guides Apache Felix Dependency Manager - Migrating from earlier versions Dependency Manager - Annotations Dependency Manager - Background Dependency Manager - Bundles and Dependencies Dependency Manager - Design Patterns Dependency Manager - Development Dependency Manager - History Dependency Manager - JavaDocs Dependency Manager - Migrating from other solutions. Dependency Manager - Performance Tuning Dependency Manager - Resource adapters Dependency Manager - What’s new in version 4? Dependency Manager Lambda What’s New in R15 Reference Dependency Manager - Adapter Dependency Manager - Aspect Dependency Manager - Bundle Adapter Dependency Manager - Bundle Dependency Dependency Manager - Components Dependency Manager - Configuration Dependency Dependency Manager - Dependencies Dependency Manager - External Links Dependency Manager - Factory Configuration Adapter Service Dependency Manager - Resource Adapter Dependency Manager - Resource Dependency Dependency Manager - Service Dependency Dependency Manager - Service Scopes Dependency Manager - Singleton Component Dependency Manager - Thread Model Dependency Manager Annotations Tutorials Dependency Manager - Annotations Dependency Manager - Getting Started Dependency Manager - Leveraging the shell Dependency Manager sample projects Apache Felix Event Admin Apache Felix File Install Apache Felix Framework Apache Felix Framework Bundle Cache Apache Felix Framework Configuration Properties Apache Felix Framework Frequently Asked Questions Apache Felix Framework Launching and Embedding Apache Felix Framework Usage Documentation Apache Felix Framework Security Apache Felix Gogo RFC 147 Overview Apache Felix Health Checks Apache Felix Inventory Printer Apache Felix Log Apache Felix Logback Apache Felix Maven Bundle Plugin (BND) Apache Felix Metatype Service Apache Felix OSGi Bundle Repository (OBR) Apache Felix Preferences Service Apache Felix Remote Shell Apache Felix Shell Apache Felix Shell TUI Apache Felix Web Console Extending the Apache Felix Web Console Web Console RESTful API Web Console Security Provider Extensions Branding the Web Console Providing Resources Providing Web Console Plugins Web Console Logging Web Console Output Templating Tutorials Apache Felix Application Demonstration Apache Felix OSGi Tutorial OSGi Frequently Asked Questions OSGI Tutorial Apache Felix Tutorial Example 1 - Service Event Listener Bundle Apache Felix Tutorial Example 2 Apache Felix Tutorial Example 2b Apache Felix Tutorial Example 3 Apache Felix Tutorial Example 4 Apache Felix Tutorial Example 5 Example 6 - Spell Checker Service Bundle Example 7 - Spell Checker Client Bundle Example 8 - Spell Checker Service using Service Binder Example 9 - Spell Checker Service using Declarative Services Apache License 2.0 Site map Documentation master Documentation master Documentation Subprojects Apache Felix Dependency Manager Tutorials Dependency Manager - Leveraging the shell Edit this Page Dependency Manager - Leveraging the shell The shell bundle for the dependency manager extends the gogo shell with one new command called "dm". This command can be used to get insight in the actual components and services in a running OSGi framework. Typing help help dm in the gogo shell gives an overview of the available command options. dm - List dependency manager components scope: dependencymanager flags: 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 options: 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] parameters: CommandSession Usage examples Below are some examples for typical usage of the dependency manager shell commands. The examples are based on a simple component model with a dashboard which has a required dependency on four probes (temperature, humidity, radiation, pressure). The radiation probe requires a Sensor service but this sensor is not available. List all dependency manager components dm Sample output: [9] dm.demo [6] dm.demo.Probe(type=radiation) unregistered dm.demo.Sensor service required unavailable [7] dm.demo.Probe(type=humidity) registered [9] dm.demo.impl.Dashboard unregistered dm.demo.Probe (type=temperature) service required available dm.demo.Probe (type=radiation) service required unavailable dm.demo.Probe (type=humidity) service required available dm.demo.Probe (type=pressure) service required available [5] dm.demo.Probe(type=temperature) registered [8] dm.demo.Probe(type=pressure) registered All components are listed including the dependencies and the availability of these dependencies. The top level element is the bundle and below are the components registered with that bundle’s bundle context. The lowest level is that of the component’s dependencies. [bundleid] bundle [component id] component interfaces (service properties) dependency <availability> The following flags can be used to tailor the output: compact, cp shortens package names and dependencies and therefore gives a more compressed output. nodeps, nd omits the dependencies from the output. notavail, na filters out all components that are registered wich results in the output only containing those components that are in the unregistered state due to one or more unsatisfied required dependencies. This is the command option most used when using the dependency manager shell commands. Sample output for dm na: [9] dm.demo [14] dm.demo.impl.Dashboard unregistered dm.demo.Probe (type=radiation) service required unavailable [11] dm.demo.Probe(type=radiation) unregistered dm.demo.Sensor service required unavailable The flags can be used in conjunction with the other command options. Find all components for a given classname dm c .*ProbeImpl dm c or components finds all components for which the classname of the implementation matches the regular expression. Find all services matching a service filter dm s "(type=temperature)" dm s allows finding components based on the service properties of their registered services in the service registry using a standard OSGi service filter. Find out why components are not registered dm wtf Sample output: 2 missing dependencies found. ----------------------------- The following service(s) are missing: * dm.demo.Sensor is not found in the service registry wtf gives the root cause for components not being registered and therefore their services not being available. In a typical application components have dependencies on services implemented by components that have dependencies on services etcetera. This transitivity means that an entire chain of components could be unregistered due to a (few) root dependencies not being satisfied. wtf is about discovering those dependencies. Content licensed under AL2. UI licensed under MPL-2.0 with extensions licensed under AL2