@NoInstantiate public class FilteringArtifactClassLoader extends ClassLoader implements ArtifactClassLoader
ClassLoader that filter which classes and resources can be resolved based on a ClassLoaderFilter
Resources used to provide SPI are not managed as standard resources, ie, not filtered through the ClassLoaderFilter,
but filtered using ExportedService definitions. Only the service providers defined as exported in the modules will be
available from this class loader.| Constructor and Description |
|---|
FilteringArtifactClassLoader(ArtifactClassLoader artifactClassLoader,
ClassLoaderFilter filter,
List<ExportedService> exportedServices)
Creates a new filtering classLoader
|
| Modifier and Type | Method and Description |
|---|---|
void |
addShutdownListener(ShutdownListener listener)
Adds a shutdown listener to the class loader.
|
void |
dispose()
Gets rid of the class loader resources.
|
Class<?> |
findLocalClass(String name)
Loads the class with the specified binary name if defined on this class loader.
|
URL |
findLocalResource(String resourceName)
This method finds a resource in the local environment for this artifact, if the resource is not found and the artifact has a
parent artifact then the operation is resolved by that parent, if there is no parent, the resources is searched in the global
environment.
|
URL |
findResource(String name) |
Enumeration<URL> |
findResources(String name)
Returns an enumeration of
URL objects representing all the resources with the given name which
are local to the classloader |
<T extends ArtifactDescriptor> |
getArtifactDescriptor() |
String |
getArtifactId() |
ClassLoader |
getClassLoader()
ClassLoader is an abstract class.
|
ClassLoaderLookupPolicy |
getClassLoaderLookupPolicy() |
URL |
getResource(String name) |
protected URL |
getResourceFromDelegate(ArtifactClassLoader artifactClassLoader,
String name) |
Enumeration<URL> |
getResources(String name) |
protected Enumeration<URL> |
getResourcesFromDelegate(ArtifactClassLoader artifactClassLoader,
String name) |
Class<?> |
loadClass(String name) |
String |
toString() |
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResourceAsStream, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignerspublic FilteringArtifactClassLoader(ArtifactClassLoader artifactClassLoader, ClassLoaderFilter filter, List<ExportedService> exportedServices)
artifactClassLoader - artifact classLoader to filter. Non nullfilter - filters access to classes and resources from the artifact classLoader. Non nullexportedServices - service providers that will be available from the filtered class loader. Non null.public Class<?> loadClass(String name) throws ClassNotFoundException
loadClass in class ClassLoaderClassNotFoundExceptionpublic URL getResource(String name)
getResource in class ClassLoaderprotected URL getResourceFromDelegate(ArtifactClassLoader artifactClassLoader, String name)
public Enumeration<URL> getResources(String name) throws IOException
getResources in class ClassLoaderIOExceptionprotected Enumeration<URL> getResourcesFromDelegate(ArtifactClassLoader artifactClassLoader, String name) throws IOException
IOExceptionpublic URL findResource(String name)
findResource in interface ArtifactClassLoaderfindResource in class ClassLoadername - name of the resource to find.public Enumeration<URL> findResources(String name) throws IOException
ArtifactClassLoaderURL objects representing all the resources with the given name which
are local to the classloaderfindResources in interface ArtifactClassLoaderfindResources in class ClassLoadername - The resource nameURL objects for the resourcesIOException - If I/O errors occurpublic Class<?> findLocalClass(String name) throws ClassNotFoundException
ArtifactClassLoaderfindLocalClass in interface ArtifactClassLoadername - The binary name of the classClassNotFoundException - If the class was not foundpublic String getArtifactId()
getArtifactId in interface ArtifactClassLoaderpublic <T extends ArtifactDescriptor> T getArtifactDescriptor()
getArtifactDescriptor in interface ArtifactClassLoaderT - the generic type of the artifact descriptor.public ClassLoader getClassLoader()
ArtifactClassLoadergetClassLoader in interface ArtifactClassLoaderpublic void addShutdownListener(ShutdownListener listener)
ArtifactClassLoaderaddShutdownListener in interface ArtifactClassLoaderpublic ClassLoaderLookupPolicy getClassLoaderLookupPolicy()
getClassLoaderLookupPolicy in interface ClassLoaderLookupPolicyProviderpublic void dispose()
DisposableClassLoaderdispose in interface DisposableClassLoaderpublic URL findLocalResource(String resourceName)
LocalResourceLocatorfindLocalResource in interface LocalResourceLocatorresourceName - name of the resource to find.Copyright © 2003–2018 MuleSoft, Inc.. All rights reserved.