接口 ClassLoaderService
-
- 所有超级接口:
Serializable,Service,Stoppable
- 所有已知实现类:
ClassLoaderServiceImpl
public interface ClassLoaderService extends Service, Stoppable
A service for interacting with class loaders.- 作者:
- Steve Ebersole
-
-
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static interfaceClassLoaderService.Work<T>
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 <T> Class<T>classForName(String className)Locate a class by name.<T> TgenerateProxy(InvocationHandler handler, Class... interfaces)<S> Collection<S>loadJavaServices(Class<S> serviceContract)Discovers and instantiates implementations of the named service contract.URLlocateResource(String name)Locate a resource by name (classpath lookup).List<URL>locateResources(String name)Locate a series of resource by name (classpath lookup).InputStreamlocateResourceStream(String name)Locate a resource by name (classpath lookup) and gets its stream.<T> TworkWithClassLoader(ClassLoaderService.Work<T> work)
-
-
-
方法详细资料
-
classForName
<T> Class<T> classForName(String className)
Locate a class by name.- 类型参数:
T- The returned class type.- 参数:
className- The name of the class to locate- 返回:
- The class reference
- 抛出:
ClassLoadingException- Indicates the class could not be found
-
locateResource
URL locateResource(String name)
Locate a resource by name (classpath lookup).- 参数:
name- The resource name.- 返回:
- The located URL; may return
nullto indicate the resource was not found
-
locateResourceStream
InputStream locateResourceStream(String name)
Locate a resource by name (classpath lookup) and gets its stream.- 参数:
name- The resource name.- 返回:
- The stream of the located resource; may return
nullto indicate the resource was not found
-
locateResources
List<URL> locateResources(String name)
Locate a series of resource by name (classpath lookup).- 参数:
name- The resource name.- 返回:
- The list of URL matching; may return
nullto indicate the resource was not found
-
loadJavaServices
<S> Collection<S> loadJavaServices(Class<S> serviceContract)
Discovers and instantiates implementations of the named service contract. NOTE : the terms service here is used differently thanService. Instead here we are talking about services as defined byServiceLoader.- 类型参数:
S- The type of the service contract- 参数:
serviceContract- The java type defining the service contract- 返回:
- The ordered set of discovered services.
-
generateProxy
<T> T generateProxy(InvocationHandler handler, Class... interfaces)
-
workWithClassLoader
<T> T workWithClassLoader(ClassLoaderService.Work<T> work)
-
-