Package org.apache.felix.dm

Examples of org.apache.felix.dm.ComponentDeclaration


                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('(');
                                }
View Full Code Here


        if (hasMissingType(downComponentsRoot, SERVICE)) {
            System.out.println("The following service(s) are missing: ");
            for (ComponentId s : downComponentsRoot) {
                if (SERVICE.equals(s.getType())) {
                    System.out.print(" * " + s.getName());
                    ComponentDeclaration component = getComponentDeclaration(s.getName(), downComponents);
                    if (component == null) {
                        System.out.println(" is not found in the service registry");
                    } else {
                        ComponentDependencyDeclaration[] componentDependencies = component.getComponentDependencies();
                        System.out.println(" and needs:");
                        for (ComponentDependencyDeclaration cdd : componentDependencies) {
                            if (cdd.getState() == ComponentDependencyDeclaration.STATE_UNAVAILABLE_REQUIRED) {
                                System.out.println(cdd.getName());
                            }
View Full Code Here

                    result.add(new ComponentId(cdd.getName(), cdd.getType(), bsn));
                    continue;
                }

                // Detect if the missing dependency is a root cause failure
                ComponentDeclaration component = getComponentDeclaration(cdd.getName(), downComponents);
                if (component == null) {
                    result.add(new ComponentId(cdd.getName(), cdd.getType(), null));
                    continue;
                }
                // Detect circular dependency
View Full Code Here

TOP

Related Classes of org.apache.felix.dm.ComponentDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.