Examples of BundleLoader


Examples of org.eclipse.osgi.framework.internal.core.BundleLoader

  }

  public BaseClassLoader createClassLoader(ClassLoader parent,
      ClassLoaderDelegate delegate, BundleProtectionDomain domain,
      BaseData data, String[] bundleclasspath) {
    BundleLoader loader = (BundleLoader) delegate;
    try {
      loader.addDynamicImportPackage(ManifestElement.parseHeader(
          Constants.DYNAMICIMPORT_PACKAGE, analyzer
              .getRuntimePackages()));
    } catch (BundleException be) {
      throw new RuntimeException(be);
    }
View Full Code Here

Examples of org.eclipse.osgi.framework.internal.core.BundleLoader

  public BaseClassLoader createClassLoader(ClassLoader parent,
      ClassLoaderDelegate delegate, BundleProtectionDomain domain,
      BaseData data, String[] bundleclasspath) {
    if (analyzer.shouldInstrumentClassesInBundle(data.getSymbolicName())) {
      BundleLoader loader = (BundleLoader) delegate;
      try {
        loader.addDynamicImportPackage(ManifestElement.parseHeader(
            Constants.DYNAMICIMPORT_PACKAGE, analyzer
                .getRuntimePackages()));
      } catch (BundleException be) {
        throw new RuntimeException(be);
      }
View Full Code Here

Examples of org.eclipse.osgi.internal.loader.BundleLoader

    // this is needed to fix bug 259903.
    for (int i = 0; i < bundles.length; i++) {
      // only need to do this for host bundles which are resolved
      if (bundles[i] instanceof BundleHost && bundles[i].isResolved()) {
        // getting the BundleLoader object populates the require-bundle sources
        BundleLoader loader = ((BundleHost) bundles[i]).getBundleLoader();
        if (loader != null)
          // need to explicitly get the import package sources
          loader.getImportedSources(null);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.osgi.internal.loader.BundleLoader

  public byte[] processClass(String name, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager) {
    ServiceRegistry registry = getRegistry();
    if (registry == null)
      return null; // no registry somehow we are loading classes before the registry has been created
    ClassLoaderDelegate delegate = manager.getBaseClassLoader().getDelegate();
    BundleLoader loader;
    if (delegate instanceof BundleLoader) {
      loader = (BundleLoader) delegate;
    } else {
      Throwable e = new IllegalStateException("Could not obtain loader"); //$NON-NLS-1$
      adaptor.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, manager.getBaseData().getBundle(), e);
View Full Code Here

Examples of org.eclipse.osgi.internal.loader.BundleLoader

        Debug.println("Bundle.checkLoader() called when state != STARTING | ACTIVE | STOPPING | RESOLVED: " + this); //$NON-NLS-1$
        Debug.printStackTrace(new Exception("Stack trace")); //$NON-NLS-1$
      }
    }

    BundleLoader loader = getBundleLoader();
    if (loader == null) {
      if (Debug.DEBUG_GENERAL) {
        Debug.println("Bundle.checkLoader() called when loader == null: " + this); //$NON-NLS-1$
        Debug.printStackTrace(new Exception("Stack trace")); //$NON-NLS-1$
      }
View Full Code Here

Examples of org.eclipse.osgi.internal.loader.BundleLoader

        framework.checkAdminPermission(this, AdminPermission.CLASS);
      } catch (SecurityException e) {
        throw new ClassNotFoundException(name, e);
      }
    }
    BundleLoader loader = checkLoader();
    if (loader == null)
      throw new ClassNotFoundException(NLS.bind(Msg.BUNDLE_CNFE_NOT_RESOLVED, name, getBundleData().getLocation()));
    try {
      return (loader.loadClass(name));
    } catch (ClassNotFoundException e) {
      // this is to support backward compatibility in eclipse
      // we always attempted to start a bundle even if the class was not found
      if (!(e instanceof StatusException) && (bundledata.getStatus() & Constants.BUNDLE_LAZY_START) != 0 && !testStateChanging(Thread.currentThread()))
        try {
          // only start the bundle if this is a simple CNFE
          loader.setLazyTrigger();
        } catch (BundleException be) {
          framework.adaptor.getFrameworkLog().log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.WARNING, 0, be.getMessage(), 0, be, null));
        }
      throw e;
    }
View Full Code Here

Examples of org.eclipse.osgi.internal.loader.BundleLoader

   * the <tt>AdminPermission</tt>, and the Java Runtime Environment supports permissions.
   *
   * @exception java.lang.IllegalStateException If this bundle has been uninstalled.
   */
  public URL getResource(String name) {
    BundleLoader loader = null;
    try {
      framework.checkAdminPermission(this, AdminPermission.RESOURCE);
    } catch (SecurityException ee) {
      return null;
    }
    loader = checkLoader();
    if (loader == null) {
      Enumeration<URL> result = bundledata.findLocalResources(name);
      if (result != null && result.hasMoreElements())
        return result.nextElement();
      return null;
    }
    return loader.findResource(name);
  }
View Full Code Here

Examples of org.eclipse.osgi.internal.loader.BundleLoader

    }
    return loader.findResource(name);
  }

  public Enumeration<URL> getResources(String name) throws IOException {
    BundleLoader loader = null;
    try {
      framework.checkAdminPermission(this, AdminPermission.RESOURCE);
    } catch (SecurityException ee) {
      return null;
    }
    Enumeration<URL> result;
    loader = checkLoader();
    if (loader == null)
      result = bundledata.findLocalResources(name);
    else
      result = loader.getResources(name);
    if (result != null && result.hasMoreElements())
      return result;
    return null;
  }
View Full Code Here

Examples of org.eclipse.osgi.internal.loader.BundleLoader

  }

  private synchronized boolean isLazyTriggerSet() {
    if (proxy == null)
      return false;
    BundleLoader loader = proxy.getBasicBundleLoader();
    return loader != null ? loader.isLazyTriggerSet() : false;
  }
View Full Code Here

Examples of org.eclipse.osgi.internal.loader.BundleLoader

   * return true if the fragment successfully attached; false if the fragment
   * could not be logically inserted at the end of the fragment chain.
   */
  protected void attachFragment(BundleFragment fragment) throws BundleException {
    // do not force the creation of the bundle loader here
    BundleLoader loader = getLoaderProxy().getBasicBundleLoader();
    // If the Host ClassLoader exists then we must attach
    // the fragment to the ClassLoader.
    if (loader != null)
      loader.attachFragment(fragment);

    if (fragments == null) {
      fragments = new BundleFragment[] {fragment};
    } else {
      boolean inserted = false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.