public interface ClassLoaderService extends Service, Stoppable
Modifier and Type | Interface and Description |
---|---|
static interface |
ClassLoaderService.Work<T> |
Modifier and Type | Method and Description |
---|---|
<T> java.lang.Class<T> |
classForName(java.lang.String className)
Locate a class by name.
|
<T> T |
generateProxy(java.lang.reflect.InvocationHandler handler,
java.lang.Class... interfaces) |
<S> java.util.Collection<S> |
loadJavaServices(java.lang.Class<S> serviceContract)
Discovers and instantiates implementations of the named service contract.
|
java.net.URL |
locateResource(java.lang.String name)
Locate a resource by name (classpath lookup).
|
java.util.List<java.net.URL> |
locateResources(java.lang.String name)
Locate a series of resource by name (classpath lookup).
|
java.io.InputStream |
locateResourceStream(java.lang.String name)
Locate a resource by name (classpath lookup) and gets its stream.
|
<T> T |
workWithClassLoader(ClassLoaderService.Work<T> work) |
<T> java.lang.Class<T> classForName(java.lang.String className)
T
- The returned class type.className
- The name of the class to locateClassLoadingException
- Indicates the class could not be foundjava.net.URL locateResource(java.lang.String name)
name
- The resource name.null
to indicate the resource was not foundjava.io.InputStream locateResourceStream(java.lang.String name)
name
- The resource name.null
to indicate the resource was not foundjava.util.List<java.net.URL> locateResources(java.lang.String name)
name
- The resource name.null
to indicate the resource was not found<S> java.util.Collection<S> loadJavaServices(java.lang.Class<S> serviceContract)
Service
. Instead here we are talking about
services as defined by ServiceLoader
.S
- The type of the service contractserviceContract
- The java type defining the service contract<T> T generateProxy(java.lang.reflect.InvocationHandler handler, java.lang.Class... interfaces)
<T> T workWithClassLoader(ClassLoaderService.Work<T> work)
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.