org.ow2.jonas.cdi.weld.internal.resource
Class ApplicationResourceLoader

java.lang.Object
  extended by org.ow2.jonas.cdi.weld.internal.resource.ApplicationResourceLoader
All Implemented Interfaces:
org.jboss.weld.bootstrap.api.Service, org.jboss.weld.resources.spi.ResourceLoader

public class ApplicationResourceLoader
extends java.lang.Object
implements org.jboss.weld.resources.spi.ResourceLoader

Provides a ResourceLoader backed by a given ClassLoader.

Author:
Guillaume Sauthier

Field Summary
 
Fields inherited from interface org.jboss.weld.resources.spi.ResourceLoader
PROPERTY_NAME
 
Constructor Summary
ApplicationResourceLoader(java.lang.ClassLoader loader)
           
 
Method Summary
 java.lang.Class<?> classForName(java.lang.String name)
          Creates a class from a given FQCN
 void cleanup()
           
 java.net.URL getResource(java.lang.String name)
          Gets a resource as a URL by name
 java.util.Collection<java.net.URL> getResources(java.lang.String name)
          Gets resources as URLs by name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationResourceLoader

public ApplicationResourceLoader(java.lang.ClassLoader loader)
Method Detail

classForName

public java.lang.Class<?> classForName(java.lang.String name)
Creates a class from a given FQCN

Specified by:
classForName in interface org.jboss.weld.resources.spi.ResourceLoader
Parameters:
name - The name of the clsas
Returns:
The class

getResource

public java.net.URL getResource(java.lang.String name)
Gets a resource as a URL by name

Specified by:
getResource in interface org.jboss.weld.resources.spi.ResourceLoader
Parameters:
name - The name of the resource
Returns:
An URL to the resource

getResources

public java.util.Collection<java.net.URL> getResources(java.lang.String name)
Gets resources as URLs by name

Specified by:
getResources in interface org.jboss.weld.resources.spi.ResourceLoader
Parameters:
name - The name of the resource
Returns:
references to the URLS

cleanup

public void cleanup()
Specified by:
cleanup in interface org.jboss.weld.bootstrap.api.Service


Copyright © 2012 OW2 Consortium. All Rights Reserved.