
org.mule.runtime.container.internal.ContainerOnlyLookupStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mule-module-container Show documentation
Show all versions of mule-module-container Show documentation
Provides container artifact related functionality
The newest version!
/*
* Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.runtime.container.internal;
import static java.util.Collections.singletonList;
import static org.mule.runtime.api.util.Preconditions.checkArgument;
import org.mule.runtime.module.artifact.api.classloader.LookupStrategy;
import java.util.List;
/**
* Defines a {@link LookupStrategy} that will search on the container's classloader only, without searching
* on the given classloader.
*/
public class ContainerOnlyLookupStrategy implements LookupStrategy {
private final List classLoaders;
/**
* Creates a new instance
*
* @param containerClassLoader class loader containing the container classes. Not null.
*/
public ContainerOnlyLookupStrategy(ClassLoader containerClassLoader) {
checkArgument(containerClassLoader != null, "containerClassLoader cannot be null");
classLoaders = singletonList(containerClassLoader);
}
@Override
public List getClassLoaders(ClassLoader classLoader) {
return classLoaders;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy