Interface ResourceLoader

  • All Superinterfaces:
    Service
    All Known Implementing Classes:
    ForwardingResourceLoader

    public interface ResourceLoader
    extends Service
    Resource loading/class creation services for Weld. By default an implementation which uses the Thread Context ClassLoader if available, otherwise the classloading of the implementation is used. An alternative implementation that uses a predefined classloader is available for multi-modular environments. The ResourceLoader is a per-BeanManager service. Single-module deployments can use the default implementation, but applications that consist of multiple modules must use an implementation that is aware of the module classloader.
    Author:
    Pete Muir
    • Field Detail

      • PROPERTY_NAME

        static final String PROPERTY_NAME
    • Method Detail

      • classForName

        Class<?> classForName​(String name)
        Creates a class from a given FQCN
        Parameters:
        name - The name of the clsas
        Returns:
        The class
      • getResource

        URL getResource​(String name)
        Gets a resource as a URL by name
        Parameters:
        name - The name of the resource
        Returns:
        An URL to the resource
      • getResources

        Collection<URL> getResources​(String name)
        Gets resources as URLs by name
        Parameters:
        name - The name of the resource
        Returns:
        references to the URLS