Search in sources :

Example 1 with MuleClassLoaderLookupPolicy

use of org.mule.runtime.container.internal.MuleClassLoaderLookupPolicy in project mule by mulesoft.

the class TestContainerClassLoaderFactory method createContainerClassLoader.

/**
 * Overrides method due to it has to use the {@link ClassLoader} set to this factory in order to discover modules.
 *
 * @param parentClassLoader parent classLoader. Can be null.
 * @return a non null {@link ArtifactClassLoader} containing container code that can be used as parent classloader for other
 *         mule artifacts.
 */
@Override
public ArtifactClassLoader createContainerClassLoader(final ClassLoader parentClassLoader) {
    final List<MuleModule> muleModules = withContextClassLoader(classLoader, () -> testContainerModuleRepository.getModules());
    MuleClassLoaderLookupPolicy lookupPolicy = new MuleClassLoaderLookupPolicy(Collections.emptyMap(), getBootPackages());
    return createArtifactClassLoader(parentClassLoader, muleModules, lookupPolicy, new ArtifactDescriptor("mule"));
}
Also used : MuleClassLoaderLookupPolicy(org.mule.runtime.container.internal.MuleClassLoaderLookupPolicy) ArtifactDescriptor(org.mule.runtime.module.artifact.api.descriptor.ArtifactDescriptor) MuleModule(org.mule.runtime.container.api.MuleModule)

Aggregations

MuleModule (org.mule.runtime.container.api.MuleModule)1 MuleClassLoaderLookupPolicy (org.mule.runtime.container.internal.MuleClassLoaderLookupPolicy)1 ArtifactDescriptor (org.mule.runtime.module.artifact.api.descriptor.ArtifactDescriptor)1