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 java.lang.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(java.lang.Object o)
           
static MyFacesClassLoader getCurrentInstance(javax.faces.context.ExternalContext externalContext)
          Returns the cached instance of the MyFacesClassLoader for this application or a new one if now cached instance is available yet.
 java.net.URL getResource(java.lang.String s)
           
 java.io.InputStream getResourceAsStream(java.lang.String s)
           
 java.util.Enumeration<java.net.URL> getResources(java.lang.String s)
           
 java.lang.Class<?> loadClass(java.lang.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(javax.faces.context.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 java.net.URL getResource(java.lang.String s)
Overrides:
getResource in class java.lang.ClassLoader

getResources

public java.util.Enumeration<java.net.URL> getResources(java.lang.String s)
                                                 throws java.io.IOException
Overrides:
getResources in class java.lang.ClassLoader
Throws:
java.io.IOException

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String s)
Overrides:
getResourceAsStream in class java.lang.ClassLoader

loadClass

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

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


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