public class ToolingPluginArtifactClassLoader extends Object implements ArtifactClassLoader
ClassLoader that will delegate every call to it's delegate (the specific plugin class loader under
delegatePluginClassLoader, but when doing the dispose() it will dispatch
to the RegionClassLoader pointed by regionClassLoader that contains all the plugins in it.| Constructor and Description |
|---|
ToolingPluginArtifactClassLoader(RegionClassLoader regionClassLoader,
ArtifactPluginDescriptor artifactPluginDescriptor)
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 one, but we are actually shipping
more than that with the RegionClassLoader. |
Class<?> |
findLocalClass(String name) |
URL |
findLocalResource(String resourceName) |
URL |
findResource(String resource) |
Enumeration<URL> |
findResources(String name) |
<T extends ArtifactDescriptor> |
getArtifactDescriptor() |
String |
getArtifactId() |
ClassLoader |
getClassLoader() |
ClassLoaderLookupPolicy |
getClassLoaderLookupPolicy() |
public ToolingPluginArtifactClassLoader(RegionClassLoader regionClassLoader, ArtifactPluginDescriptor artifactPluginDescriptor)
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.artifactPluginDescriptor - descriptor to look for within the RegionClassLoader.public String getArtifactId()
getArtifactId in interface ArtifactClassLoaderpublic <T extends ArtifactDescriptor> T getArtifactDescriptor()
getArtifactDescriptor in interface ArtifactClassLoaderpublic URL findResource(String resource)
findResource in interface ArtifactClassLoaderpublic Enumeration<URL> findResources(String name) throws IOException
findResources in interface ArtifactClassLoaderIOExceptionpublic Class<?> findLocalClass(String name) throws ClassNotFoundException
findLocalClass 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 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 one.
dispose in interface DisposableClassLoaderCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.