public class ClassLoaderServiceImpl extends Object implements ClassLoaderService
| Modifier and Type | Class and Description |
|---|---|
static interface |
ClassLoaderServiceImpl.Work<T>
Hack around continued (temporary) need to sometimes set the TCCL for code we call that expects it.
|
| 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!
|
<S> LinkedHashSet<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 |
withTccl(ClassLoaderServiceImpl.Work<T> work)
Perform some discrete work with with the TCCL set to our aggregated ClassLoader
|
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> LinkedHashSet<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 void stop()
Stoppablepublic <T> T withTccl(ClassLoaderServiceImpl.Work<T> work)
T - The type of the work resultwork - The discrete work to be doneCopyright © 2001-2015 Red Hat, Inc. All Rights Reserved.