public class ClasspathDescriptorFileFinder extends java.lang.Object implements DescriptorFileFinder
DescriptorFileFinder that
uses a particular classloader in order to find descriptor files.RESOURCE_BASE| Constructor and Description |
|---|
ClasspathDescriptorFileFinder()
If this constructor is used then HK2 descriptor files will be found
by looking in the classpath of the process.
|
ClasspathDescriptorFileFinder(java.lang.ClassLoader cl)
This constructor can be used to select the particular classloader
to search for HK2 descriptor files.
|
ClasspathDescriptorFileFinder(java.lang.ClassLoader cl,
java.lang.String name)
This constructor can be used to select the particular classloader
to search for HK2 descriptor files.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.io.InputStream> |
findDescriptorFiles()
Simple implementation of the findDescriptorFiles which does a
simple getResources on the classloader in order to find the
hk2 descriptor files
|
java.lang.String |
toString() |
public ClasspathDescriptorFileFinder()
This is most commonly used when using HK2 from a stand-alone client in which all the JAR files are on a single classpath
public ClasspathDescriptorFileFinder(java.lang.ClassLoader cl)
This is commonly used in more complex classloading scenarios where the HK2 descriptor files are not necessarily on the system classpath.
cl - May not be null and must be the classloader to use when
searching for HK2 descriptor filespublic ClasspathDescriptorFileFinder(java.lang.ClassLoader cl,
java.lang.String name)
cl - May not be null and must be the classloader to use when
searching for HK2 descriptor filesname - Maynot be null and must be the name of the files to
search for in the META-INF/hk2-locator directorypublic java.util.List<java.io.InputStream> findDescriptorFiles()
throws java.io.IOException
findDescriptorFiles in interface DescriptorFileFinderjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2013 Oracle Corporation. All Rights Reserved.