Skip to content

Commit 4cccd2c

Browse files
committed
Update URLClassPathHandle.java
1 parent 2605361 commit 4cccd2c

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

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

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,45 @@
2727
import static io.microsphere.util.ClassLoaderUtils.findURLClassLoader;
2828

2929
/**
30-
* The handle interface for URL Class-Path
30+
* A strategy interface for handling URL Class-Path entries in a {@link ClassLoader}.
31+
* Implementations of this interface can provide custom logic for interacting with
32+
* URLs related to class loading, such as retrieving or removing URLs from a class loader.
33+
*
34+
* <p>
35+
* This interface extends {@link Prioritized}, allowing implementations to define their
36+
* priority order. The default implementation of {@link #getPriority()} returns
37+
* {@link Prioritized#MIN_PRIORITY}, making it the lowest priority unless overridden.
38+
* </p>
39+
*
40+
* <h2>Example Implementation</h2>
41+
* <pre>{@code
42+
* public class ClassicURLClassPathHandle implements URLClassPathHandle {
43+
*
44+
* private final int priority;
45+
*
46+
* public ClassicURLClassPathHandle(int priority) {
47+
* this.priority = priority;
48+
* }
49+
*
50+
* public boolean supports() {
51+
* return true; // Always support classic handling
52+
* }
53+
*
54+
* public boolean removeURL(ClassLoader classLoader, URL url) {
55+
* // Custom logic to remove a URL from the class loader
56+
* return false; // Placeholder implementation
57+
* }
58+
*
59+
* public int getPriority() {
60+
* return priority; // Custom priority
61+
* }
62+
* }
63+
* }</pre>
3164
*
3265
* @author <a href="mailto:mercyblitz@gmail.com">Mercy<a/>
3366
* @see ClassicURLClassPathHandle
3467
* @see ModernURLClassPathHandle
68+
* @see Prioritized
3569
* @since 1.0.0
3670
*/
3771
public interface URLClassPathHandle extends Prioritized {

0 commit comments

Comments
 (0)