Package org.jboss.osgi.framework

Examples of org.jboss.osgi.framework.AutoInstallComplete


                if (installInitialModuleCapability(configcap))
                    iterator.remove();
            }

            final Set<ServiceName> resolvableServices = new LinkedHashSet<ServiceName>();
            AutoInstallComplete installComplete = new AutoInstallComplete() {

                @Override
                protected boolean allServicesAdded(Set<ServiceName> trackedServices) {
                    return configcaps.size() == trackedServices.size();
                }

                @Override
                public void start(StartContext context) throws StartException {
                    // Resolve all bundles up until and including the Framework beginning start level
                    Set<Bundle> resolvableBundles = new LinkedHashSet<Bundle>();
                    ServiceContainer serviceContainer = context.getController().getServiceContainer();
                    for (ServiceName serviceName : resolvableServices) {
                        ServiceController<?> requiredService = serviceContainer.getRequiredService(serviceName);
                        resolvableBundles.add((Bundle) requiredService.getValue());
                    }
                    Bundle[] bundleArr = resolvableBundles.toArray(new Bundle[resolvableBundles.size()]);
                    PackageAdmin packageAdmin = injectedPackageAdmin.getValue();
                    packageAdmin.resolveBundles(bundleArr);
                    super.start(context);
                }
            };
            installComplete.install(context.getChildTarget());
            ServiceListener<Bundle> listener = installComplete.getListener();

            for (OSGiCapability configcap : configcaps) {
                ServiceName serviceName = installInitialCapability(configcap, listener);
                int startLevel = configcap.getStartLevel() != null ? configcap.getStartLevel() : 1;
                if (serviceName != null && startLevel <= beginningStartLevel) {
View Full Code Here

TOP

Related Classes of org.jboss.osgi.framework.AutoInstallComplete

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.