org.apache.myfaces.shared.util
Class MyFacesClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.apache.myfaces.shared.util.MyFacesClassLoader

public class MyFacesClassLoader
extends ClassLoader

Custom ClassLoader that sets the current Thread's context ClassLoader as parent ClassLoader and uses the parent ClassLoader, myfaces-api and myfaces-impl ClassLoaders to locate Resources and Classes.

Author:
Jakob Korherr

Constructor Summary
MyFacesClassLoader()
           
 
Method Summary
 boolean equals(Object o)
           
static MyFacesClassLoader getCurrentInstance(ExternalContext externalContext)
          Returns the cached instance of the MyFacesClassLoader for this application or a new one if now cached instance is available yet.
 URL getResource(String s)
           
 InputStream getResourceAsStream(String s)
           
 Enumeration<URL> getResources(String s)
           
 Class<?> loadClass(String s)
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyFacesClassLoader

public MyFacesClassLoader()
Method Detail

getCurrentInstance

public static final MyFacesClassLoader getCurrentInstance(ExternalContext externalContext)
Returns the cached instance of the MyFacesClassLoader for this application or a new one if now cached instance is available yet.

Parameters:
externalContext -
Returns:

getResource

public URL getResource(String s)
Overrides:
getResource in class ClassLoader

getResources

public Enumeration<URL> getResources(String s)
                              throws IOException
Overrides:
getResources in class ClassLoader
Throws:
IOException

getResourceAsStream

public InputStream getResourceAsStream(String s)
Overrides:
getResourceAsStream in class ClassLoader

loadClass

public Class<?> loadClass(String s)
                   throws ClassNotFoundException
Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.