Skip to content

Commit 9d36e57

Browse files
committed
Update BannedArtifactClassLoadingExecutor.java
1 parent f68c444 commit 9d36e57

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

microsphere-java-core/src/main/java/io/microsphere/classloading/BannedArtifactClassLoadingExecutor.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,29 @@
3434
* <li>version : Artifact Maven version</li>
3535
* </ul>
3636
*
37+
* <h3>Example Usage</h3>
38+
* <pre>{@code
39+
* // Create a default instance and execute to remove banned artifacts from classpath
40+
* BannedArtifactClassLoadingExecutor executor = new BannedArtifactClassLoadingExecutor();
41+
* executor.execute();
42+
* }</pre>
43+
*
44+
* <p>This will load all the banned artifact definitions from "META-INF/banned-artifacts"
45+
* resources in the current classloader, detect all non-JDK artifacts in the classpath,
46+
* and remove URLs corresponding to any matched banned artifacts.</p>
47+
*
48+
* <p>You can also provide a custom {@link ClassLoader} if you want to inspect a specific one:</p>
49+
*
50+
* <pre>{@code
51+
* ClassLoader customClassLoader = ...; // your custom class loader
52+
* BannedArtifactClassLoadingExecutor executor = new BannedArtifactClassLoadingExecutor(customClassLoader);
53+
* executor.execute();
54+
* }</pre>
55+
*
3756
* @author <a href="mailto:mercyblitz@gmail.com">Mercy<a/>
57+
* @see ArtifactDetector
58+
* @see MavenArtifact
59+
* @see Artifact
3860
* @since 1.0.0
3961
*/
4062
public class BannedArtifactClassLoadingExecutor {

0 commit comments

Comments
 (0)