public class ClassLoaderServiceImpl extends Object implements ClassLoaderService
ClassLoaderService.Work<T>| Constructor and Description |
|---|
ClassLoaderServiceImpl()
Constructs a ClassLoaderServiceImpl with standard set-up
|
ClassLoaderServiceImpl(ClassLoader classLoader)
Constructs a ClassLoaderServiceImpl with the given ClassLoader
|
ClassLoaderServiceImpl(Collection<ClassLoader> providedClassLoaders)
Constructs a ClassLoaderServiceImpl with the given ClassLoader instances
|
| Modifier and Type | Method and Description |
|---|---|
<T> Class<T> |
classForName(String className)
Locate a class by name.
|
static ClassLoaderServiceImpl |
fromConfigSettings(Map configValues)
Deprecated.
No longer used/supported!
|
<T> T |
generateProxy(InvocationHandler handler,
Class... interfaces) |
<S> Collection<S> |
loadJavaServices(Class<S> serviceContract)
Discovers and instantiates implementations of the named service contract.
|
URL |
locateResource(String name)
Locate a resource by name (classpath lookup).
|
List<URL> |
locateResources(String name)
Locate a series of resource by name (classpath lookup).
|
InputStream |
locateResourceStream(String name)
Locate a resource by name (classpath lookup) and gets its stream.
|
void |
stop()
Stop phase notification
|
<T> T |
workWithClassLoader(ClassLoaderService.Work<T> work) |
public ClassLoaderServiceImpl()
public ClassLoaderServiceImpl(ClassLoader classLoader)
classLoader - The ClassLoader to usepublic ClassLoaderServiceImpl(Collection<ClassLoader> providedClassLoaders)
providedClassLoaders - The ClassLoader instances to use@Deprecated public static ClassLoaderServiceImpl fromConfigSettings(Map configValues)
configValues - The config valuespublic <T> Class<T> classForName(String className)
ClassLoaderServiceclassForName in interface ClassLoaderServiceT - The returned class type.className - The name of the class to locatepublic URL locateResource(String name)
ClassLoaderServicelocateResource in interface ClassLoaderServicename - The resource name.null to indicate the resource was not foundpublic InputStream locateResourceStream(String name)
ClassLoaderServicelocateResourceStream in interface ClassLoaderServicename - The resource name.null to indicate the resource was not foundpublic List<URL> locateResources(String name)
ClassLoaderServicelocateResources in interface ClassLoaderServicename - The resource name.null to indicate the resource was not foundpublic <S> Collection<S> loadJavaServices(Class<S> serviceContract)
ClassLoaderServiceService. Instead here we are talking about
services as defined by ServiceLoader.loadJavaServices in interface ClassLoaderServiceS - The type of the service contractserviceContract - The java type defining the service contractpublic <T> T generateProxy(InvocationHandler handler, Class... interfaces)
generateProxy in interface ClassLoaderServicepublic <T> T workWithClassLoader(ClassLoaderService.Work<T> work)
workWithClassLoader in interface ClassLoaderServiceCopyright © 2001-2017 Red Hat, Inc. All Rights Reserved.