Class SpringBeanStore
java.lang.Object
org.apache.juneau.cp.BeanStore
org.apache.juneau.rest.springboot.SpringBeanStore
A bean store that uses Spring bean resolution to find beans if they're not already in this store.
See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.juneau.cp.BeanStore
BeanStore.Builder, BeanStore.Void -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSpringBeanStore(Optional<org.springframework.context.ApplicationContext> appContext, Optional<BeanStore> parent, Object resource) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclear()Clears out all bean in this bean store.<T> Optional<T>Returns the unnamed bean of the specified type.<T> Optional<T>Returns the named bean of the specified type.removeBean(Class<?> beanType) Removes an unnamed bean from this store.removeBean(Class<?> beanType, String name) Removes a named bean from this store.<T> Stream<BeanStoreEntry<T>>Returns all the beans in this store of the specified type.Methods inherited from class org.apache.juneau.cp.BeanStore
add, add, addBean, addBean, addSupplier, addSupplier, create, createBean, createEntry, createMethodFinder, createMethodFinder, createMethodFinder, getMissingParams, getParams, hasAllParams, hasBean, hasBean, of, of, properties, toString
-
Constructor Details
-
SpringBeanStore
public SpringBeanStore(Optional<org.springframework.context.ApplicationContext> appContext, Optional<BeanStore> parent, Object resource) Constructor.- Parameters:
appContext- The Spring application context used to resolve beans.parent- The parent REST object bean store. Can benull .resource- The REST object. Can benull .
-
-
Method Details
-
clear
Description copied from class:BeanStoreClears out all bean in this bean store.Does not affect the parent bean store.
-
getBean
Description copied from class:BeanStoreReturns the unnamed bean of the specified type. -
getBean
Description copied from class:BeanStoreReturns the named bean of the specified type. -
removeBean
Description copied from class:BeanStoreRemoves an unnamed bean from this store.- Overrides:
removeBeanin classBeanStore- Parameters:
beanType- The bean type being removed.- Returns:
- This object.
-
removeBean
Description copied from class:BeanStoreRemoves a named bean from this store.- Overrides:
removeBeanin classBeanStore- Parameters:
beanType- The bean type being removed.name- The bean name to remove.- Returns:
- This object.
-
stream
Description copied from class:BeanStoreReturns all the beans in this store of the specified type.Returns both named and unnamed beans.
The results from the parent bean store are appended to the list of beans from this beans store.
-