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, loadClass
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
defineClass, defineClass
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findLocalClass, findResource, findResources
getClassLoaderLookupPolicy
protected 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 ArtifactClassLoader
public <T extends ArtifactDescriptor> T getArtifactDescriptor()
getArtifactDescriptor
in interface ArtifactClassLoader
T
- the generic type of the artifact descriptor.protected String[] getLocalResourceLocations()
public ClassLoader getClassLoader()
ArtifactClassLoader
getClassLoader
in interface ArtifactClassLoader
public void addShutdownListener(ShutdownListener listener)
ArtifactClassLoader
addShutdownListener
in interface ArtifactClassLoader
public void dispose()
FineGrainedControlClassLoader
ClassLoader
by closing all the resources opened by this ClassLoader
. See
URLClassLoader.close()
.dispose
in interface DisposableClassLoader
dispose
in class FineGrainedControlClassLoader
protected ResourceReleaser createResourceReleaserInstance()
ResourceReleaser
using this classloader, only used outside in unit tests.public void setResourceReleaserClassLocation(String resourceReleaserClassLocation)
public URL findLocalResource(String resourceName)
LocalResourceLocator
findLocalResource
in interface LocalResourceLocator
resourceName
- name of the resource to find.Copyright © 2018. All rights reserved.