T - the type of the filer.public abstract class AbstractArtifactClassLoaderBuilder<T extends AbstractArtifactClassLoaderBuilder> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ArtifactDescriptor |
artifactDescriptor |
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
AbstractArtifactClassLoaderBuilder(RegionPluginClassLoadersFactory pluginClassLoadersFactory)
Creates an
AbstractArtifactClassLoaderBuilder. |
| Modifier and Type | Method and Description |
|---|---|
T |
addArtifactPluginDescriptors(ArtifactPluginDescriptor... artifactPluginDescriptors) |
ArtifactClassLoader |
build()
Creates a new
ArtifactClassLoader using the provided configuration. |
protected abstract ArtifactClassLoader |
createArtifactClassLoader(String artifactId,
RegionClassLoader regionClassLoader)
Creates the class loader for the artifact being built.
|
protected RegionClassLoader |
createRegionClassLoader(String artifactId,
ArtifactDescriptor artifactDescriptor,
ClassLoader parentClassLoader,
ClassLoaderLookupPolicy parentLookupPolicy)
Template method to build different implementations of a
RegionClassLoader |
protected abstract String |
getArtifactId(ArtifactDescriptor artifactDescriptor) |
protected abstract ArtifactClassLoader |
getParentClassLoader()
Implementation must redefine this method and it should provide the root class loader which is going to be used as parent
class loader for every other class loader created by this builder.
|
protected ClassLoaderLookupPolicy |
getParentLookupPolicy(ArtifactClassLoader parentClassLoader) |
T |
setArtifactDescriptor(ArtifactDescriptor artifactDescriptor) |
protected final org.slf4j.Logger logger
protected ArtifactDescriptor artifactDescriptor
public AbstractArtifactClassLoaderBuilder(RegionPluginClassLoadersFactory pluginClassLoadersFactory)
AbstractArtifactClassLoaderBuilder.pluginClassLoadersFactory - creates the class loaders for the plugins included in the artifact's region. Non nullprotected abstract ArtifactClassLoader getParentClassLoader()
public T addArtifactPluginDescriptors(ArtifactPluginDescriptor... artifactPluginDescriptors)
artifactPluginDescriptors - set of plugins descriptors that will be used by the application.public T setArtifactDescriptor(ArtifactDescriptor artifactDescriptor)
artifactDescriptor - the descriptor of the artifact for which the class loader is going to be created.public ArtifactClassLoader build()
ArtifactClassLoader using the provided configuration. It will create the proper class loader hierarchy
and filters the artifact resources and plugins classes and resources are resolve correctly.ArtifactClassLoader created from the provided configuration.RuntimeException - exception cause when it was not possible to access the file provided as dependenciesprotected RegionClassLoader createRegionClassLoader(String artifactId, ArtifactDescriptor artifactDescriptor, ClassLoader parentClassLoader, ClassLoaderLookupPolicy parentLookupPolicy)
RegionClassLoaderRegionClassLoaderprotected ClassLoaderLookupPolicy getParentLookupPolicy(ArtifactClassLoader parentClassLoader)
parentClassLoader - parent class loader for the creates artifact class loaderprotected abstract ArtifactClassLoader createArtifactClassLoader(String artifactId, RegionClassLoader regionClassLoader)
artifactId - identifies the artifact being created. Non empty.regionClassLoader - class loader containing the artifact and dependant class loaders. Non null.protected abstract String getArtifactId(ArtifactDescriptor artifactDescriptor)
Copyright © 2003–2023 MuleSoft, Inc.. All rights reserved.