play.classloading

## Class ApplicationClassloader

- java.lang.Object
- - java.lang.ClassLoader
  - - play.classloading.ApplicationClassloader

    public class ApplicationClassloader
    extends java.lang.ClassLoader

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

### Field Summary

Fields
`ApplicationClassloaderState` `currentState` A representation of the current state of the ApplicationClassloader.
`java.security.ProtectionDomain` `protectionDomain` This protection domain applies to all loaded classes.

### Constructor Summary

Constructors
Constructor and Description
`ApplicationClassloader()`

### Method Summary

All Methods Instance Methods Concrete Methods
`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)`
`java.util.List<java.lang.Class>` `getAnnotatedClasses(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)` Retrieve all application classes with a specific annotation.
`java.util.List<java.lang.Class>` `getAssignableClasses(java.lang.Class clazz)` Retrieve all application classes assignable to this 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)`
`java.io.InputStream` `getResourceAsStream(java.lang.String name)`
`java.util.Enumeration<java.net.URL>` `getResources(java.lang.String name)`
`java.lang.Class<?>` `loadApplicationClass(java.lang.String name)`
`protected java.lang.Class<?>` `loadClass(java.lang.String name, boolean resolve)`

### Methods inherited from class java.lang.ClassLoader

`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### currentState

    public ApplicationClassloaderState currentState

A representation of the current state of the ApplicationClassloader. It gets a new value each time the state of the classloader changes.

#### protectionDomain

    public java.security.ProtectionDomain protectionDomain

This protection domain applies 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

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

#### loadApplicationClass

    public java.lang.Class<?> loadApplicationClass(java.lang.String name)

#### getResourceAsStream

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

Overrides:
  `getResourceAsStream` in class `java.lang.ClassLoader`

#### getResource

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

Overrides:
  `getResource` in class `java.lang.ClassLoader`

#### getResources

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

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

#### detectChanges

    public void detectChanges()
                       throws RestartNeededException

Detect Java changes

Throws:
  `RestartNeededException` - Thrown if the application need to be restarted

#### 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<? extends java.lang.annotation.Annotation> 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)