public class ContainerClassLoaderFactory extends Object
This classLoader must be used as the parent classLoader for any other Mule artifact depending only on the container.
| Modifier and Type | Field and Description |
|---|---|
static Set<String> |
BOOT_PACKAGES
Boot packages define all the prefixes that must be loaded from the container classLoader without being filtered
|
static String |
MULE_ALLOW_JRE_EXTENSION |
static String |
MULE_JRE_EXTENSION_PACKAGES |
static Set<String> |
SYSTEM_PACKAGES
System package define all the prefixes that must be loaded only from the container classLoader, but then are filtered
depending on what is part of the exposed API.
|
| Constructor and Description |
|---|
ContainerClassLoaderFactory()
Creates a default factory
|
ContainerClassLoaderFactory(ModuleRepository moduleRepository)
Creates a custom factory
|
| Modifier and Type | Method and Description |
|---|---|
protected ArtifactClassLoader |
createArtifactClassLoader(ClassLoader parentClassLoader,
List<MuleModule> muleModules,
ClassLoaderLookupPolicy containerLookupPolicy,
ArtifactDescriptor artifactDescriptor)
Creates an
ArtifactClassLoader that always resolves resources by delegating to the parentClassLoader. |
ArtifactClassLoader |
createContainerClassLoader(ClassLoader parentClassLoader)
Creates the classLoader to represent the Mule container.
|
protected FilteringArtifactClassLoader |
createContainerFilteringClassLoader(ClassLoader parentClassLoader,
List<MuleModule> muleModules,
ArtifactClassLoader containerClassLoader)
Creates a
FilteringArtifactClassLoader to filter the ArtifactClassLoader containerClassLoader given based on
List of muleModules. |
protected Set<String> |
getBootPackages() |
protected ClassLoaderLookupPolicy |
getContainerClassLoaderLookupPolicy(ClassLoader parentClassLoader,
List<MuleModule> muleModules)
Creates the container lookup policy to be used by child class loaders.
|
public static final String MULE_ALLOW_JRE_EXTENSION
public static final String MULE_JRE_EXTENSION_PACKAGES
public static final Set<String> SYSTEM_PACKAGES
public ContainerClassLoaderFactory(ModuleRepository moduleRepository)
moduleRepository - provides access to the modules available on the container. Non null.public ContainerClassLoaderFactory()
public ArtifactClassLoader createContainerClassLoader(ClassLoader parentClassLoader)
parentClassLoader - parent classLoader. Can be null.ArtifactClassLoader containing container code that can be used as parent classloader for other
mule artifacts.protected ClassLoaderLookupPolicy getContainerClassLoaderLookupPolicy(ClassLoader parentClassLoader, List<MuleModule> muleModules)
parentClassLoader - classloader used as parent of the container's. Is the classLoader that will load Mule classes.muleModules - list of modules that would be used to register in the filter based of the class loader.ClassLoaderLookupPolicy that contains the lookup policies for boot, system packages. plus exported
packages by the given list of MuleModule.protected ArtifactClassLoader createArtifactClassLoader(ClassLoader parentClassLoader, List<MuleModule> muleModules, ClassLoaderLookupPolicy containerLookupPolicy, ArtifactDescriptor artifactDescriptor)
ArtifactClassLoader that always resolves resources by delegating to the parentClassLoader.parentClassLoader - the parent ClassLoader for the containermuleModules - the list of MuleModules to be used for defining the filtercontainerLookupPolicy - the ClassLoaderLookupPolicy to be used by the containerartifactDescriptor - descriptor for the artifact owning the created class loader instance.ArtifactClassLoader to be used in a FilteringContainerClassLoaderprotected FilteringArtifactClassLoader createContainerFilteringClassLoader(ClassLoader parentClassLoader, List<MuleModule> muleModules, ArtifactClassLoader containerClassLoader)
FilteringArtifactClassLoader to filter the ArtifactClassLoader containerClassLoader given based on
List of muleModules.parentClassLoader - the parent ClassLoader for the containermuleModules - the list of MuleModules to be used for defining the filtercontainerClassLoader - the ArtifactClassLoader for the container that will be used to delegate by the
FilteringContainerClassLoaderFilteringContainerClassLoader that would be the one used as the parent of plugins and applications
ArtifactClassLoaderCopyright © 2003–2022 MuleSoft, Inc.. All rights reserved.