Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * JBoss, Home of Professional Open Source
  * Copyright 2012, Red Hat, Inc., and individual contributors
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.jboss.weld.resources;
org.jboss.weld.resources.spi.ResourceLoader implementation that uses the classloader that loaded this class to load other resources. This is not very useful except for cases where we need to decide whether optional parts of weld-core should be registered or not. These optional parts depend on certain artifacts that may not be available (e.g. servlet API). We cannot use the DefaultResourceLoader for the decision making since in a modular environment the required artifact may be available to the application (loadable via TCCL) but may not be available to Weld. This class is helpful for detecting such situations.

Jozef Hartinger
See also:
    public static final WeldClassLoaderResourceLoader INSTANCE = new WeldClassLoaderResourceLoader();
    protected WeldClassLoaderResourceLoader() {
    protected ClassLoader classLoader() {
        return getClass().getClassLoader();
    public void cleanup() {
        // noop
New to GrepCode? Check out our FAQ X