DependencyManager manager = iterator.next();
List<Component> complist = manager.getComponents();
Iterator<Component> componentIterator = complist.iterator();
while (componentIterator.hasNext()) {
Component component = componentIterator.next();
ComponentDeclaration sc = (ComponentDeclaration) component;
String name = sc.getName();
// check if this component is enabled or disabled.
if (!mayDisplay(component, servicesFilter, componentsRegex, cids)) {
continue;
}
int state = sc.getState();
Bundle bundle = sc.getBundleContext().getBundle();
if (matchBundle(bundle, bids)) {
long bundleId = bundle.getBundleId();
if (notavail) {
if (sc.getState() != ComponentDeclaration.STATE_UNREGISTERED) {
continue;
}
}
numberOfComponents++;
if (lastBundleId != bundleId) {
lastBundleId = bundleId;
if (comp) {
System.out.println("[" + bundleId + "] " + compactName(bundle.getSymbolicName()));
} else {
System.out.println("[" + bundleId + "] " + bundle.getSymbolicName());
}
}
if (comp) {
System.out.print(" [" + sc.getId() + "] " + compactName(name) + " "
+ compactState(ComponentDeclaration.STATE_NAMES[state]));
} else {
System.out.println(" [" + sc.getId() + "] " + name + " "
+ ComponentDeclaration.STATE_NAMES[state]);
}
if (!nodeps) {
ComponentDependencyDeclaration[] dependencies = sc.getComponentDependencies();
if (dependencies != null && dependencies.length > 0) {
numberOfDependencies += dependencies.length;
if (comp) {
System.out.print('(');
}