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 List<ArtifactClassLoader> |
artifactPluginClassLoaders |
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 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) |
T |
setArtifactId(String artifactId) |
protected final org.slf4j.Logger logger
protected ArtifactDescriptor artifactDescriptor
protected List<ArtifactClassLoader> artifactPluginClassLoaders
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 setArtifactId(String artifactId)
artifactId - unique identifier for this artifact. For instance, for Applications, it can be the app name. Must be not
null.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() throws IOException
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.IOException - exception cause when it was not possible to access the file provided as dependenciesprotected 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–2018 MuleSoft, Inc.. All rights reserved.