public class IsolatedClassLoaderFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
IsolatedClassLoaderFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected org.mule.runtime.module.artifact.classloader.ArtifactClassLoader |
createApplicationArtifactClassLoader(ClassLoader parent,
org.mule.runtime.module.artifact.classloader.ClassLoaderLookupPolicy childClassLoaderLookupPolicy,
ArtifactsUrlClassification artifactsUrlClassification)
Creates an
ArtifactClassLoader for the application. |
ArtifactClassLoaderHolder |
createArtifactClassLoader(List<String> extraBootPackages,
ArtifactsUrlClassification artifactsUrlClassification)
Creates a
ArtifactClassLoaderHolder containing the container, plugins and application ArtifactClassLoaders |
protected org.mule.runtime.module.artifact.classloader.ArtifactClassLoader |
createContainerArtifactClassLoader(TestContainerClassLoaderFactory testContainerClassLoaderFactory,
ArtifactsUrlClassification artifactsUrlClassification)
Creates an
ArtifactClassLoader for the container. |
protected org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader |
createLauncherArtifactClassLoader()
Creates the launcher application class loader to delegate from container class loader.
|
protected List<org.mule.runtime.module.artifact.classloader.ArtifactClassLoader> |
createServiceClassLoaders(ClassLoader parent,
org.mule.runtime.module.artifact.classloader.ClassLoaderLookupPolicy childClassLoaderLookupPolicy,
ArtifactsUrlClassification artifactsUrlClassification)
For each service defined in the classification it creates an
ArtifactClassLoader wit the name defined in
classification. |
protected void |
logClassLoaderUrls(String classLoaderName,
List<URL> urls)
|
public ArtifactClassLoaderHolder createArtifactClassLoader(List<String> extraBootPackages, ArtifactsUrlClassification artifactsUrlClassification)
ArtifactClassLoaderHolder containing the container, plugins and application ArtifactClassLoadersextraBootPackages - List of Strings of extra boot packages to be appended to the container
ClassLoaderartifactsUrlClassification - the ArtifactsUrlClassification that defines the different URLs for each
ClassLoaderArtifactClassLoaderHolder that would be used to run the testprotected List<org.mule.runtime.module.artifact.classloader.ArtifactClassLoader> createServiceClassLoaders(ClassLoader parent, org.mule.runtime.module.artifact.classloader.ClassLoaderLookupPolicy childClassLoaderLookupPolicy, ArtifactsUrlClassification artifactsUrlClassification)
ArtifactClassLoader wit the name defined in
classification.parent - the parent class loader to be assigned to the new one created herechildClassLoaderLookupPolicy - look policy to be usedartifactsUrlClassification - the url classifications to get service URLsArtifactClassLoader for service class loadersprotected org.mule.runtime.module.artifact.classloader.ArtifactClassLoader createContainerArtifactClassLoader(TestContainerClassLoaderFactory testContainerClassLoaderFactory, ArtifactsUrlClassification artifactsUrlClassification)
ArtifactClassLoader for the container. The difference between a mule container ArtifactClassLoader
in standalone mode and this one is that it has to be aware that the parent class loader has all the URLs loaded in launcher
app class loader so it has to create a particular look policy to resolve classes as CHILD_FIRST.
In order to do that a FilteringArtifactClassLoader resolve is created with and empty look policy (meaning that
CHILD_FIRST strategy will be used) for the URLs that are going to be exposed from the container class loader. This
would be the parent class loader for the container so instead of going directly the launcher application class loader that
has access to the whole classpath this filtering class loader will resolve only the classes for the URLs defined to
be in the container.testContainerClassLoaderFactory - TestContainerClassLoaderFactory that has the logic to create a container class
loaderartifactsUrlClassification - the classifications to get plugins URLsArtifactClassLoader for the containerprotected org.mule.runtime.module.artifact.classloader.MuleArtifactClassLoader createLauncherArtifactClassLoader()
ArtifactClassLoader for the launcher, parent of containerprotected org.mule.runtime.module.artifact.classloader.ArtifactClassLoader createApplicationArtifactClassLoader(ClassLoader parent, org.mule.runtime.module.artifact.classloader.ClassLoaderLookupPolicy childClassLoaderLookupPolicy, ArtifactsUrlClassification artifactsUrlClassification)
ArtifactClassLoader for the application.parent - the parent class loader to be assigned to the new one created herechildClassLoaderLookupPolicy - look policy to be usedartifactsUrlClassification - the url classifications to get plugins urlsArtifactClassLoader to be used for running the testprotected void logClassLoaderUrls(String classLoaderName, List<URL> urls)
classLoaderName - the name of the ClassLoader to be loggedurls - List of URLs that are going to be used for the ClassLoaderCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.