Examples of BundleLoader


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

  public ClassLoader getClassLoader() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null)
      sm.checkPermission(new RuntimePermission("getClassLoader")); //$NON-NLS-1$
    BundleLoaderProxy curProxy = getLoaderProxy();
    BundleLoader loader = curProxy == null ? null : curProxy.getBundleLoader();
    BundleClassLoader bcl = loader == null ? null : loader.createClassLoader();
    return (bcl instanceof ClassLoader) ? (ClassLoader) bcl : null;
  }
View Full Code Here

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

    sm.checkPermission(new AdminPermission(bundle, AdminPermission.RESOURCE));
    return true;
  }

  protected static BaseClassLoader getBundleClassLoader(AbstractBundle bundle) {
    BundleLoader loader = bundle.getBundleLoader();
    if (loader == null)
      return null;
    return (BaseClassLoader) loader.createClassLoader();
  }
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

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

  public ClassLoader getClassLoader() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null)
      sm.checkPermission(new RuntimePermission("getClassLoader")); //$NON-NLS-1$
    BundleLoaderProxy curProxy = getLoaderProxy();
    BundleLoader loader = curProxy == null ? null : curProxy.getBundleLoader();
    BundleClassLoader bcl = loader == null ? null : loader.createClassLoader();
    return (bcl instanceof ClassLoader) ? (ClassLoader) bcl : null;
  }
View Full Code Here

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

    sm.checkPermission(new AdminPermission(bundle, AdminPermission.RESOURCE));
    return true;
  }

  protected static BaseClassLoader getBundleClassLoader(AbstractBundle bundle) {
    BundleLoader loader = bundle.getBundleLoader();
    if (loader == null)
      return null;
    return (BaseClassLoader) loader.createClassLoader();
  }
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 && 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)
      return null;
    return (loader.findResource(name));
  }
View Full Code Here

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

      return null;
    return (loader.findResource(name));
  }

  public Enumeration getResources(String name) throws IOException {
    BundleLoader loader = null;
    try {
      framework.checkAdminPermission(this, AdminPermission.RESOURCE);
    } catch (SecurityException ee) {
      return null;
    }
    loader = checkLoader();
    if (loader == null)
      return null;
    Enumeration 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
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.