play.classloading
Class ApplicationClassloader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by play.classloading.ApplicationClassloader

public class ApplicationClassloader
extends ClassLoader

The application classLoader. Load the classes from the application Java sources files.


Field Summary
 ProtectionDomain protectionDomain
          This protection domain will be affecter to all loaded classes.
 
Constructor Summary
ApplicationClassloader()
           
 
Method Summary
 void detectChanges()
          Detect Java changes
 List<Class> getAllClasses()
          Try to load all .java files found.
 List<Class> getAnnotatedClasses(Class[] clazz)
           
 List<Class> getAnnotatedClasses(Class<? extends Annotation> clazz)
          Retrieve all application classes with a specific annotation.
 List<Class> getAssignableClasses(Class clazz)
          Retrieve all application classes assignable to this class.
protected  byte[] getClassDefinition(String name)
          Search for the byte code of the given class.
 Class getClassIgnoreCase(String name)
          Find a class in a case insensitive way
 URL getResource(String name)
          You know ...
 InputStream getResourceAsStream(String name)
          You know ...
 Enumeration<URL> getResources(String name)
          You know ...
protected  Class loadApplicationClass(String name)
           
protected  Class<?> loadClass(String name, boolean resolve)
          You know ...
 String toString()
           
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

protectionDomain

public ProtectionDomain protectionDomain
This protection domain will be affecter to all loaded classes.

Constructor Detail

ApplicationClassloader

public ApplicationClassloader()
Method Detail

loadClass

protected Class<?> loadClass(String name,
                             boolean resolve)
                      throws ClassNotFoundException
You know ...

Overrides:
loadClass in class ClassLoader
Throws:
ClassNotFoundException

loadApplicationClass

protected Class loadApplicationClass(String name)

getClassDefinition

protected byte[] getClassDefinition(String name)
Search for the byte code of the given class.


getResourceAsStream

public InputStream getResourceAsStream(String name)
You know ...

Overrides:
getResourceAsStream in class ClassLoader

getResource

public URL getResource(String name)
You know ...

Overrides:
getResource in class ClassLoader

getResources

public Enumeration<URL> getResources(String name)
                              throws IOException
You know ...

Overrides:
getResources in class ClassLoader
Throws:
IOException

detectChanges

public void detectChanges()
Detect Java changes


getAllClasses

public List<Class> getAllClasses()
Try to load all .java files found.

Returns:
The list of well defined Class

getAssignableClasses

public List<Class> getAssignableClasses(Class clazz)
Retrieve all application classes assignable to this class.

Parameters:
clazz - The superclass, or the interface.
Returns:
A list of class

getClassIgnoreCase

public Class getClassIgnoreCase(String name)
Find a class in a case insensitive way

Parameters:
name - The class name.
Returns:
a class

getAnnotatedClasses

public List<Class> getAnnotatedClasses(Class<? extends Annotation> clazz)
Retrieve all application classes with a specific annotation.

Parameters:
clazz - The annotation class.
Returns:
A list of class

getAnnotatedClasses

public List<Class> getAnnotatedClasses(Class[] clazz)

toString

public String toString()
Overrides:
toString in class Object


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly