public abstract class AbstractMavenClassLoaderConfigurationLoader extends Object implements ClassLoaderConfigurationLoader
ClassLoaderConfigurationLoader that resolves the dependencies for all the mule artifacts and
create the ClassLoaderConfiguration. 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 |
static String |
MULE_ARTIFACT_PATCH_JSON_FILE_NAME |
static String |
MULE_ARTIFACT_PATCHES_LOCATION |
| Constructor and Description |
|---|
AbstractMavenClassLoaderConfigurationLoader(Optional<org.mule.maven.client.api.MavenClient> mavenClient) |
AbstractMavenClassLoaderConfigurationLoader(Optional<org.mule.maven.client.api.MavenClient> mavenClient,
Supplier<JarExplorer> jarExplorerFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected List<URL> |
addArtifactSpecificClassloaderConfiguration(ArtifactClassLoaderConfigurationBuilder classLoaderConfigurationBuilder)
Template method to add artifact specific configuration to the
ClassLoaderConfiguration.ClassLoaderConfigurationBuilder |
protected ClassLoaderConfiguration |
createClassLoaderConfiguration(File artifactFile,
Map<String,Object> attributes,
ArtifactType artifactType) |
protected ClassLoaderConfiguration |
createHeavyPackageClassLoaderConfiguration(File artifactFile,
File classLoaderModelDescriptor,
Map<String,Object> attributes,
Optional<File> deployableArtifactRepositoryFolder) |
protected ClassLoaderConfiguration |
createHeavyPackageClassLoaderConfiguration(File artifactFile,
Map<String,Object> attributes,
Optional<File> deployableArtifactRepositoryFolder,
org.mule.tools.api.classloader.model.ClassLoaderModel packagerClassLoaderModel) |
protected ClassLoaderConfiguration |
createLightPackageClassLoaderConfiguration(File artifactFile,
Map<String,Object> attributes,
ArtifactType artifactType,
org.mule.maven.client.api.MavenClient mavenClient) |
protected File |
getClassLoaderModelDescriptor(File artifactFile) |
protected File |
getClassLoaderModelPatchDescriptor(File artifactFile) |
String |
getId() |
protected Optional<File> |
getLocalMavenRepo(File artifactFile,
org.mule.maven.client.api.MavenClient mavenClient) |
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) |
ClassLoaderConfiguration |
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 HeavyweightClassLoaderConfigurationBuilder |
newHeavyWeightClassLoaderConfigurationBuilder(File artifactFile,
BundleDescriptor artifactBundleDescriptor,
org.mule.tools.api.classloader.model.ClassLoaderModel packagerClassLoaderModel,
Map<String,Object> attributes) |
protected abstract LightweightClassLoaderConfigurationBuilder |
newLightweightClassLoaderConfigurationBuilder(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,
ArtifactClassLoaderConfigurationBuilder classLoaderConfigurationBuilder) |
protected List<BundleDependency> |
resolveArtifactDependencies(File artifactFile,
Map<String,Object> attributes,
ArtifactType artifactType,
org.mule.maven.client.api.MavenClient mavenClient) |
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
public AbstractMavenClassLoaderConfigurationLoader(Optional<org.mule.maven.client.api.MavenClient> mavenClient)
public AbstractMavenClassLoaderConfigurationLoader(Optional<org.mule.maven.client.api.MavenClient> mavenClient, Supplier<JarExplorer> jarExplorerFactory)
public String getId()
getId in interface DescriptorLoader<ClassLoaderConfiguration>public final ClassLoaderConfiguration load(File artifactFile, Map<String,Object> attributes, ArtifactType artifactType) throws InvalidDescriptorLoaderException
ClassLoaderConfiguration, 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 ClassLoaderConfiguration which packages and/or resources has to export,
consuming the attributes from the MuleArtifactLoaderDescriptor.getAttributes() map.load in interface DescriptorLoader<ClassLoaderConfiguration>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_RESOURCESClassLoaderConfiguration loaded with all its dependencies and URLs.InvalidDescriptorLoaderExceptionprotected final ClassLoaderConfiguration createClassLoaderConfiguration(File artifactFile, Map<String,Object> attributes, ArtifactType artifactType) throws InvalidDescriptorLoaderException
InvalidDescriptorLoaderExceptionprotected ClassLoaderConfiguration createHeavyPackageClassLoaderConfiguration(File artifactFile, File classLoaderModelDescriptor, Map<String,Object> attributes, Optional<File> deployableArtifactRepositoryFolder)
protected ClassLoaderConfiguration createHeavyPackageClassLoaderConfiguration(File artifactFile, Map<String,Object> attributes, Optional<File> deployableArtifactRepositoryFolder, org.mule.tools.api.classloader.model.ClassLoaderModel packagerClassLoaderModel)
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, org.mule.maven.client.api.MavenClient mavenClient)
protected final Optional<File> getLocalMavenRepo(File artifactFile, org.mule.maven.client.api.MavenClient mavenClient)
protected ClassLoaderConfiguration createLightPackageClassLoaderConfiguration(File artifactFile, Map<String,Object> attributes, ArtifactType artifactType, org.mule.maven.client.api.MavenClient mavenClient)
protected abstract LightweightClassLoaderConfigurationBuilder newLightweightClassLoaderConfigurationBuilder(File artifactFile, BundleDescriptor bundleDescriptor, org.mule.maven.client.api.MavenClient mavenClient, Map<String,Object> attributes, List<BundleDependency> nonProvidedDependencies)
protected abstract HeavyweightClassLoaderConfigurationBuilder newHeavyWeightClassLoaderConfigurationBuilder(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,
ArtifactClassLoaderConfigurationBuilder classLoaderConfigurationBuilder)
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(ArtifactClassLoaderConfigurationBuilder classLoaderConfigurationBuilder)
ClassLoaderConfiguration.ClassLoaderConfigurationBuilderclassLoaderConfigurationBuilder - the builder used to generate ClassLoaderConfiguration of the artifact.Copyright © 2003–2022 MuleSoft, Inc.. All rights reserved.