play.classloading
Class ApplicationClassloader

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

public class ApplicationClassloader
extends java.lang.ClassLoader

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


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

Constructor Detail

ApplicationClassloader

public ApplicationClassloader()
Method Detail

loadClass

protected java.lang.Class loadClass(java.lang.String name,
                                    boolean resolve)
                             throws java.lang.ClassNotFoundException
You know ...

Overrides:
loadClass in class java.lang.ClassLoader
Throws:
java.lang.ClassNotFoundException

loadApplicationClass

protected java.lang.Class loadApplicationClass(java.lang.String name)

getClassDefinition

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


getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String name)
You know ...

Overrides:
getResourceAsStream in class java.lang.ClassLoader

getResource

public java.net.URL getResource(java.lang.String name)
You know ...

Overrides:
getResource in class java.lang.ClassLoader

getResources

public java.util.Enumeration<java.net.URL> getResources(java.lang.String name)
                                                 throws java.io.IOException
You know ...

Overrides:
getResources in class java.lang.ClassLoader
Throws:
java.io.IOException

detectChanges

public void detectChanges()
Detect Java changes


getAllClasses

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

Returns:
The list of well defined Class

getAssignableClasses

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

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

getClassIgnoreCase

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

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

getAnnotatedClasses

public java.util.List<java.lang.Class> getAnnotatedClasses(java.lang.Class clazz)
Retrieve all application classes with a specific annotation.

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

getAnnotatedClasses

public java.util.List<java.lang.Class> getAnnotatedClasses(java.lang.Class[] clazz)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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