public class MuleArtifactClassLoader extends FineGrainedControlClassLoader implements ArtifactClassLoader
FineGrainedControlClassLoader.NonCachingURLStreamHandlerFactory| Modifier and Type | Field and Description |
|---|---|
protected List<ShutdownListener> |
shutdownListeners |
| Constructor and Description |
|---|
MuleArtifactClassLoader(String artifactId,
ArtifactDescriptor artifactDescriptor,
URL[] urls,
ClassLoader parent,
ClassLoaderLookupPolicy lookupPolicy)
Constructs a new
MuleArtifactClassLoader for the given URLs |
| Modifier and Type | Method and Description |
|---|---|
void |
addShutdownListener(ShutdownListener listener)
Adds a shutdown listener to the class loader.
|
protected ResourceReleaser |
createResourceReleaserInstance()
Creates a
ResourceReleaser using this classloader, only used outside in unit tests. |
void |
dispose()
Disposes the
ClassLoader by closing all the resources opened by this ClassLoader. |
URL |
findInternalResource(String resource)
Same as
ArtifactClassLoader.findResource(String) but it won't have in mind filtered resources. |
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) |
<T extends ArtifactDescriptor> |
getArtifactDescriptor() |
String |
getArtifactId() |
ClassLoader |
getClassLoader()
ClassLoader is an abstract class.
|
protected String[] |
getLocalResourceLocations() |
protected Class<?> |
loadClass(String name,
boolean resolve) |
Class<?> |
loadInternalClass(String name)
Same as
ClassLoader.findClass(String) but will not use class filtering. |
void |
setResourceReleaserClassLocation(String resourceReleaserClassLocation) |
String |
toString() |
findLocalClass, findParentClass, getClassLoaderLookupPolicy, getResource, getResourcesaddURL, close, definePackage, findClass, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstancedefineClass, defineClassclearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSignersclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindLocalClass, findResourcesgetClassLoaderLookupPolicyprotected List<ShutdownListener> shutdownListeners
public MuleArtifactClassLoader(String artifactId, ArtifactDescriptor artifactDescriptor, URL[] urls, ClassLoader parent, ClassLoaderLookupPolicy lookupPolicy)
MuleArtifactClassLoader for the given URLsartifactId - artifact unique ID. Non empty.artifactDescriptor - descriptor for the artifact owning the created class loader. Non null.urls - the URLs from which to load classes and resourcesparent - the parent class loader for delegationlookupPolicy - policy used to guide the lookup process. Non nullpublic String getArtifactId()
getArtifactId in interface ArtifactClassLoaderpublic <T extends ArtifactDescriptor> T getArtifactDescriptor()
getArtifactDescriptor in interface ArtifactClassLoaderT - the generic type of the artifact descriptor.public URL findResource(String name)
findResource in interface ArtifactClassLoaderfindResource in class URLClassLoadername - name of the resource to find.public URL findInternalResource(String resource)
ArtifactClassLoaderArtifactClassLoader.findResource(String) but it won't have in mind filtered resources.findInternalResource in interface ArtifactClassLoaderresource - name of the resource to find.protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
loadClass in class FineGrainedControlClassLoaderClassNotFoundExceptionpublic Class<?> loadInternalClass(String name) throws ClassNotFoundException
ArtifactClassLoaderClassLoader.findClass(String) but will not use class filtering.loadInternalClass in interface ArtifactClassLoadername - the class to loadClassNotFoundExceptionprotected String[] getLocalResourceLocations()
public ClassLoader getClassLoader()
ArtifactClassLoadergetClassLoader in interface ArtifactClassLoaderpublic void addShutdownListener(ShutdownListener listener)
ArtifactClassLoaderaddShutdownListener in interface ArtifactClassLoaderpublic void dispose()
FineGrainedControlClassLoaderClassLoader by closing all the resources opened by this ClassLoader. See
URLClassLoader.close().dispose in interface DisposableClassLoaderdispose in class FineGrainedControlClassLoaderprotected ResourceReleaser createResourceReleaserInstance()
ResourceReleaser using this classloader, only used outside in unit tests.public void setResourceReleaserClassLocation(String resourceReleaserClassLocation)
public URL findLocalResource(String resourceName)
LocalResourceLocatorfindLocalResource in interface LocalResourceLocatorresourceName - name of the resource to find.Copyright © 2003–2024 MuleSoft, Inc.. All rights reserved.