public final class CandidateComponentsIndexLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMPONENTS_RESOURCE_LOCATION
The location to look for components.
|
static java.lang.String |
IGNORE_INDEX
System property that instructs Spring to ignore the index, i.e.
|
Modifier and Type | Method and Description |
---|---|
static CandidateComponentsIndex |
loadIndex(java.lang.ClassLoader classLoader)
Load and instantiate the
CandidateComponentsIndex from
"META-INF/spring.components", using the given class loader. |
public static final java.lang.String COMPONENTS_RESOURCE_LOCATION
Can be present in multiple JAR files.
public static final java.lang.String IGNORE_INDEX
null
from loadIndex(ClassLoader)
.
The default is "false", allowing for regular use of the index. Switching this
flag to true
fulfills a corner case scenario when an index is partially
available for some libraries (or use cases) but couldn't be built for the whole
application. In this case, the application context fallbacks to a regular
classpath arrangement (i.e. as no index was present at all).
@Nullable public static CandidateComponentsIndex loadIndex(@Nullable java.lang.ClassLoader classLoader)
CandidateComponentsIndex
from
"META-INF/spring.components", using the given class loader. If no
index is available, return null
.classLoader
- the ClassLoader to use for loading (can be null
to use the default)null
if no index was foundjava.lang.IllegalArgumentException
- if any module index cannot
be loaded or if an error occurs while creating CandidateComponentsIndex