public class ApplicationClassloader
extends java.lang.ClassLoader
Modifier and Type | Field and Description |
---|---|
ApplicationClassloaderState |
currentState
A representation of the current state of the ApplicationClassloader.
|
java.security.ProtectionDomain |
protectionDomain
This protection domain applies to all loaded classes.
|
Constructor and Description |
---|
ApplicationClassloader() |
Modifier and Type | Method and Description |
---|---|
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) |
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
public ApplicationClassloaderState currentState
public java.security.ProtectionDomain protectionDomain
protected java.lang.Class<?> loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
java.lang.ClassNotFoundException
public java.lang.Class<?> loadApplicationClass(java.lang.String name)
public java.io.InputStream getResourceAsStream(java.lang.String name)
getResourceAsStream
in class java.lang.ClassLoader
public java.net.URL getResource(java.lang.String name)
getResource
in class java.lang.ClassLoader
public java.util.Enumeration<java.net.URL> getResources(java.lang.String name) throws java.io.IOException
getResources
in class java.lang.ClassLoader
java.io.IOException
public void detectChanges() throws RestartNeededException
RestartNeededException
- Thrown if the application need to be restartedpublic java.util.List<java.lang.Class> getAllClasses()
public java.util.List<java.lang.Class> getAssignableClasses(java.lang.Class clazz)
clazz
- The superclass, or the interface.public java.lang.Class getClassIgnoreCase(java.lang.String name)
name
- The class name.public java.util.List<java.lang.Class> getAnnotatedClasses(java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
clazz
- The annotation class.public java.util.List<java.lang.Class> getAnnotatedClasses(java.lang.Class[] clazz)
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly