Package io.microsphere.classloading
Class BannedArtifactClassLoadingExecutor
- java.lang.Object
-
- io.microsphere.classloading.BannedArtifactClassLoadingExecutor
-
public class BannedArtifactClassLoadingExecutor extends java.lang.ObjectThe executor for the banned artifacts that are loading byClassLoader.The banned list should be defined at the config resource that locates on the "META-INF/banned-artifacts" was loaded by
ClassLoader.The config resource format :
${groupId}:${artifactId}:${version}- groupId : Artifact Maven groupId
- artifactId : Artifact Maven artifactId
- version : Artifact Maven version
Example Usage
// Create a default instance and execute to remove banned artifacts from classpath BannedArtifactClassLoadingExecutor executor = new BannedArtifactClassLoadingExecutor(); executor.execute();This will load all the banned artifact definitions from "META-INF/banned-artifacts" resources in the current classloader, detect all non-JDK artifacts in the classpath, and remove URLs corresponding to any matched banned artifacts.
You can also provide a custom
ClassLoaderif you want to inspect a specific one:ClassLoader customClassLoader = ...; // your custom class loader BannedArtifactClassLoadingExecutor executor = new BannedArtifactClassLoadingExecutor(customClassLoader); executor.execute();- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ArtifactDetector,MavenArtifact,Artifact
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_LOCATION
-
Constructor Summary
Constructors Constructor Description BannedArtifactClassLoadingExecutor()BannedArtifactClassLoadingExecutor(java.lang.ClassLoader classLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()
-
-
-
Field Detail
-
CONFIG_LOCATION
public static final java.lang.String CONFIG_LOCATION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BannedArtifactClassLoadingExecutor
public BannedArtifactClassLoadingExecutor()
-
BannedArtifactClassLoadingExecutor
public BannedArtifactClassLoadingExecutor(@Nullable java.lang.ClassLoader classLoader)
-
-