com.sun.rave.web.ui.util
Class ClassLoaderFinder

java.lang.Object
  extended by com.sun.rave.web.ui.util.ClassLoaderFinder

public class ClassLoaderFinder
extends java.lang.Object

Strategies for finding the current ClassLoader such as Thread.currentThread().getContextClassLoader() do not work during design time, where the notion of the classpath is more constrained. Please make sure you use this utility when you need to get hold of the current loader.


Constructor Summary
ClassLoaderFinder()
           
 
Method Summary
static java.lang.ClassLoader getCurrentLoader(java.lang.Object fallbackClass)
          Return the best class loader to use for loading resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassLoaderFinder

public ClassLoaderFinder()
Method Detail

getCurrentLoader

public static java.lang.ClassLoader getCurrentLoader(java.lang.Object fallbackClass)

Return the best class loader to use for loading resources. This is normally the thread context class loader but can overridden using #setCustomClassLoader. At design-time, if no custom class loader has been set, an attempt will be made to load the class loader stored in the servlet or portlet context attribute com.sun.rave.project.classloader

Parameters:
fallbackClass - If there is no context class loader, fall back to using the class loader for the given object
Returns:
A ClassLoader to use for loading resources