Package org.osgi.framework

Examples of org.osgi.framework.BundleException


              if ((m_state == Bundle.STOPPING) || m_state == Bundle.RESOLVED) {
                return;

              }
              else if (m_state != Bundle.ACTIVE) {
                throw new BundleException("Can't stop pojosr because it is not ACTIVE");
              }
              final Bundle systemBundle = this;
              Runnable r = new Runnable() {

          public void run() {
View Full Code Here


    public BundleDescription addBundle(File bundleLocation, boolean override) throws BundleException {
        if (bundleLocation == null || !bundleLocation.exists())
            throw new IllegalArgumentException("bundleLocation not found: " + bundleLocation);
        Dictionary manifest = loadManifestAttributes(bundleLocation);
        if (manifest == null) {
            throw new BundleException("Manifest not found in " + bundleLocation);
        }
        return addBundle(manifest, bundleLocation, override);
    }
View Full Code Here

        return (MavenProject)getUserProperty(desc, PROP_MAVEN_PROJECT);
    }

    public void assertResolved(BundleDescription desc) throws BundleException {
        if (!desc.isResolved()) {
            throw new BundleException("Bundle cannot be resolved: " + desc);
        }
    }
View Full Code Here

    protected void applicationStart() throws BundleException {
        try {
            installer.getConfigurationManager().loadConfiguration(configId);
            installer.getConfigurationManager().startConfiguration(configId);
        } catch (Exception e) {
            throw new BundleException("Failed to start application", e);           
        }
    }
View Full Code Here

   
    protected void applicationStop() throws BundleException {
        try {
            installer.getConfigurationManager().unloadConfiguration(configId);
        } catch (Exception e) {
            throw new BundleException("Failed to start application", e);           
        }
    }
View Full Code Here

        GeronimoApplicationContext applicationContext = contextMap.get(key);
        if (applicationContext == null) {
            try {
                getApplicationInstaller().install(app);
            } catch (Exception e) {
                throw new BundleException("Application installation failed", e);
            }
            // if application was successfully installed & started it
            // should have registered its ApplicationContext by now
            applicationContext = contextMap.get(key);
            if (applicationContext == null) {
View Full Code Here

                String resolverErrors = errorAnalyzer.getErrorsAsString(Arrays.asList(bundles));
                if (resolverErrors != null) {
                    builder.append(" ").append(resolverErrors);
                }
               
                throw new BundleException(builder.toString());
            }
           
            Set<Bundle> dependents = new HashSet<Bundle>();
            collectDependentBundles(packageAdmin, dependents, targetBundle);
            if (!dependents.isEmpty()) {
View Full Code Here

            String message = MessageFormat.format("Error starting {0} application. {1}",
                                                  application.getApplicationMetadata().getApplicationScope(),
                                                  rootMessage);
           
            if (getFailOnStartError()) {
                throw new BundleException(message, rootException);
            } else {
                LOG.error(message, rootException);
            }
        }       
    }   
View Full Code Here

        bundle.setBundleContext(bundleContext);
        configurationData.setBundleContext(bundleContext);
        try {
            configurationManager.loadConfiguration(configurationData);
        } catch (NoSuchConfigException e) {
            throw (BundleException)new BundleException("").initCause(e);
        } catch (LifecycleException e) {
            throw (BundleException)new BundleException("").initCause(e);
        }
        return bundle;
    }
View Full Code Here

    private BundleHandle installBundle(String groupId, String artifactId, String version, boolean startBundle) throws BundleException, IOException {
        String filespec = groupId + ":" + artifactId + ":jar:" + version;
        File[] resolved = Maven.resolver().resolve(filespec).withoutTransitivity().asFile();
        if (resolved == null || resolved.length == 0)
            throw new BundleException("Cannot obtain maven artifact: " + filespec);
        if (resolved.length > 1)
            throw new BundleException("Multiple maven artifacts for: " + filespec);

        URL fileURL = resolved[0].toURI().toURL();
        BundleHandle handle = installBundle(filespec, fileURL);
        if (startBundle) {
            frameworkMBean.startBundle(handle.getBundleId());
View Full Code Here

TOP

Related Classes of org.osgi.framework.BundleException

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.