Package org.osgi.framework

Examples of org.osgi.framework.BundleException


      axisAdmin.init();
      Hashtable props = new Hashtable();
      props.put(Axis2Admin.SOAP_SERVICE_NAME, "Axis2Admin");
      aaReg = bc.registerService(Axis2Admin.class.getName(), axisAdmin, props);
    } catch (Exception e) {
      throw new BundleException("Failed to init axis2", e);
    }
  }
View Full Code Here


   */
  public static Bundle installBundle(BundleContext bc, String resource) throws BundleException {
    try {
      URL url = bc.getBundle().getResource(resource);
      if(url == null) {
        throw new BundleException("No resource " + resource);
      }
      InputStream in = url.openStream();
      if(in == null) {
        throw new BundleException("No resource " + resource);
      }
      return bc.installBundle("internal:" + resource, in);
    } catch (IOException e) {
      throw new BundleException("Failed to get input stream for " + resource + ": " + e);
    }
  }
View Full Code Here

   */
  public static Bundle installBundle(BundleContext bc, String resource) throws BundleException {
    try {
      URL url = bc.getBundle().getResource(resource);
      if(url == null) {
        throw new BundleException("No resource " + resource);
      }
      InputStream in = url.openStream();
      if(in == null) {
        throw new BundleException("No resource " + resource);
      }
      return bc.installBundle("internal:" + resource, in);
    } catch (IOException e) {
      throw new BundleException("Failed to get input stream for " + resource + ": " + e);
    }
  }
View Full Code Here

        String args = (String)bc.getBundle().getHeaders().get(BUNDLE_START_EXECUTABLE_ARGS);
        runProcess = runFile(startFile, args, false,
                             isProcessExitMeansStopBundle());
      }
    } catch (IOException e) {
      throw new BundleException("Failed to init", e);
    }
  }
View Full Code Here

      if(stopFile != null) {
        String args = (String)bc.getBundle().getHeaders().get(BUNDLE_STOP_EXECUTABLE_ARGS);
        runFile(stopFile, args, true, false);
      }
    } catch (Exception e) {
      throw new BundleException("Failed to stop bundle process", e);
    } finally {
      this.bc = null;
    }
  }
View Full Code Here

      ConditionalPermissionAdmin cpa =
        (ConditionalPermissionAdmin) bc.getService(sRef);
    
      installPolicies(cpa, ENCODED_PINFO);
    } else {
      throw new BundleException("Bundle CPA-test can not start, There is no "
          + "ConditinalPermissionAdmin service");
    }
  }
View Full Code Here

        try {
            is.mark(256 * 1024);
            JarInputStream jar = new JarInputStream(is);
            Manifest m = jar.getManifest();
            if(m == null) {
                throw new BundleException("Manifest not present in the first entry of the zip " + bundleLocation);
            }
            String sn = m.getMainAttributes().getValue(Constants.BUNDLE_SYMBOLICNAME);
            String vStr = m.getMainAttributes().getValue(Constants.BUNDLE_VERSION);
            Version v = vStr == null ? Version.emptyVersion : Version.parseVersion(vStr);
            for (Bundle b : bundleContext.getBundles()) {
View Full Code Here

        m_valid = false;
    }

    public void addRequirement(String s) throws BundleException
    {
        throw new BundleException("Not implemented yet.");
    }
View Full Code Here

        throw new BundleException("Not implemented yet.");
    }

    public void removeRequirement() throws BundleException
    {
        throw new BundleException("Not implemented yet.");
    }
View Full Code Here

        throw new BundleException("Not implemented yet.");
    }

    public void addCapability() throws BundleException
    {
        throw new BundleException("Not implemented yet.");
    }
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.