use of org.apache.felix.ipojo.handlers.dependency.DependencyDescription in project felix by apache.
the class Dependency method getDependencyDescription.
/**
* Gets the dependency description object attached to
* this dependency.
* @param instance the instance on which searching the dependency
* @return the dependency description attached to this dependency or
* <code>null</code> if the dependency cannot be found.
*/
public DependencyDescription getDependencyDescription(ComponentInstance instance) {
PrimitiveInstanceDescription desc = (PrimitiveInstanceDescription) instance.getInstanceDescription();
if (m_id != null) {
return desc.getDependency(m_id);
}
if (m_specification != null) {
return desc.getDependency(m_specification);
}
DependencyDescription[] deps = desc.getDependencies();
if (deps.length == 1) {
return deps[0];
}
// Cannot determine the dependency.
return null;
}
Aggregations