Class AotServices<T>
java.lang.Object
org.springframework.beans.factory.aot.AotServices<T>
- Type Parameters:
T
- the service type
- All Implemented Interfaces:
Iterable<T>
A collection of AOT services that can be
loaded
from
a SpringFactoriesLoader
or obtained from a ListableBeanFactory
.- Since:
- 6.0
- Author:
- Phillip Webb
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Loader class used to actually load the services.static enum
Sources from which services were obtained. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionasList()
Return the AOT services as aList
.static AotServices.Loader
Create a newAotServices.Loader
that will obtain AOT services from "META-INF/spring/aot.factories".static AotServices.Loader
factories
(@Nullable ClassLoader classLoader) Create a newAotServices.Loader
that will obtain AOT services from "META-INF/spring/aot.factories".static AotServices.Loader
factories
(SpringFactoriesLoader springFactoriesLoader) Create a newAotServices.Loader
that will obtain AOT services from the givenSpringFactoriesLoader
.static AotServices.Loader
factoriesAndBeans
(ListableBeanFactory beanFactory) Create a newAotServices.Loader
that will obtain AOT services from "META-INF/spring/aot.factories" as well as the givenListableBeanFactory
.static AotServices.Loader
factoriesAndBeans
(SpringFactoriesLoader springFactoriesLoader, ListableBeanFactory beanFactory) Create a newAotServices.Loader
that will obtain AOT services from the givenSpringFactoriesLoader
andListableBeanFactory
.findByBeanName
(String beanName) Find the AOT service that was loaded for the given bean name.Get the source of the given service.iterator()
stream()
Return aStream
of the AOT services.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
FACTORIES_RESOURCE_LOCATION
The location to look for AOT factories.- See Also:
-
-
Method Details
-
factories
Create a newAotServices.Loader
that will obtain AOT services from "META-INF/spring/aot.factories".- Returns:
- a new
AotServices.Loader
instance
-
factories
Create a newAotServices.Loader
that will obtain AOT services from "META-INF/spring/aot.factories".- Parameters:
classLoader
- the class loader used to load the factories resource- Returns:
- a new
AotServices.Loader
instance
-
factories
Create a newAotServices.Loader
that will obtain AOT services from the givenSpringFactoriesLoader
.- Parameters:
springFactoriesLoader
- the spring factories loader- Returns:
- a new
AotServices.Loader
instance
-
factoriesAndBeans
Create a newAotServices.Loader
that will obtain AOT services from "META-INF/spring/aot.factories" as well as the givenListableBeanFactory
.- Parameters:
beanFactory
- the bean factory- Returns:
- a new
AotServices.Loader
instance
-
factoriesAndBeans
public static AotServices.Loader factoriesAndBeans(SpringFactoriesLoader springFactoriesLoader, ListableBeanFactory beanFactory) Create a newAotServices.Loader
that will obtain AOT services from the givenSpringFactoriesLoader
andListableBeanFactory
.- Parameters:
springFactoriesLoader
- the spring factories loaderbeanFactory
- the bean factory- Returns:
- a new
AotServices.Loader
instance
-
iterator
-
stream
Return aStream
of the AOT services.- Returns:
- a stream of the services
-
asList
Return the AOT services as aList
.- Returns:
- a list of the services
-
findByBeanName
Find the AOT service that was loaded for the given bean name.- Parameters:
beanName
- the bean name- Returns:
- the AOT service or
null
-
getSource
Get the source of the given service.- Parameters:
service
- the service instance- Returns:
- the source of the service
-