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 ArtifactClassLoaderFactory |
artifactPluginClassLoaderFactory |
protected List<ArtifactClassLoader> |
artifactPluginClassLoaders |
protected org.slf4j.Logger |
logger |
static String |
PLUGIN_CLASSLOADER_IDENTIFIER |
| Constructor and Description |
|---|
AbstractArtifactClassLoaderBuilder(ArtifactClassLoaderFactory<ArtifactPluginDescriptor> artifactPluginClassLoaderFactory)
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) |
static String |
getArtifactPluginId(String parentArtifactId,
String pluginName) |
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.
|
T |
setArtifactDescriptor(ArtifactDescriptor artifactDescriptor) |
T |
setArtifactId(String artifactId) |
public static final String PLUGIN_CLASSLOADER_IDENTIFIER
protected final org.slf4j.Logger logger
protected final ArtifactClassLoaderFactory artifactPluginClassLoaderFactory
protected ArtifactDescriptor artifactDescriptor
protected List<ArtifactClassLoader> artifactPluginClassLoaders
public AbstractArtifactClassLoaderBuilder(ArtifactClassLoaderFactory<ArtifactPluginDescriptor> artifactPluginClassLoaderFactory)
AbstractArtifactClassLoaderBuilder.artifactPluginClassLoaderFactory - factory to create class loaders for each used plugin. Non be not null.protected 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 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)
public static String getArtifactPluginId(String parentArtifactId, String pluginName)
parentArtifactId - identifier of the artifact that owns the plugin. Non empty.pluginName - name of the plugin. Non empty.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.