Package io.microsphere.classloading
Class AbstractURLClassPathHandle
- java.lang.Object
-
- io.microsphere.classloading.AbstractURLClassPathHandle
-
- All Implemented Interfaces:
URLClassPathHandle
,Prioritized
,java.lang.Comparable<Prioritized>
- Direct Known Subclasses:
ClassicURLClassPathHandle
,ModernURLClassPathHandle
public abstract class AbstractURLClassPathHandle extends java.lang.Object implements URLClassPathHandle, Prioritized
AbstractURLClassPathHandle
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ClassicURLClassPathHandle
,ModernURLClassPathHandle
,URLClassPathHandle
-
-
Field Summary
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description AbstractURLClassPathHandle()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.reflect.Field
findUcpField(java.lang.ClassLoader classLoader)
protected java.lang.reflect.Field
getBaseField()
protected java.lang.Class<?>
getLoaderClass()
protected java.lang.reflect.Field
getLoadersField()
protected java.lang.reflect.Field
getPathField()
int
getPriority()
Get the priorityprotected java.lang.Class<?>
getUrlClassPathClass()
protected abstract java.lang.String
getURLClassPathClassName()
java.net.URL[]
getURLs(java.lang.ClassLoader classLoader)
Get the Class-Path URLs from the specifiedClassLoader
protected java.lang.reflect.Field
getUrlsField()
protected abstract java.lang.String
getUrlsFieldName()
boolean
removeURL(java.lang.ClassLoader classLoader, java.net.URL url)
Remove the Class-PathURL
from the specifiedClassLoader
void
setPriority(int priority)
boolean
supports()
Supports or not-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo
-
-
-
-
Method Detail
-
supports
public boolean supports()
Description copied from interface:URLClassPathHandle
Supports or not- Specified by:
supports
in interfaceURLClassPathHandle
- Returns:
- if supports, return
true
, otherwisefalse
-
getURLs
@Nonnull public java.net.URL[] getURLs(java.lang.ClassLoader classLoader)
Description copied from interface:URLClassPathHandle
Get the Class-Path URLs from the specifiedClassLoader
- Specified by:
getURLs
in interfaceURLClassPathHandle
- Parameters:
classLoader
- the specifiedClassLoader
- Returns:
- the non-null array of
URLs
-
removeURL
public final boolean removeURL(java.lang.ClassLoader classLoader, java.net.URL url)
Description copied from interface:URLClassPathHandle
Remove the Class-PathURL
from the specifiedClassLoader
- Specified by:
removeURL
in interfaceURLClassPathHandle
- Parameters:
classLoader
- the specifiedClassLoader
url
- the Class-PathURL
- Returns:
- if removed, return
true
, otherwisefalse
-
setPriority
public final void setPriority(int priority)
-
getPriority
public final int getPriority()
Description copied from interface:Prioritized
Get the priority- Specified by:
getPriority
in interfacePrioritized
- Returns:
- the default is
minimum one
-
getUrlClassPathClass
protected final java.lang.Class<?> getUrlClassPathClass()
-
getLoaderClass
protected final java.lang.Class<?> getLoaderClass()
-
findUcpField
protected final java.lang.reflect.Field findUcpField(java.lang.ClassLoader classLoader)
-
getPathField
protected final java.lang.reflect.Field getPathField()
-
getUrlsField
protected final java.lang.reflect.Field getUrlsField()
-
getLoadersField
protected final java.lang.reflect.Field getLoadersField()
-
getBaseField
protected final java.lang.reflect.Field getBaseField()
-
getURLClassPathClassName
protected abstract java.lang.String getURLClassPathClassName()
-
getUrlsFieldName
protected abstract java.lang.String getUrlsFieldName()
-
-