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 |
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.
|
<T extends ArtifactDescriptor> |
getArtifactDescriptor() |
String |
getArtifactId() |
ClassLoader |
getClassLoader()
ClassLoader is an abstract class.
|
protected String[] |
getLocalResourceLocations() |
void |
setResourceReleaserClassLocation(String resourceReleaserClassLocation) |
String |
toString() |
findLocalClass, findParentClass, getClassLoaderLookupPolicy, getResource, getResources, loadClassaddURL, close, definePackage, findClass, findResource, 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, findResource, 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.protected 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–2018 MuleSoft, Inc.. All rights reserved.