Initialize a new GroovyClassLoader with a default or
constructor-supplied parentClassLoader.

@return the parent classloader used to load scripts
512883
private GroovyClassLoader initGroovyLoader() {
        GroovyClassLoader groovyClassLoader =
                AccessController.doPrivileged(new PrivilegedAction<ScriptClassLoader>() {
                    public ScriptClassLoader run() {
                        if (parentLoader instanceof GroovyClassLoader) {
                            return new ScriptClassLoader((GroovyClassLoader) parentLoader);
                        } else {
                            return new ScriptClassLoader(parentLoader, config);
                        }
                    }
                });
        for (URL root : roots) groovyClassLoader.addURL(root);
        return groovyClassLoader;
    }
820155
function SubClass() {
		var ret;
		// Call the parent constructor.
		parent.apply(this, arguments);

		// Only call initialize in self constructor.
		if(this.constructor === SubClass && this.initialize) {
			ret = this.initialize.apply(this, arguments);
		}
		return ret ? ret : this;
	}
1093822
public synchronized static final AccessClassLoader get(ClassLoader parent) {
		AccessClassLoader loader = (AccessClassLoader) ASM_CLASS_LOADERS.get(parent);
		if (loader == null) {
			loader = new AccessClassLoader(parent);
			ASM_CLASS_LOADERS.put(parent, loader);
		}
		return loader;
	}
937266
@Override
    public Constructor<T> getConstructor() {
        if (this.constructor == null) {
            try {
                this.constructor = this.managedClass.getConstructor((Class<?>[]) null);
            } catch (NoSuchMethodException e) {
                throw new IllegalStateException(e);
            }
        }
        return this.constructor;
    }
437448
private ClassLoader getRootLoader() {
        ClassLoader ret = getClass().getClassLoader();
        while (ret != null && ret.getParent() != null) {
            ret = ret.getParent();
        }
        return ret;
    }
751391
public Weld setClassLoader(ClassLoader classLoader) {
        Preconditions.checkNotNull(classLoader);
        resourceLoader = new ClassLoaderResourceLoader(classLoader);
        return this;
    }
504181
public void setClassLoader(final GroovyClassLoader loader) {
        // Classloaders should only be created inside a doPrivileged block in case
        // this method is invoked by code that does not have security permissions
        this.classLoader = loader != null ? loader : AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() {
            public GroovyClassLoader run() {
                ClassLoader parent = Thread.currentThread().getContextClassLoader();
                if (parent == null) parent = ProcessingUnit.class.getClassLoader();
                return new GroovyClassLoader(parent, configuration);
            }
        });
    }
1374467
public void load(ClassLoader classLoader) {
        Map<String, GroovyRunner> map = runnerMap; // direct read
        if (map == null) {
            map = getMap(); // initialize and load (recursive call), result ignored
            if (classLoader == null) {
                // getMap() already loaded using a null classloader
                return;
            }
        }
        writeLock.lock();
        try {
            if (classLoader == null) {
                classLoader = Thread.currentThread().getContextClassLoader();
            }
            cachedValues = null;
            loadDefaultRunners();
            loadWithLock(classLoader);
        } catch (SecurityException se) {
            LOG.log(Level.WARNING, "Failed to get the context ClassLoader", se);
        } catch (ServiceConfigurationError sce) {
            LOG.log(Level.WARNING, "Failed to load GroovyRunner services from ClassLoader " + classLoader, sce);
        } finally {
            writeLock.unlock();
        }
    }
160284
public static ClassLoader getDefault() {
        ClassLoader loader = null;
        try {
            loader = Thread.currentThread().getContextClassLoader();
        } catch (Exception ignored) {
        }
        if (loader == null) {
            loader = Environment.class.getClassLoader();
            if (loader == null) {
                try {
                    // getClassLoader() returning null indicates the bootstrap ClassLoader
                    loader = ClassLoader.getSystemClassLoader();
                } catch (Exception e) {
                    // Cannot access system ClassLoader - oh well, maybe the caller can live with null...
                }
            }
        }
        return loader;
    }
