Package org.jboss.osgi.framework

Examples of org.jboss.osgi.framework.BundleManagement


    @Override
    public void uninstallBundle(Deployment dep) {
        log.tracef("Uninstall deployment: %s", dep);

        // Always uninstall from the bundle manager
        BundleManagement bundleManager = injectedBundleManager.getValue();
        bundleManager.uninstallBundle(dep);

        try {
            // Undeploy through the deployment manager
            DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
            String contextName = DeploymentHolderService.getContextName(dep);
View Full Code Here


    @Override
    public void start(StartContext context) throws StartException {
        final Map<ServiceName, OSGiModule> pendingServices = new HashMap<ServiceName, OSGiModule>();
        try {
            final BundleManagement bundleManager = injectedBundleManager.getValue();
            final ServiceContainer serviceContainer = context.getController().getServiceContainer();
            final ServiceTarget serviceTarget = context.getChildTarget();
            final File modulesDir = injectedEnvironment.getValue().getModulesDir();
            final File bundlesDir = new File(modulesDir.getPath() + "/../bundles").getCanonicalFile();
            for (OSGiModule moduleMetaData : subsystemState.getModules()) {
                ServiceName serviceName;
                ModuleIdentifier identifier = moduleMetaData.getIdentifier();
                File bundleFile = getRepositoryEntry(bundlesDir, identifier);
                if (bundleFile != null) {
                    URL url = bundleFile.toURI().toURL();
                    BundleInfo info = BundleInfo.createBundleInfo(url);
                    Deployment dep = DeploymentFactory.createDeployment(info);
                    dep.setAutoStart(moduleMetaData.isStart());
                    serviceName = bundleManager.installBundle(serviceTarget, dep);
                }
                else {
                    ModuleLoader moduleLoader = Module.getBootModuleLoader();
                    Module module = moduleLoader.loadModule(identifier);
                    OSGiMetaData metadata = getModuleMetadata(module);
                    serviceName = bundleManager.installBundle(serviceTarget, module, metadata);
                }
                pendingServices.put(serviceName, moduleMetaData);
            }

            // Install a service that has a dependency on all pending bundle INSTALLED services
View Full Code Here

     */
    public synchronized void start(StartContext context) throws StartException {
        log.infof("Installing deployment: %s", deployment);
        try {
            ServiceTarget serviceTarget = context.getChildTarget();
            BundleManagement bundleManager = injectedBundleManager.getValue();
            installedBundleName = bundleManager.installBundle(serviceTarget, deployment);
            injectedStartTracker.getValue().addInstalledBundle(installedBundleName, deployment);
        } catch (Throwable t) {
            throw new StartException("Failed to install deployment: " + deployment, t);
        }
    }
View Full Code Here

     * @param context The stop context.
     */
    public synchronized void stop(StopContext context) {
        log.infof("Uninstalling deployment: %s", deployment);
        try {
            BundleManagement bundleManager = injectedBundleManager.getValue();
            bundleManager.uninstallBundle(deployment);
        } catch (Throwable t) {
            log.errorf(t, "Failed to uninstall deployment: %s", deployment);
        }

        // [JBAS-8801] Undeployment leaks root deployment service
View Full Code Here

TOP

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

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.