public class ToolingArtifactClassLoader extends Object implements ArtifactClassLoader
ClassLoader that will delegate every call to it's delegate (the specific
org.eclipse.aether.artifact.Artifact under delegateArtifactClassLoader, but when doing the dispose()
it will dispatch to the RegionClassLoader pointed by regionClassLoader that contains all the related class
loaders in it.| Constructor and Description |
|---|
ToolingArtifactClassLoader(RegionClassLoader regionClassLoader,
ArtifactClassLoader delegateArtifactClassLoader)
Generates an instance of an
ArtifactClassLoader if the parametrized regionClassLoader does contain within its
RegionClassLoader.getArtifactPluginClassLoaders() the class loader responsible of handling the
artifactPluginDescriptor. |
| Modifier and Type | Method and Description |
|---|---|
void |
addShutdownListener(ShutdownListener listener) |
void |
dispose()
We want tooling believe the
ArtifactClassLoader he's handling is the plugin's or application's one, but we are
actually shipping more than that with the RegionClassLoader. |
URL |
findInternalResource(String resource) |
Class<?> |
findLocalClass(String name) |
URL |
findLocalResource(String resourceName) |
URL |
findResource(String resource) |
Enumeration<URL> |
findResources(String name) |
<T extends ArtifactDescriptor> |
getArtifactDescriptor() |
String |
getArtifactId() |
List<ArtifactClassLoader> |
getArtifactPluginClassLoaders() |
ClassLoader |
getClassLoader() |
ClassLoaderLookupPolicy |
getClassLoaderLookupPolicy() |
RegionClassLoader |
getRegionClassLoader() |
Class<?> |
loadInternalClass(String name) |
public ToolingArtifactClassLoader(RegionClassLoader regionClassLoader, ArtifactClassLoader delegateArtifactClassLoader)
ArtifactClassLoader if the parametrized regionClassLoader does contain within its
RegionClassLoader.getArtifactPluginClassLoaders() the class loader responsible of handling the
artifactPluginDescriptor.regionClassLoader - class loader used to execute the dispose() properly.delegateArtifactClassLoader - ArtifactClassLoader where this classloader should delegate.public List<ArtifactClassLoader> getArtifactPluginClassLoaders()
List for ArtifactClassLoader for the plugins of the region.public RegionClassLoader getRegionClassLoader()
RegionClassLoader that this artifact class loader belongs too.public String getArtifactId()
getArtifactId in interface ArtifactClassLoaderpublic <T extends ArtifactDescriptor> T getArtifactDescriptor()
getArtifactDescriptor in interface ArtifactClassLoaderpublic URL findResource(String resource)
findResource in interface ArtifactClassLoaderpublic URL findInternalResource(String resource)
findInternalResource in interface ArtifactClassLoaderpublic Enumeration<URL> findResources(String name) throws IOException
findResources in interface ArtifactClassLoaderIOExceptionpublic Class<?> findLocalClass(String name) throws ClassNotFoundException
findLocalClass in interface ArtifactClassLoaderClassNotFoundExceptionpublic Class<?> loadInternalClass(String name) throws ClassNotFoundException
loadInternalClass in interface ArtifactClassLoaderClassNotFoundExceptionpublic ClassLoader getClassLoader()
getClassLoader in interface ArtifactClassLoaderpublic void addShutdownListener(ShutdownListener listener)
addShutdownListener in interface ArtifactClassLoaderpublic ClassLoaderLookupPolicy getClassLoaderLookupPolicy()
getClassLoaderLookupPolicy in interface ClassLoaderLookupPolicyProviderpublic URL findLocalResource(String resourceName)
findLocalResource in interface LocalResourceLocatorpublic void dispose()
ArtifactClassLoader he's handling is the plugin's or application's one, but we are
actually shipping more than that with the RegionClassLoader.
So, to avoid any leaks the dispose() of the plugin's ArtifactClassLoader is actually the one for the
RegionClassLoader, which will eventually execute a dispose() over the plugin's or application's one.
dispose in interface DisposableClassLoaderCopyright © 2003–2019 MuleSoft, Inc.. All rights reserved.