Package org.jboss.osgi.framework.spi

Examples of org.jboss.osgi.framework.spi.BundleManager


        @Override
        public void registerServices(final BundleContext syscontext) {

            // Inject the system bundle context into the runtime resource
            BundleManager bundleManager = injectedBundleManager.getValue();
            resource.getInjectedBundleManager().inject(bundleManager);

            // Register the socket-binding services
            String bindingNames = syscontext.getProperty(FrameworkBootstrapService.MAPPED_OSGI_SOCKET_BINDINGS);
            if (bindingNames != null) {
                final Set<ServiceName> socketBindingNames = new HashSet<ServiceName>();
                for (String suffix : bindingNames.split(",")) {
                    socketBindingNames.add(JBOSS_BINDING_NAME.append(suffix));
                }
                ServiceTarget serviceTarget = bundleManager.getServiceTarget();
                ServiceName serviceName = IntegrationServices.SYSTEM_SERVICES_PLUGIN.append("BINDINGS");
                ServiceBuilder<Void> builder = serviceTarget.addService(serviceName, new AbstractService<Void>() {
                    @Override
                    public void start(StartContext context) throws StartException {
                        for (ServiceName serviceName : socketBindingNames) {
View Full Code Here


        return new OSGiRuntimeResource(delegate.clone(), injectedBundleManager);
    }

    private boolean hasBundle(PathElement element) {
        boolean result = false;
        BundleManager bundleManager = injectedBundleManager.getOptionalValue();
        if (bundleManager != null) {
            Bundle bundle;
            try {
                Long bundleId = Long.parseLong(element.getValue());
                bundle = bundleManager.getBundleById(bundleId);
            } catch (NumberFormatException ex) {
                bundle = bundleManager.getBundleByLocation(element.getValue());
            }
            result = (bundle != null);
        }
        return result;
    }
View Full Code Here

        }
        return result;
    }

    private BundleContext getBundleContext() {
        BundleManager bundleManager = injectedBundleManager.getOptionalValue();
        BundleContext context = bundleManager != null ? bundleManager.getSystemBundle().getBundleContext() : null;
        if (context == null) {
            LOGGER.debugf("BundleContext not available for management operation");
        }
        return context;
    }
View Full Code Here

        @Override
        public void start(StartContext context) throws StartException {

            // Start the module capabilities that have a start level assigned
            BundleManager bundleManager = injectedBundleManager.getValue();
            for (OSGiCapability modcap : modulecaps) {
                if (modcap.getStartLevel() != null) {
                    String identifier = modcap.getIdentifier();
                    XBundle bundle = bundleManager.getBundleByLocation(identifier);
                    try {
                        bundle.start(Bundle.START_ACTIVATION_POLICY);
                    } catch (BundleException ex) {
                        LOGGER.errorCannotStartBundle(ex, bundle);
                    }
View Full Code Here

TOP

Related Classes of org.jboss.osgi.framework.spi.BundleManager

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.