Package org.eclipse.osgi.framework.internal.core

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


    public ParsingService(boolean isSax) {
      this.isSax = isSax;
    }

    public Object getService(Bundle bundle, ServiceRegistration registration) {
      BundleHost host = (bundle instanceof BundleHost) ? (BundleHost) bundle : null;
      if (!SET_TCCL_XMLFACTORY || bundle == null)
        return createService();
      /*
       * Set the TCCL while creating jaxp factory instances to the
       * requesting bundles class loader.  This is needed to
       * work around bug 285505.  There are issues if multiple
       * xerces implementations are available on the bundles class path
       *
       * The real issue is that the ContextFinder will only delegate
       * to the framework class loader in this case.  This class
       * loader forces the requesting bundle to be delegated to for
       * TCCL loads.
       */
      final ClassLoader savedClassLoader = Thread.currentThread().getContextClassLoader();
      try {
        ClassLoader cl = host.getClassLoader();
        if (cl != null)
          Thread.currentThread().setContextClassLoader(cl);
        return createService();
      } finally {
        Thread.currentThread().setContextClassLoader(savedClassLoader);
View Full Code Here


    public ParsingService(boolean isSax) {
      this.isSax = isSax;
    }

    public Object getService(Bundle bundle, ServiceRegistration<Object> registration) {
      BundleHost host = (bundle instanceof BundleHost) ? (BundleHost) bundle : null;
      if (!SET_TCCL_XMLFACTORY || bundle == null)
        return createService();
      /*
       * Set the TCCL while creating jaxp factory instances to the
       * requesting bundles class loader.  This is needed to
       * work around bug 285505.  There are issues if multiple
       * xerces implementations are available on the bundles class path
       *
       * The real issue is that the ContextFinder will only delegate
       * to the framework class loader in this case.  This class
       * loader forces the requesting bundle to be delegated to for
       * TCCL loads.
       */
      final ClassLoader savedClassLoader = Thread.currentThread().getContextClassLoader();
      try {
        ClassLoader cl = host.getClassLoader();
        if (cl != null)
          Thread.currentThread().setContextClassLoader(cl);
        return createService();
      } finally {
        Thread.currentThread().setContextClassLoader(savedClassLoader);
View Full Code Here

public class EquinoxWorker extends DefaultWorker implements FrameworkUtilWorker {

  public ClassLoader getClassLoader(Bundle b)
  {
    BundleHost host = (BundleHost) b;
    BundleLoaderProxy lp = host.getLoaderProxy();
    BundleLoader bl = (lp == null) ? null : lp.getBasicBundleLoader();
    BundleClassLoader cl = (bl == null) ? null : bl.createClassLoader();
   
    return ((cl instanceof ClassLoader) ? (ClassLoader)cl : null);
  }
View Full Code Here

import org.osgi.framework.Bundle;

public class EquinoxWorker extends DefaultWorker implements FrameworkUtilWorker {

    public ClassLoader getClassLoader(Bundle b) {
        BundleHost host = (BundleHost) b;
        BundleLoaderProxy lp = host.getLoaderProxy();
        BundleLoader bl = (lp == null) ? null : lp.getBasicBundleLoader();
        BundleClassLoader cl = (bl == null) ? null : bl.createClassLoader();

        return ((cl instanceof ClassLoader) ? (ClassLoader) cl : null);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.framework.internal.core.BundleHost

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.