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)
ClassLoaderService
classForName
in interface ClassLoaderService
T
- The returned class type.className
- The name of the class to locatepublic URL locateResource(String name)
ClassLoaderService
locateResource
in interface ClassLoaderService
name
- The resource name.null
to indicate the resource was not foundpublic InputStream locateResourceStream(String name)
ClassLoaderService
locateResourceStream
in interface ClassLoaderService
name
- The resource name.null
to indicate the resource was not foundpublic List<URL> locateResources(String name)
ClassLoaderService
locateResources
in interface ClassLoaderService
name
- The resource name.null
to indicate the resource was not foundpublic <S> Collection<S> loadJavaServices(Class<S> serviceContract)
ClassLoaderService
Service
. Instead here we are talking about
services as defined by ServiceLoader
.loadJavaServices
in interface ClassLoaderService
S
- The type of the service contractserviceContract
- The java type defining the service contractpublic <T> T generateProxy(InvocationHandler handler, Class... interfaces)
generateProxy
in interface ClassLoaderService
public <T> T workWithClassLoader(ClassLoaderService.Work<T> work)
workWithClassLoader
in interface ClassLoaderService
Copyright © 2017 JBoss by Red Hat. All rights reserved.