1179484
public static void popPreferredClassLoader() {
		final ClassLoader sysLoader = ClassLoaderFinder.class.getClassLoader();

		if ((dynamicLoader == null) || (dynamicLoader == sysLoader)) {
			dynamicLoader = null;
			final Thread[] threads = new Thread[Thread.activeCount()];
			Thread.enumerate(threads);
			for (final Thread t : threads) {
				if (t != null) {
					t.setContextClassLoader(sysLoader);
				}
			}
			return;
		}

		final ClassLoader parent = dynamicLoader.getParent();

		dynamicLoader = (parent == sysLoader) ? null : parent;

		final Thread[] threads = new Thread[Thread.activeCount()];
		Thread.enumerate(threads);
		for (final Thread t : threads) {
			if (t != null) {
				t.setContextClassLoader(parent);
			}
		}
	}
301340
public SpringApplicationBuilder parent(Class<?>... sources) {
		if (this.parent == null) {
			this.parent = new SpringApplicationBuilder(sources)
					.web(WebApplicationType.NONE).properties(this.defaultProperties)
					.environment(this.environment);
		}
		else {
			this.parent.sources(sources);
		}
		return this.parent;
	}
99549
public static InjectorImpl create(ClassLoader loader)
  {
    synchronized (loader) {
      if (loader instanceof DynamicClassLoader) {
        InjectorImpl inject = _localManager.getLevel(loader);

        if (inject == null) {
          inject = (InjectorImpl) InjectorAmp.manager(loader).get();
          _localManager.set(inject, loader);
        }

        return inject;
      }
      else {
        SoftReference<InjectorImpl> injectRef = _loaderManagerMap.get(loader);

        InjectorImpl inject = null;

        if (injectRef != null) {
          inject = injectRef.get();

          if (inject != null) {
            return inject;
          }
        }

        inject = (InjectorImpl) InjectorAmp.manager(loader).get();

        _loaderManagerMap.put(loader, new SoftReference<>(inject));

        return inject;
      }
    }
  }
426447
public ClassLoader getUserCodeClassLoader() {
		if (this.userCodeClassLoader == null) {
			this.userCodeClassLoader = buildUserCodeClassLoader(jarFiles, classpaths, getClass().getClassLoader());
		}
		return this.userCodeClassLoader;
	}
1326325
public Injector createInjector() {
        for (final TypeLiteral<?> typeLiteral : _inheritedTypeLiterals) {
            final Key<?> key = Key.get(typeLiteral);
            final Binding<?> binding = _parentInjector.getExistingBinding(key);
            if (binding != null) {
                if (!_adHocModule.hasBindingFor(typeLiteral)) {
                    // Bind entry if not already bound in adhoc module!!!
                    _adHocModule.bind(typeLiteral, binding.getProvider());
                }
            }
        }

        final Module module = Modules.override(_parentModule).with(_adHocModule);
        return Guice.createInjector(module);
    }
508218
public static Bus getClassLoaderDefaultBus(final ClassLoader classloader) {
      Bus classLoaderBus;
      synchronized (classLoaderBusses) {
         classLoaderBus = classLoaderBusses.get(classloader);
         if (classLoaderBus == null) {
            classLoaderBus = new JBossWSBusFactory().createBus();
            //register a listener for cleaning up the bus from the classloader association in the JBossWSBusFactory
            BusLifeCycleListener listener = new ClassLoaderDefaultBusLifeCycleListener(classLoaderBus);
            classLoaderBus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
            classLoaderBusses.put(classloader, classLoaderBus);
         }
      }
      return classLoaderBus;
   }
441985
static JClassLoader getSystemClassLoader()
  {
    if (_staticClassLoader == null)
      _staticClassLoader = JClassLoaderWrapper.create(ClassLoader.getSystemClassLoader());

    return _staticClassLoader;
  }
728912
public static DroolsFactory init() {
		try {
			DroolsFactory theDroolsFactory = (DroolsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.jboss.org/drools"); 
			if (theDroolsFactory != null) {
				return theDroolsFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new DroolsFactoryImpl();
	}