Skip to content

Commit 0c0e143

Browse files
committed
Update AbstractURLClassPathHandle.java
1 parent 4cccd2c commit 0c0e143

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

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

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,43 @@
3636
import static java.lang.ClassLoader.getSystemClassLoader;
3737

3838
/**
39-
* Abstract {@link URLClassPathHandle}
39+
* Abstract implementation of {@link URLClassPathHandle} that provides a base for handling URL Class-Path entries.
40+
*
41+
* <p>This class offers reflective access to internal structures like the {@code ucp}, {@code urls}, and
42+
* {@code loaders} fields used by the JVM's class loading mechanism. It is primarily designed for advanced use cases
43+
* where fine-grained control over class loader URLs is required, such as dynamic removal or modification of URLs from
44+
* a class loader.
45+
*
46+
* <h2>Key Features:</h2>
47+
* <ul>
48+
* <li>Supports reflective manipulation of internal JVM class loading structures.</li>
49+
* <li>Provides abstraction over different versions of JVM internals (e.g., classic vs modern JDK).</li>
50+
* <li>Implements the {@link Prioritized} interface to allow prioritization among multiple handlers.</li>
51+
* </ul>
52+
*
53+
* <h2>Example Usage:</h2>
54+
* <pre>{@code
55+
* public class ClassicURLClassPathHandle extends AbstractURLClassPathHandle {
56+
*
57+
* public ClassicURLClassPathHandle() {
58+
* // Default constructor
59+
* }
60+
*
61+
* protected String getURLClassPathClassName() {
62+
* return "sun.misc.URLClassPath";
63+
* }
64+
*
65+
* protected String getUrlsFieldName() {
66+
* return "urls"; // Classic field name
67+
* }
68+
* }
69+
* }</pre>
4070
*
4171
* @author <a href="mailto:mercyblitz@gmail.com">Mercy<a/>
4272
* @see ClassicURLClassPathHandle
4373
* @see ModernURLClassPathHandle
4474
* @see URLClassPathHandle
75+
* @see Prioritized
4576
* @since 1.0.0
4677
*/
4778
public abstract class AbstractURLClassPathHandle implements URLClassPathHandle, Prioritized {

0 commit comments

Comments
 (0)