spring-framework / org.springframework.context.index / CandidateComponentsIndexLoader

CandidateComponentsIndexLoader

open class CandidateComponentsIndexLoader

Candidate components index loading mechanism for internal use within the framework.

Author
Stephane Nicoll

Since
5.0

Constructors

<init>

CandidateComponentsIndexLoader()

Candidate components index loading mechanism for internal use within the framework.

Properties

COMPONENTS_RESOURCE_LOCATION

static val COMPONENTS_RESOURCE_LOCATION: String

The location to look for components.

Can be present in multiple JAR files.

IGNORE_INDEX

static val IGNORE_INDEX: String

System property that instructs Spring to ignore the 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 no index was present at all).

Functions

loadIndex

open static fun loadIndex(classLoader: ClassLoader): CandidateComponentsIndex

Load and instantiate the CandidateComponentsIndex from {@value #COMPONENTS_RESOURCE_LOCATION}, using the given class loader. If no index is available, return null.