Top Description Fields Constructors Methods
org.springframework.context.index

public final Class CandidateComponentsIndexLoader

extends Object
Class Inheritance
Annotations
@Deprecated
since:6.1
forRemoval:true
@SuppressWarnings:removal
Imports
java.io.IOException, java.net.URL, java.util.ArrayList, .Enumeration, .List, .Properties, java.util.concurrent.ConcurrentMap, org.apache.commons.logging.Log, .LogFactory, org.springframework.core.SpringProperties, org.springframework.core.io.UrlResource, org.springframework.core.io.support.PropertiesLoaderUtils, org.springframework.lang.Nullable, org.springframework.util.ConcurrentReferenceHashMap

Deprecated

for removal since 6.1.

as of 6.1, in favor of the AOT engine.

Candidate components index loading mechanism for internal use within the framework.
Author
Stephane Nicoll
Since
5.0

Field Summary

Modifier and TypeField and Description
private static final ConcurrentMap<ClassLoader, CandidateComponentsIndex>
public static final String
COMPONENTS_RESOURCE_LOCATION

The location to look for components.

public static final String
IGNORE_INDEX

System property that instructs Spring to ignore the components index, i.e. to always return null from loadIndex(ClassLoader).

private static final Log
private static final boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static CandidateComponentsIndex
doLoadIndex(ClassLoader classLoader)
References Deprecated CandidateComponentsIndex is deprecated or references (maybe indirectly) at least one deprecated element.

public static CandidateComponentsIndex

Returns:

the index to use or null if no index was found
loadIndex
(ClassLoader
the ClassLoader to use for loading (can be null to use the default)
classLoader
)
References Deprecated CandidateComponentsIndex is deprecated or references (maybe indirectly) at least one deprecated element.

Load and instantiate the CandidateComponentsIndex from META-INF/spring.components, using the given class loader.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
private static final ConcurrentMap<ClassLoader, CandidateComponentsIndex> cache
COMPONENTS_RESOURCE_LOCATIONback to summary
public static final String COMPONENTS_RESOURCE_LOCATION

The location to look for components.

Can be present in multiple JAR files.

IGNORE_INDEXback to summary
public static final String IGNORE_INDEX

System property that instructs Spring to ignore the components index, i.e. to always return 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 though no index were present at all).

loggerback to summary
private static final Log logger
shouldIgnoreIndexback to summary
private static final boolean shouldIgnoreIndex

Constructor Detail

CandidateComponentsIndexLoaderback to summary
private CandidateComponentsIndexLoader()

Method Detail

doLoadIndexback to summary
private static CandidateComponentsIndex doLoadIndex(ClassLoader classLoader)

References Deprecated

CandidateComponentsIndex is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@Nullable
loadIndexback to summary
public static CandidateComponentsIndex loadIndex(ClassLoader classLoader)

References Deprecated

CandidateComponentsIndex is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Load and instantiate the CandidateComponentsIndex from META-INF/spring.components, using the given class loader. If no index is available, return null.

Parameters
classLoader:ClassLoader

the ClassLoader to use for loading (can be null to use the default)

Returns:CandidateComponentsIndex

the index to use or null if no index was found

Annotations
@Nullable
Exceptions
IllegalArgumentException:
if any module index cannot be loaded or if an error occurs while creating CandidateComponentsIndex