public class ServiceClassLoader extends CustomURLClassLoader implements ClassAnnotation
Constructor and Description |
---|
ServiceClassLoader(String name,
URL[] searchPath,
ClassAnnotator annotator,
ClassLoader parent)
Constructs a new ServiceClassLoader for the specified URLs having the given parent.
|
Modifier and Type | Method and Description |
---|---|
void |
addURLs(ClasspathBuilder classpathBuilder) |
void |
addURLs(List<URL> urls)
Appends the specified URLs to the list of URLs to search for classes and resources.
|
static boolean |
appendIfContext(java.util.function.Supplier<ClasspathBuilder> classpathBuilderSupplier) |
String |
getClassAnnotation()
Get the class annotations as determined by the
ClassAnnotator |
ClassAnnotator |
getClassAnnotator()
Get the
ClassAnnotator created at construction time |
ClassLoader |
getCodeChangeClassLoader(SupportCodeChangeAnnotationContainer supportCodeChangeAnnotationContainer) |
CodeChangeClassLoadersManager |
getCodeChangeClassLoadersManager() |
static Field |
getFieldFromClass(Class<?> clazz,
String fieldName) |
List<URL> |
getLibPath() |
URL |
getResource(String name) |
Enumeration<URL> |
getResources(String name) |
URL[] |
getSearchPath()
Get the search path of URLs for loading classes and resources
|
URL |
getSlashPath() |
URL[] |
getURLs()
Get the URLs to be used for class annotations as determined by the
ClassAnnotator |
void |
initCodeChangeClassLoadersManager(boolean supportCodeChange,
int maxClassLoaders) |
Class<?> |
loadClass(String name) |
protected Class<?> |
loadClass(String name,
boolean resolve) |
protected static boolean |
matches(String className,
Collection<String> patterns) |
void |
setLibPath(List<URL> urls) |
void |
setParentClassLoader(ClassLoader classLoader) |
void |
setSlashPath(URL url) |
findClass, findResource, getLogName, toString
addURL, close, definePackage, findResources, getPermissions, getResourceAsStream, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public ServiceClassLoader(String name, URL[] searchPath, ClassAnnotator annotator, ClassLoader parent)
searchPath
- Array of URLs to search for classesannotator
- Array of URLs to use for the codebaseparent
- Parent ClassLoader to delegate topublic CodeChangeClassLoadersManager getCodeChangeClassLoadersManager()
public ClassAnnotator getClassAnnotator()
ClassAnnotator
created at construction timepublic URL[] getURLs()
ClassAnnotator
getURLs
in class URLClassLoader
public void setParentClassLoader(ClassLoader classLoader) throws Exception
Exception
public URL[] getSearchPath()
getSearchPath
in class CustomURLClassLoader
URL[]
which corresponds to the search path for the class
loader; that is, the array elements are the locations from which the class loader will load
requested classes.public void addURLs(List<URL> urls)
public void addURLs(ClasspathBuilder classpathBuilder)
public void setSlashPath(URL url)
public URL getSlashPath()
public String getClassAnnotation()
ClassAnnotator
getClassAnnotation
in interface ClassAnnotation
null
ClassAnnotation.getClassAnnotation()
public URL getResource(String name)
getResource
in class CustomURLClassLoader
public Class<?> loadClass(String name) throws ClassNotFoundException
loadClass
in class ClassLoader
ClassNotFoundException
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass
in class CustomURLClassLoader
ClassNotFoundException
public Enumeration<URL> getResources(String name) throws IOException
getResources
in class ClassLoader
IOException
protected static boolean matches(String className, Collection<String> patterns)
public ClassLoader getCodeChangeClassLoader(SupportCodeChangeAnnotationContainer supportCodeChangeAnnotationContainer)
public void initCodeChangeClassLoadersManager(boolean supportCodeChange, int maxClassLoaders)
public static boolean appendIfContext(java.util.function.Supplier<ClasspathBuilder> classpathBuilderSupplier)
public static Field getFieldFromClass(Class<?> clazz, String fieldName) throws NoSuchFieldException, InvocationTargetException, IllegalAccessException, NoSuchMethodException
Copyright © GigaSpaces.