T - the type of the filer.public abstract class AbstractArtifactClassLoaderBuilder<T extends AbstractArtifactClassLoaderBuilder> extends Object
| Constructor and Description |
|---|
AbstractArtifactClassLoaderBuilder(DeployableArtifactClassLoaderFactory artifactClassLoaderFactory,
ArtifactPluginRepository artifactPluginRepository,
ArtifactClassLoaderFactory<ArtifactPluginDescriptor> artifactPluginClassLoaderFactory,
ArtifactDescriptorFactory<ArtifactPluginDescriptor> artifactDescriptorFactory,
DependenciesProvider dependenciesProvider)
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 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 AbstractArtifactClassLoaderBuilder(DeployableArtifactClassLoaderFactory artifactClassLoaderFactory, ArtifactPluginRepository artifactPluginRepository, ArtifactClassLoaderFactory<ArtifactPluginDescriptor> artifactPluginClassLoaderFactory, ArtifactDescriptorFactory<ArtifactPluginDescriptor> artifactDescriptorFactory, DependenciesProvider dependenciesProvider)
AbstractArtifactClassLoaderBuilder.artifactClassLoaderFactory - factory for the classloader specific to the artifact resource and classes. Must be not
null.artifactPluginRepository - repository of plugins contained by the runtime. Must be not null.artifactPluginClassLoaderFactory - factory to create class loaders for each used plugin. Non be not null.artifactDescriptorFactory - factory to create ArtifactPluginDescriptor when there's a missing dependency to resolvedependenciesProvider - resolver for missing dependencies.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 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–2016 MuleSoft, Inc.. All rights reserved.