Create a new {@link LibraryLoader} for the current VM.

@return the loader.
772768
public static LibraryLoader loader() {
        String type = System.getProperty("com.lambdaworks.jni.loader");

        if (type != null) {
            if (type.equals("sys")) return new SysLibraryLoader();
            if (type.equals("nil")) return new NilLibraryLoader();
            if (type.equals("jar")) return new JarLibraryLoader();
            throw new IllegalStateException("Illegal value for com.lambdaworks.jni.loader: " + type);
        }

        String vmSpec = System.getProperty("java.vm.specification.name");
        return vmSpec.startsWith("Java") ? new JarLibraryLoader() : new SysLibraryLoader();
    }
1351868
@Override
    protected KatharsisInvokerBuilder createKatharsisInvokerBuilder() {
        return new KatharsisInvokerBuilder()
                .resourceSearchPackage(getResourceSearchPackage())
                .resourceDefaultDomain(getResourceDefaultDomain())
                .jsonServiceLocator(new SampleJsonServiceLocator());
    }
121658
protected function createCollectionLoader()
    {
        $loader = $this->createCollectionLoaderFromTrait();

        $mainMenu = filter_input(INPUT_GET, 'main_menu', FILTER_SANITIZE_STRING);
        if ($mainMenu) {
            $loader->setCallback(function (&$obj) use ($mainMenu) {
                if (!$obj['main_menu']) {
                    $obj['main_menu'] = $mainMenu;
                }
            });
        }

        return $loader;
    }
430543
public ResourceHandler build() {
        if (resourceProviderFactory == null) {
            throw new IllegalStateException("No resourceProviderFactory has been set");
        }
        return new ResourceHandler(resourceProviderFactory, pathToServeFrom, defaultFile, extensionToResourceType);
    }
763066
public GroovyResourceLoader createGroovyResourceLoader(final ResourceLoader resourceLoader) {
    checkNotNull(resourceLoader);

    return new GroovyResourceLoader()
    {
      @Override
      public URL loadGroovySource(final String name) throws MalformedURLException {
        return resourceLoader.loadResource(name);
      }
    };
  }
426447
public ClassLoader getUserCodeClassLoader() {
		if (this.userCodeClassLoader == null) {
			this.userCodeClassLoader = buildUserCodeClassLoader(jarFiles, classpaths, getClass().getClassLoader());
		}
		return this.userCodeClassLoader;
	}
1066460
private static URLClassLoader getCurrentClassLoader() {
		synchronized (Boot.class) {
			if (dynamicClassLoader == null) {
				final ClassLoader cl = ClassLoader.getSystemClassLoader();
				if (cl instanceof URLClassLoader) {
					dynamicClassLoader = (URLClassLoader) cl;
				} else {
					dynamicClassLoader = URLClassLoader.newInstance(new URL[0], cl);
				}
			}
			return dynamicClassLoader;
		}
	}
1262809
static WebAppClassLoader createWebAppClassLoader(final ClassLoader cl, final WebAppContext wac)
   {
      return AccessController.doPrivileged(new PrivilegedAction<WebAppClassLoader>() 
      {
         public WebAppClassLoader run()
         {
            try
            {
               return new WebAppClassLoader(cl, wac);
            }
            catch (IOException ioe)
            {
               return null;
            }
         }
      });
   }
990760
public final Cache2kBuilder<K, V> loader(AsyncCacheLoader<K, V> l) {
    config().setAsyncLoader(wrapCustomizationInstance(l));
    return this;
  }
814987
protected ClassLoader getClassLoader() {
        ClassLoader classLoader = null;
        try {
            classLoader = Thread.currentThread().getContextClassLoader();
        } catch (Throwable ex) {
            // Cannot access thread context ClassLoader - falling back...
        }
        return (classLoader != null ? classLoader : getClass().getClassLoader());
    }
962263
public static EnvironmentClassLoader create(ClassLoader parent)
  {
    String id = null;
    
    return create(parent, id);
  }
27051
public static ClassLoadInfo classLoadManager() {
        ClassLoadingMXBean classLoadingMXBean = ManagementFactory.getClassLoadingMXBean();
        int nowLoadedClassCount = classLoadingMXBean.getLoadedClassCount();
        long totalLoadedClassCount = classLoadingMXBean.getTotalLoadedClassCount();
        long unloadedClassCount = classLoadingMXBean.getUnloadedClassCount();
        return new ClassLoadInfo(nowLoadedClassCount, totalLoadedClassCount, unloadedClassCount);
    }
393034
@Override
	public Loader createLoader(ClassLoader parent) {

        if( log.isDebugEnabled() )
            log.debug("Creating Loader with parent class loader '" +
                       parent + "'");

        WebappLoader loader = new WebappLoader(parent);
        return (loader);

    }
1209792
public Object create(Class<?> iface, ClassLoader proxyLoader) {
		return create(new Class[]{iface}, proxyLoader);
	}
540412
public PackageDescriptor createPackageDescriptor(String packageName,
                                                     ClassLoader classLoader) {
        return PackageDescriptor.forName(packageName, classLoader);
    }
1329009
@Override
	public ClassLoader getClassLoader() {
		if (classLoader == null) {
			if (!(super.getClassLoader() instanceof WinletClassLoader))
				classLoader = new WinletClassLoader(getParent()
						.getClassLoader());
		}

		return classLoader;
	}
1038542
static WorkClassLoader createWorkClassLoader(final ClassBundle cb)
   {
      return AccessController.doPrivileged(new PrivilegedAction<WorkClassLoader>() 
      {
         public WorkClassLoader run()
         {
            return new WorkClassLoader(cb);
         }
      });
   }