public abstract class AbstractMavenClassLoaderModelLoader extends Object implements ClassLoaderModelLoader
ClassLoaderModelLoader that resolves the dependencies for all the mule artifacts and create
the ClassLoaderModel. It lets the implementations of this class to add artifact's specific class loader URLs| Modifier and Type | Field and Description |
|---|---|
static String |
CLASSLOADER_MODEL_JSON_DESCRIPTOR |
static String |
CLASSLOADER_MODEL_JSON_DESCRIPTOR_LOCATION |
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
AbstractMavenClassLoaderModelLoader(org.mule.maven.client.api.MavenClient mavenClient,
org.mule.maven.client.api.LocalRepositorySupplierFactory localRepositorySupplierFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addArtifactSpecificClassloaderConfiguration(File artifactFile,
ClassLoaderModel.ClassLoaderModelBuilder classLoaderModelBuilder,
Set<BundleDependency> dependencies)
Template method to add artifact specific configuration to the
ClassLoaderModel.ClassLoaderModelBuilder |
protected BundleDependency |
convertBundleDependency(org.mule.maven.client.api.model.BundleDependency mavenClientDependency) |
protected boolean |
enabledTestDependencies()
Template method to enable/disable test dependencies as part of the artifact classpath.
|
protected File |
getClassLoaderModelDescriptor(File artifactFile) |
String |
getId() |
ClassLoaderModel |
load(File artifactFile)
Loads the
ClassLoaderModel from an artifact with the provided maven pom model. |
ClassLoaderModel |
load(File artifactFile,
Map<String,Object> attributes,
ArtifactType artifactType)
Given an artifact location, it will resolve its dependencies on a Maven based mechanism.
|
protected org.apache.maven.model.Model |
loadPomModel(File artifactFile)
Template method to get the unresolved pom model from the artifact file
|
protected void |
loadUrls(File artifactFile,
ClassLoaderModel.ClassLoaderModelBuilder classLoaderModelBuilder,
Set<BundleDependency> dependencies)
Loads the URLs of the class loader for this artifact.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsupportsArtifactTypepublic static final String CLASSLOADER_MODEL_JSON_DESCRIPTOR
public static final String CLASSLOADER_MODEL_JSON_DESCRIPTOR_LOCATION
protected final org.slf4j.Logger logger
public AbstractMavenClassLoaderModelLoader(org.mule.maven.client.api.MavenClient mavenClient,
org.mule.maven.client.api.LocalRepositorySupplierFactory localRepositorySupplierFactory)
public String getId()
getId in interface DescriptorLoader<ClassLoaderModel>public final ClassLoaderModel load(File artifactFile, Map<String,Object> attributes, ArtifactType artifactType) throws InvalidDescriptorLoaderException
ClassLoaderModel, and it will also consume all Mule plugin dependencies so that further validations can check whether
or not all plugins are loaded in memory before running an application.
Finally, it will also tell the resulting ClassLoaderModel which packages and/or resources has to export, consuming
the attributes from the MuleArtifactLoaderDescriptor.getAttributes() map.load in interface DescriptorLoader<ClassLoaderModel>artifactFile - File where the current plugin to work with.attributes - a set of attributes to work with, where the current implementation of this class will look for
ArtifactDescriptorConstants.EXPORTED_PACKAGES and ArtifactDescriptorConstants.EXPORTED_RESOURCESClassLoaderModel loaded with all its dependencies and URLs.InvalidDescriptorLoaderExceptionprotected BundleDependency convertBundleDependency(org.mule.maven.client.api.model.BundleDependency mavenClientDependency)
public final ClassLoaderModel load(File artifactFile) throws InvalidDescriptorLoaderException
ClassLoaderModel from an artifact with the provided maven pom model.artifactFile - the artifact folderClassLoaderModel loaded with all its dependencies and URLs.InvalidDescriptorLoaderExceptionprotected org.apache.maven.model.Model loadPomModel(File artifactFile)
artifactFile - the artifact fileprotected void loadUrls(File artifactFile, ClassLoaderModel.ClassLoaderModelBuilder classLoaderModelBuilder, Set<BundleDependency> dependencies)
It let's implementations to add artifact specific URLs by letting them override
addArtifactSpecificClassloaderConfiguration(File, ClassLoaderModel.ClassLoaderModelBuilder, Set)
artifactFile - the artifact file for which the ClassLoaderModel is being generated.classLoaderModelBuilder - the builder of the ClassLoaderModeldependencies - the dependencies resolved for this artifact.protected boolean enabledTestDependencies()
protected void addArtifactSpecificClassloaderConfiguration(File artifactFile, ClassLoaderModel.ClassLoaderModelBuilder classLoaderModelBuilder, Set<BundleDependency> dependencies)
ClassLoaderModel.ClassLoaderModelBuilderartifactFile - the artifact file from which the classloader model is generated.classLoaderModelBuilder - the builder used to generate ClassLoaderModel of the artifact.dependencies - the set of dependencies of the artifact.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.