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 |
CLASS_LOADER_MODEL_VERSION_120 |
static String |
CLASSLOADER_MODEL_JSON_DESCRIPTOR |
static String |
CLASSLOADER_MODEL_JSON_DESCRIPTOR_LOCATION |
static String |
CLASSLOADER_MODEL_JSON_PATCH_DESCRIPTOR |
static String |
CLASSLOADER_MODEL_JSON_PATCH_DESCRIPTOR_LOCATION |
static String |
CLASSLOADER_MODEL_MAVEN_REACTOR_RESOLVER |
protected org.slf4j.Logger |
LOGGER |
protected org.mule.maven.client.api.MavenClient |
mavenClient |
static String |
MULE_ARTIFACT_PATCH_JSON_FILE_NAME |
static String |
MULE_ARTIFACT_PATCHES_LOCATION |
| Constructor and Description |
|---|
AbstractMavenClassLoaderModelLoader(org.mule.maven.client.api.MavenClient mavenClient) |
AbstractMavenClassLoaderModelLoader(org.mule.maven.client.api.MavenClient mavenClient,
Supplier<JarExplorer> jarExplorerFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected List<URL> |
addArtifactSpecificClassloaderConfiguration(ArtifactClassLoaderModelBuilder classLoaderModelBuilder)
Template method to add artifact specific configuration to the
ClassLoaderModel.ClassLoaderModelBuilder |
protected ClassLoaderModel |
createClassLoaderModel(File artifactFile,
Map<String,Object> attributes,
ArtifactType artifactType) |
protected ClassLoaderModel |
createHeavyPackageClassLoaderModel(File artifactFile,
File classLoaderModelDescriptor,
Map<String,Object> attributes,
Optional<File> deployableArtifactRepositoryFolder) |
protected ClassLoaderModel |
createLightPackageClassLoaderModel(File artifactFile,
Map<String,Object> attributes,
ArtifactType artifactType) |
protected File |
getClassLoaderModelDescriptor(File artifactFile) |
protected File |
getClassLoaderModelPatchDescriptor(File artifactFile) |
String |
getId() |
protected abstract org.mule.tools.api.classloader.model.ClassLoaderModel |
getPackagerClassLoaderModel(File classLoaderModelDescriptor)
Template method to deserialize a
classloader-model.json into the expected
ClassLoaderModel implementation |
protected abstract boolean |
includeProvidedDependencies(ArtifactType artifactType) |
protected boolean |
includeTestDependencies(Map<String,Object> attributes)
Template method to enable/disable test dependencies as part of the artifact classpath.
|
protected boolean |
isHeavyPackage(File artifactFile,
Map<String,Object> attributes) |
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 abstract HeavyweightClassLoaderModelBuilder |
newHeavyWeightClassLoaderModelBuilder(File artifactFile,
BundleDescriptor artifactBundleDescriptor,
org.mule.tools.api.classloader.model.ClassLoaderModel packagerClassLoaderModel,
Map<String,Object> attributes) |
protected abstract LightweightClassLoaderModelBuilder |
newLightweightClassLoaderModelBuilder(File artifactFile,
BundleDescriptor bundleDescriptor,
org.mule.maven.client.api.MavenClient mavenClient,
Map<String,Object> attributes,
List<BundleDependency> nonProvidedDependencies) |
protected void |
populateLocalPackages(org.mule.runtime.module.deployment.impl.internal.maven.ArtifactAttributes artifactAttributes,
ArtifactClassLoaderModelBuilder classLoaderModelBuilder) |
protected List<BundleDependency> |
resolveArtifactDependencies(File artifactFile,
Map<String,Object> attributes,
ArtifactType artifactType) |
protected boolean |
validateMuleRuntimeSharedLibrary(String groupId,
String artifactId,
String artifactFileName) |
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_PATCH_DESCRIPTOR
public static final String CLASSLOADER_MODEL_JSON_DESCRIPTOR_LOCATION
public static final String CLASSLOADER_MODEL_JSON_PATCH_DESCRIPTOR_LOCATION
public static final String MULE_ARTIFACT_PATCHES_LOCATION
public static final String MULE_ARTIFACT_PATCH_JSON_FILE_NAME
public static final String CLASSLOADER_MODEL_MAVEN_REACTOR_RESOLVER
public static final String CLASS_LOADER_MODEL_VERSION_120
protected final org.slf4j.Logger LOGGER
protected org.mule.maven.client.api.MavenClient mavenClient
public AbstractMavenClassLoaderModelLoader(org.mule.maven.client.api.MavenClient mavenClient)
public AbstractMavenClassLoaderModelLoader(org.mule.maven.client.api.MavenClient mavenClient,
Supplier<JarExplorer> jarExplorerFactory)
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 ClassLoaderModel createClassLoaderModel(File artifactFile, Map<String,Object> attributes, ArtifactType artifactType) throws InvalidDescriptorLoaderException
InvalidDescriptorLoaderExceptionprotected ClassLoaderModel createHeavyPackageClassLoaderModel(File artifactFile, File classLoaderModelDescriptor, Map<String,Object> attributes, Optional<File> deployableArtifactRepositoryFolder)
protected abstract org.mule.tools.api.classloader.model.ClassLoaderModel getPackagerClassLoaderModel(File classLoaderModelDescriptor)
classloader-model.json into the expected
ClassLoaderModel implementationclassLoaderModelDescriptor - ClassLoaderModelprotected File getClassLoaderModelPatchDescriptor(File artifactFile)
protected List<BundleDependency> resolveArtifactDependencies(File artifactFile, Map<String,Object> attributes, ArtifactType artifactType)
protected ClassLoaderModel createLightPackageClassLoaderModel(File artifactFile, Map<String,Object> attributes, ArtifactType artifactType)
protected abstract LightweightClassLoaderModelBuilder newLightweightClassLoaderModelBuilder(File artifactFile, BundleDescriptor bundleDescriptor, org.mule.maven.client.api.MavenClient mavenClient, Map<String,Object> attributes, List<BundleDependency> nonProvidedDependencies)
protected abstract HeavyweightClassLoaderModelBuilder newHeavyWeightClassLoaderModelBuilder(File artifactFile, BundleDescriptor artifactBundleDescriptor, org.mule.tools.api.classloader.model.ClassLoaderModel packagerClassLoaderModel, Map<String,Object> attributes)
protected void populateLocalPackages(org.mule.runtime.module.deployment.impl.internal.maven.ArtifactAttributes artifactAttributes,
ArtifactClassLoaderModelBuilder classLoaderModelBuilder)
protected abstract boolean includeProvidedDependencies(ArtifactType artifactType)
protected final boolean validateMuleRuntimeSharedLibrary(String groupId, String artifactId, String artifactFileName)
protected boolean includeTestDependencies(Map<String,Object> attributes)
protected List<URL> addArtifactSpecificClassloaderConfiguration(ArtifactClassLoaderModelBuilder classLoaderModelBuilder)
ClassLoaderModel.ClassLoaderModelBuilderclassLoaderModelBuilder - the builder used to generate ClassLoaderModel of the artifact.Copyright © 2003–2025 MuleSoft, Inc.. All rights reserved.