Package org.apache.felix.dm.diagnostics
Class DependencyGraph
java.lang.Object
org.apache.felix.dm.diagnostics.DependencyGraph
The dependency graph is a view of all components managed by the dependency manager
and of their dependencies. Using this API you can get the dependencies of a given component,
the components providing a given service, the circular dependencies that might exist.
- Author:
- Felix Project Team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumUse this to specify which components the dependency graph should containstatic enumUse this to specify which dependencies the graph should contain -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of components in the graphReturns a list all dependencies in the graphReturns the list of circular dependencies in the graphgetDependecies(ComponentDeclaration componentDeclaration) For a given component declaration, it returns a list of its dependencies in the state specified when the graph was built.static DependencyGraphgetGraph(DependencyGraph.ComponentState componentState, DependencyGraph.DependencyState dependencyState) Build the dependency graph.Returns all custom missing dependencies.getMissingDependencies(String type) Returns all the missing dependencies of a given type.getProviders(ComponentDependencyDeclaration dependency) Returns the list of components that provide the given dependency.
-
Method Details
-
getGraph
public static DependencyGraph getGraph(DependencyGraph.ComponentState componentState, DependencyGraph.DependencyState dependencyState) Build the dependency graph. It will contain all the components managed by the dependency manager, provided that those components are in the given state, and all dependencies of their dependencies, provided that the dependencies are in the given state.This implementation currently only builds a graph of unregistered components and required unavailable dependencies.
- Parameters:
componentState- Include only the components in this statedependencyState- Include only the dependencies in this state- Returns:
-
getAllComponents
Returns the list of components in the graph- Returns:
- the list of components in the graph
-
getAllDependencies
Returns a list all dependencies in the graph- Returns:
- the list of all dependencies in the graph
-
getDependecies
public List<ComponentDependencyDeclaration> getDependecies(ComponentDeclaration componentDeclaration) For a given component declaration, it returns a list of its dependencies in the state specified when the graph was built.- Parameters:
componentDeclaration-- Returns:
- the list of dependencies or null if the component declaration is not in the graph
-
getProviders
Returns the list of components that provide the given dependency. This only returns the components managed by the dependency manager that are in the state specified when the graph was built. The dependency can only be a service dependency.- Parameters:
dependency-- Returns:
- the list of components providing this dependency or null if the dependency declaration is not in the graph
-
getCircularDependencies
Returns the list of circular dependencies in the graph- Returns:
- the list of circular dependencies
-
getMissingDependencies
Returns all the missing dependencies of a given type.- Parameters:
type- The type of the dependencies to be returned. This can be either one of the types known by the DependencyManager (service, bundle, configuration, resource), a user defined type or null, in which case all missing dependencies must be returned.- Returns:
- The missing dependencies of the given type or all the missing dependencies.
-
getMissingCustomDependencies
Returns all custom missing dependencies. Custom dependencies are not 'out of the box' dependencies (service, resource, bundle, configuration).- Returns:
- The missing dependencies which are not 'out of the box dependencies'.
-