public class DefaultBeanContext extends Object implements BeanContext
| Modifier and Type | Field and Description |
|---|---|
protected AtomicBoolean |
initializing |
protected static org.slf4j.Logger |
LOG |
protected static org.slf4j.Logger |
LOG_LIFECYCLE |
protected AtomicBoolean |
running |
protected AtomicBoolean |
terminating |
EMPTYDEFAULT| Constructor and Description |
|---|
DefaultBeanContext()
Construct a new bean context using the same classloader that loaded this DefaultBeanContext class.
|
DefaultBeanContext(BeanContextConfiguration contextConfiguration)
Creates a new bean context with the given configuration.
|
DefaultBeanContext(ClassLoader classLoader)
Construct a new bean context with the given class loader.
|
DefaultBeanContext(ClassPathResourceLoader resourceLoader)
Construct a new bean context with the given class loader.
|
| Modifier and Type | Method and Description |
|---|---|
<T> boolean |
containsBean(Class<T> beanType,
Qualifier<T> qualifier)
Return whether the bean of the given type is contained within this context.
|
protected <T> T |
createBean(BeanResolutionContext resolutionContext,
Class<T> beanType,
Qualifier<T> qualifier)
Creates a bean.
|
<T> T |
createBean(Class<T> beanType,
Qualifier<T> qualifier)
Creates a new instance of the given bean performing dependency injection and returning a new instance.
|
<T> T |
createBean(Class<T> beanType,
Qualifier<T> qualifier,
Map<String,Object> argumentValues)
Creates a new instance of the given bean performing dependency injection and returning a new instance.
|
<T> T |
createBean(Class<T> beanType,
Qualifier<T> qualifier,
Object... args)
Creates a new instance of the given bean performing dependency injection and returning a new instance.
|
<T> T |
destroyBean(Class<T> beanType)
Destroys the bean for the given type causing it to be re-created.
|
protected <T> T |
doCreateBean(BeanResolutionContext resolutionContext,
BeanDefinition<T> definition,
Class<T> beanType,
Qualifier<T> qualifier,
Object... args) |
protected <T> T |
doCreateBean(BeanResolutionContext resolutionContext,
BeanDefinition<T> beanDefinition,
Qualifier<T> qualifier,
boolean isSingleton,
Map<String,Object> argumentValues)
Execution the creation of a bean.
|
<T> Optional<T> |
findBean(BeanResolutionContext resolutionContext,
Class<T> beanType,
Qualifier<T> qualifier)
Find an optional bean of the given type and qualifier.
|
<T> Optional<T> |
findBean(Class<T> beanType,
Qualifier<T> qualifier)
Finds a Bean for the given type and qualifier.
|
protected <T> Collection<BeanDefinition<T>> |
findBeanCandidates(Class<T> beanType,
BeanDefinition<?> filter)
Find bean candidates for the given type.
|
protected <T> Collection<BeanDefinition<T>> |
findBeanCandidates(Class<T> beanType,
BeanDefinition<?> filter,
boolean filterProxied)
Find bean candidates for the given type.
|
protected <T> Collection<BeanDefinition> |
findBeanCandidatesForInstance(T instance)
Find bean candidates for the given type.
|
Optional<BeanConfiguration> |
findBeanConfiguration(String configurationName)
Obtain a bean configuration by name.
|
<T> Optional<BeanDefinition<T>> |
findBeanDefinition(Class<T> beanType,
Qualifier<T> qualifier)
Obtain a
BeanDefinition for the given type. |
<T> Optional<BeanRegistration<T>> |
findBeanRegistration(T bean)
Obtain a
BeanDefinition for the given bean. |
protected <T> BeanDefinition<T> |
findConcreteCandidate(Class<T> beanType,
Qualifier<T> qualifier,
Collection<BeanDefinition<T>> candidates)
Fall back method to attempt to find a candidate for the given definitions.
|
<T,R> Optional<ExecutableMethod<T,R>> |
findExecutableMethod(Class<T> beanType,
String method,
Class[] arguments)
Finds an optimized execution handle for invoking a bean method.
|
<T,R> Optional<MethodExecutionHandle<T,R>> |
findExecutionHandle(Class<T> beanType,
Qualifier<?> qualifier,
String method,
Class... arguments)
Finds an optimized execution handle for invoking a bean method.
|
<T,R> Optional<MethodExecutionHandle<T,R>> |
findExecutionHandle(Class<T> beanType,
String method,
Class... arguments)
Finds an optimized execution handle for invoking a bean method.
|
<T,R> Optional<MethodExecutionHandle<T,R>> |
findExecutionHandle(T bean,
String method,
Class[] arguments)
Finds an optimized execution handle for invoking a bean method.
|
<T> Optional<BeanDefinition<T>> |
findProxyBeanDefinition(Class<T> beanType,
Qualifier<T> qualifier)
Obtain the original
BeanDefinition for a ProxyBeanDefinition. |
<T> Optional<BeanDefinition<T>> |
findProxyTargetBeanDefinition(Class<T> beanType,
Qualifier<T> qualifier)
Obtain the original
BeanDefinition for a ProxyBeanDefinition. |
<T,R> Optional<ExecutableMethod<T,R>> |
findProxyTargetMethod(Class<T> beanType,
Qualifier<T> qualifier,
String method,
Class... arguments)
Finds the original unproxied method for a
ProxyBeanDefinition. |
<T,R> Optional<ExecutableMethod<T,R>> |
findProxyTargetMethod(Class<T> beanType,
String method,
Class[] arguments)
Finds the original unproxied method for a
ProxyBeanDefinition. |
protected <T> BeanRegistration<T> |
getActiveBeanRegistration(BeanDefinition<T> beanDefinition,
Qualifier qualifier)
Find an active
Singleton bean for the given definition and qualifier. |
<T> Collection<BeanRegistration<T>> |
getActiveBeanRegistrations(Class<T> beanType)
Find active
Singleton beans for the given bean type. |
Collection<BeanRegistration<?>> |
getActiveBeanRegistrations(Qualifier<?> qualifier)
Find active
Singleton beans for the given qualifier. |
Collection<BeanDefinition<?>> |
getAllBeanDefinitions()
Get all of the registered
BeanDefinition. |
<T> T |
getBean(BeanResolutionContext resolutionContext,
Class<T> beanType)
Get a bean of the given type.
|
<T> T |
getBean(BeanResolutionContext resolutionContext,
Class<T> beanType,
Qualifier<T> qualifier)
Get a bean of the given type and qualifier.
|
<T> T |
getBean(Class<T> beanType)
Obtains a Bean for the given type.
|
<T> T |
getBean(Class<T> beanType,
Qualifier<T> qualifier)
Obtains a Bean for the given type and qualifier.
|
Collection<BeanDefinitionReference<?>> |
getBeanDefinitionReferences()
Get all of the enabled
BeanDefinitionReference. |
<T> Collection<BeanDefinition<T>> |
getBeanDefinitions(Class<T> beanType)
Obtain a
BeanDefinition for the given type. |
<T> Collection<BeanDefinition<T>> |
getBeanDefinitions(Class<T> beanType,
Qualifier<T> qualifier)
Obtain a
BeanDefinition for the given type. |
Collection<BeanDefinition<?>> |
getBeanDefinitions(Qualifier<Object> qualifier)
Get all of the
BeanDefinition for the given qualifier. |
protected <T> Provider<T> |
getBeanProvider(BeanResolutionContext resolutionContext,
Class<T> beanType)
Get provided beans of the given type.
|
protected <T> Provider<T> |
getBeanProvider(BeanResolutionContext resolutionContext,
Class<T> beanType,
Qualifier<T> qualifier)
Get a bean provider.
|
<T> Collection<BeanRegistration<T>> |
getBeanRegistrations(Class<T> beanType)
Find and if necessary initialize
Singleton beans for the given bean type, returning all the active registrations. |
protected <T> Collection<T> |
getBeansOfType(BeanResolutionContext resolutionContext,
Class<T> beanType)
Get all beans of the given type.
|
protected <T> Collection<T> |
getBeansOfType(BeanResolutionContext resolutionContext,
Class<T> beanType,
Qualifier<T> qualifier)
Get all beans of the given type and qualifier.
|
<T> Collection<T> |
getBeansOfType(Class<T> beanType)
Get all beans of the given type.
|
<T> Collection<T> |
getBeansOfType(Class<T> beanType,
Qualifier<T> qualifier)
Get all beans of the given type.
|
ClassLoader |
getClassLoader() |
<T> T |
getProxyTargetBean(Class<T> beanType,
Qualifier<T> qualifier)
Resolves the proxy target for a given bean type.
|
protected void |
initializeContext(List<BeanDefinitionReference> contextScopeBeans,
List<BeanDefinitionReference> processedBeans)
Initialize the context with the given
Context scope beans. |
protected void |
initializeEventListeners()
Initialize the event listeners.
|
protected <T> T |
inject(BeanResolutionContext resolutionContext,
BeanDefinition requestingBeanDefinition,
T instance)
Injects a bean.
|
<T> T |
inject(T instance)
Inject an existing instance.
|
protected void |
invalidateCaches()
Invalidates the bean caches.
|
boolean |
isRunning() |
protected void |
processParallelBeans()
Processes parallel bean definitions.
|
void |
publishEvent(Object event)
Publish the given event.
|
<T> Optional<T> |
refreshBean(BeanIdentifier identifier)
Refresh the state of the given registered bean applying dependency injection and configuration wiring again.
|
protected void |
registerConfiguration(BeanConfiguration configuration)
Registers an active configuration.
|
<T> BeanContext |
registerSingleton(Class<T> type,
T singleton,
Qualifier<T> qualifier,
boolean inject)
Registers a new singleton bean at runtime.
|
protected Iterable<BeanConfiguration> |
resolveBeanConfigurations()
Resolves the
BeanConfiguration class instances. |
protected List<BeanDefinitionReference> |
resolveBeanDefinitionReferences()
Resolves the
BeanDefinitionReference class instances. |
AnnotationMetadata |
resolveMetadata(Class<?> type)
Resolve the
AnnotationMetadata for the given type. |
BeanContext |
start()
The start method will read all bean definition classes found on the classpath and initialize any pre-required
state.
|
BeanContext |
stop()
The close method will shut down the context calling
PreDestroy hooks on loaded
singletons. |
protected <T> Stream<T> |
streamOfType(BeanResolutionContext resolutionContext,
Class<T> beanType,
Qualifier<T> qualifier)
Obtains a stream of beans of the given type and qualifier.
|
<T> Stream<T> |
streamOfType(Class<T> beanType,
Qualifier<T> qualifier)
Obtain a stream of beans of the given type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuild, build, createBean, createBean, createBean, registerSingleton, registerSingleton, registerSingleton, registerSingleton, run, rungetExecutableMethod, getExecutionHandle, getExecutionHandle, getProxyTargetMethod, getProxyTargetMethodfindBean, findOrInstantiateBean, streamOfTypecontainsBean, findBeanDefinition, getBeanDefinition, getBeanDefinition, getProxyTargetBeanDefinitionresolveMetadataprotected static final org.slf4j.Logger LOG
protected static final org.slf4j.Logger LOG_LIFECYCLE
protected final AtomicBoolean running
protected final AtomicBoolean initializing
protected final AtomicBoolean terminating
public DefaultBeanContext()
public DefaultBeanContext(@Nonnull ClassLoader classLoader)
classLoader - The class loaderpublic DefaultBeanContext(@Nonnull ClassPathResourceLoader resourceLoader)
resourceLoader - The resource loaderpublic DefaultBeanContext(@Nonnull BeanContextConfiguration contextConfiguration)
contextConfiguration - The context configurationpublic boolean isRunning()
isRunning in interface LifeCycle<BeanContext>public BeanContext start()
start in interface LifeCycle<BeanContext>public BeanContext stop()
PreDestroy hooks on loaded
singletons.stop in interface LifeCycle<BeanContext>@Nonnull public AnnotationMetadata resolveMetadata(Class<?> type)
AnnotationMetadataResolverAnnotationMetadata for the given type.resolveMetadata in interface AnnotationMetadataResolvertype - The typeAnnotationMetadatapublic <T> Optional<T> refreshBean(BeanIdentifier identifier)
BeanContextRefresh the state of the given registered bean applying dependency injection and configuration wiring again.
Note that if the bean was produced by a Factory then this method will
refresh the factory too
refreshBean in interface BeanContextT - The concrete classidentifier - The BeanIdentifierOptional of the instance if it exists for the given registrationpublic Collection<BeanRegistration<?>> getActiveBeanRegistrations(Qualifier<?> qualifier)
BeanDefinitionRegistrySingleton beans for the given qualifier. Note that
this method can return multiple registrations for a given singleton bean instance since each bean may have multiple qualifiers.getActiveBeanRegistrations in interface BeanDefinitionRegistryqualifier - The qualifierpublic <T> Collection<BeanRegistration<T>> getActiveBeanRegistrations(Class<T> beanType)
BeanDefinitionRegistrySingleton beans for the given bean type. Note that
this method can return multiple registrations for a given singleton bean instance since each bean may have multiple qualifiers.getActiveBeanRegistrations in interface BeanDefinitionRegistryT - The concrete typebeanType - The bean typepublic <T> Collection<BeanRegistration<T>> getBeanRegistrations(Class<T> beanType)
BeanDefinitionRegistrySingleton beans for the given bean type, returning all the active registrations. Note that
this method can return multiple registrations for a given singleton bean instance since each bean may have multiple qualifiers.getBeanRegistrations in interface BeanDefinitionRegistryT - The concrete typebeanType - The bean typepublic <T> Optional<BeanRegistration<T>> findBeanRegistration(T bean)
BeanDefinitionRegistryBeanDefinition for the given bean.findBeanRegistration in interface BeanDefinitionRegistryT - The concrete typebean - The beanOptional of the bean definitionpublic <T,R> Optional<MethodExecutionHandle<T,R>> findExecutionHandle(Class<T> beanType, String method, Class... arguments)
ExecutionHandleLocatorfindExecutionHandle in interface ExecutionHandleLocatorT - The target beanR - The result type of the execution handlebeanType - The bean typemethod - The methodarguments - The argumentspublic <T,R> Optional<MethodExecutionHandle<T,R>> findExecutionHandle(Class<T> beanType, Qualifier<?> qualifier, String method, Class... arguments)
ExecutionHandleLocatorfindExecutionHandle in interface ExecutionHandleLocatorT - The target beanR - The result type of the execution handlebeanType - The bean typequalifier - The bean qualifermethod - The methodarguments - The argumentspublic <T,R> Optional<ExecutableMethod<T,R>> findExecutableMethod(Class<T> beanType, String method, Class[] arguments)
ExecutionHandleLocatorfindExecutableMethod in interface ExecutionHandleLocatorT - The bean type classR - The result type of the execution handlebeanType - The bean typemethod - The methodarguments - The argumentspublic <T,R> Optional<MethodExecutionHandle<T,R>> findExecutionHandle(T bean, String method, Class[] arguments)
ExecutionHandleLocatorfindExecutionHandle in interface ExecutionHandleLocatorT - The target beanR - The result type of the execution handlebean - The bean to invoke the method onmethod - The methodarguments - The argumentspublic <T> BeanContext registerSingleton(@Nonnull Class<T> type, @Nonnull T singleton, Qualifier<T> qualifier, boolean inject)
BeanDefinitionRegistryRegisters a new singleton bean at runtime. This method expects that the bean definition data will have been compiled ahead of time.
If bean definition data is found the method will perform dependency injection on the instance followed by
invoking any PostConstruct hooks.
If no bean definition data is found the bean is registered as is.
registerSingleton in interface BeanContextregisterSingleton in interface BeanDefinitionRegistryT - The concrete typetype - The bean typesingleton - The singleton beanqualifier - The bean qualifierinject - Whether the singleton should be injected (defaults to true)public ClassLoader getClassLoader()
getClassLoader in interface BeanContextpublic Optional<BeanConfiguration> findBeanConfiguration(String configurationName)
BeanDefinitionRegistryfindBeanConfiguration in interface BeanDefinitionRegistryconfigurationName - The configuration namepublic <T> Optional<BeanDefinition<T>> findBeanDefinition(Class<T> beanType, Qualifier<T> qualifier)
BeanDefinitionRegistryBeanDefinition for the given type.findBeanDefinition in interface BeanDefinitionRegistryT - The concrete typebeanType - The typequalifier - The qualifierOptional of the bean definitionpublic <T> Collection<BeanDefinition<T>> getBeanDefinitions(Class<T> beanType)
BeanDefinitionRegistryBeanDefinition for the given type.getBeanDefinitions in interface BeanDefinitionRegistryT - The concrete typebeanType - The typeOptional of the bean definitionpublic <T> Collection<BeanDefinition<T>> getBeanDefinitions(Class<T> beanType, Qualifier<T> qualifier)
BeanDefinitionRegistryBeanDefinition for the given type.getBeanDefinitions in interface BeanDefinitionRegistryT - The concrete typebeanType - The typequalifier - The qualifierOptional of the bean definitionpublic <T> boolean containsBean(@Nonnull Class<T> beanType, Qualifier<T> qualifier)
BeanDefinitionRegistrycontainsBean in interface BeanDefinitionRegistryT - The concrete typebeanType - The bean typequalifier - The qualifier for the beanpublic <T> T getBean(Class<T> beanType, Qualifier<T> qualifier)
BeanLocatorgetBean in interface BeanLocatorT - The bean type parameterbeanType - The bean typequalifier - The qualifierQualifierspublic <T> T getBean(Class<T> beanType)
BeanLocatorgetBean in interface BeanLocatorT - The bean type parameterbeanType - The bean typepublic <T> Optional<T> findBean(Class<T> beanType, Qualifier<T> qualifier)
BeanLocatorfindBean in interface BeanLocatorT - The bean type parameterbeanType - The bean typequalifier - The qualifierOptional that is either empty or containing the specified beanQualifierspublic <T> Collection<T> getBeansOfType(Class<T> beanType)
BeanLocatorgetBeansOfType in interface BeanLocatorT - The bean type parameterbeanType - The bean typepublic <T> Collection<T> getBeansOfType(Class<T> beanType, Qualifier<T> qualifier)
BeanLocatorgetBeansOfType in interface BeanLocatorT - The bean type parameterbeanType - The bean typequalifier - The qualifierpublic <T> Stream<T> streamOfType(Class<T> beanType, Qualifier<T> qualifier)
BeanLocatorstreamOfType in interface BeanLocatorT - The bean concrete typebeanType - The bean typequalifier - The qualifierQualifiersprotected <T> Stream<T> streamOfType(BeanResolutionContext resolutionContext, Class<T> beanType, Qualifier<T> qualifier)
T - The bean concrete typeresolutionContext - The bean resolution contextbeanType - The bean typequalifier - The qualifier@Nonnull public <T> T inject(@Nonnull T instance)
BeanContextinject in interface BeanContextT - The bean generic typeinstance - The instance to inject@Nonnull public <T> T createBean(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
BeanContextNote that the instance returned is not saved as a singleton in the context.
createBean in interface BeanContextT - The bean generic typebeanType - The bean typequalifier - The qualifier@Nonnull public <T> T createBean(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier, @Nullable Map<String,Object> argumentValues)
BeanContextCreates a new instance of the given bean performing dependency injection and returning a new instance.
If the bean defines any Parameter values then the values passed
in the argumentValues parameter will be used
Note that the instance returned is not saved as a singleton in the context.
createBean in interface BeanContextT - The bean generic typebeanType - The bean typequalifier - The qualifierargumentValues - The argument values@Nonnull public <T> T createBean(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier, @Nullable Object... args)
BeanContextCreates a new instance of the given bean performing dependency injection and returning a new instance.
If the bean defines any Parameter values then the values passed in
the argumentValues parameter will be used
Note that the instance returned is not saved as a singleton in the context.
createBean in interface BeanContextT - The bean generic typebeanType - The bean typequalifier - The qualifierargs - The argument values@Nonnull protected <T> T doCreateBean(@Nonnull BeanResolutionContext resolutionContext, @Nonnull BeanDefinition<T> definition, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier, @Nullable Object... args)
T - the bean generic typeresolutionContext - The bean resolution contextdefinition - The bean definitionbeanType - The bean typequalifier - The qualifierargs - The argument values@Nullable public <T> T destroyBean(@Nonnull Class<T> beanType)
BeanContextdestroyBean in interface BeanContextT - The concrete classbeanType - The bean type@Nullable protected <T> BeanRegistration<T> getActiveBeanRegistration(BeanDefinition<T> beanDefinition, Qualifier qualifier)
Singleton bean for the given definition and qualifier.T - The bean generic typebeanDefinition - The bean definitionqualifier - The qualifier@Nonnull protected <T> T createBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
T - The bean generic typeresolutionContext - The bean resolution contextbeanType - The bean typequalifier - The qualifier@Nonnull protected <T> T inject(@Nonnull BeanResolutionContext resolutionContext, @Nullable BeanDefinition requestingBeanDefinition, @Nonnull T instance)
T - The instance typeresolutionContext - The bean resolution contextrequestingBeanDefinition - The requesting bean definitioninstance - The instance@Nonnull protected <T> Collection<T> getBeansOfType(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType)
T - The bean type parameterresolutionContext - The bean resolution contextbeanType - The bean type@Nonnull protected <T> Collection<T> getBeansOfType(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
T - The bean type parameterresolutionContext - The bean resolution contextbeanType - The bean typequalifier - The qualifier@Nonnull protected <T> Provider<T> getBeanProvider(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType)
T - The bean type parameterresolutionContext - The bean resolution contextbeanType - The bean type@Nonnull public <T> T getProxyTargetBean(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
BeanLocatorgetProxyTargetBean in interface BeanLocatorT - The generic typebeanType - The bean typequalifier - The bean qualifier@Nonnull public <T,R> Optional<ExecutableMethod<T,R>> findProxyTargetMethod(@Nonnull Class<T> beanType, @Nonnull String method, @Nonnull Class[] arguments)
ExecutionHandleLocatorProxyBeanDefinition.findProxyTargetMethod in interface ExecutionHandleLocatorT - The bean type classR - The result type of the execution handlebeanType - The bean typemethod - The methodarguments - The argumentspublic <T,R> Optional<ExecutableMethod<T,R>> findProxyTargetMethod(Class<T> beanType, Qualifier<T> qualifier, String method, Class... arguments)
ExecutionHandleLocatorProxyBeanDefinition.findProxyTargetMethod in interface ExecutionHandleLocatorT - The bean type classR - The result type of the execution handlebeanType - The bean typequalifier - The qualifiermethod - The methodarguments - The arguments@Nonnull public <T> Optional<BeanDefinition<T>> findProxyTargetBeanDefinition(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
BeanDefinitionRegistryBeanDefinition for a ProxyBeanDefinition.findProxyTargetBeanDefinition in interface BeanDefinitionRegistryT - The concrete typebeanType - The typequalifier - The qualifierOptional of the bean definition@Nonnull public Collection<BeanDefinition<?>> getBeanDefinitions(@Nullable Qualifier<Object> qualifier)
BeanDefinitionRegistryBeanDefinition for the given qualifier.getBeanDefinitions in interface BeanDefinitionRegistryqualifier - The qualifer@Nonnull public Collection<BeanDefinition<?>> getAllBeanDefinitions()
BeanDefinitionRegistryBeanDefinition.getAllBeanDefinitions in interface BeanDefinitionRegistry@Nonnull public Collection<BeanDefinitionReference<?>> getBeanDefinitionReferences()
BeanDefinitionRegistryBeanDefinitionReference.getBeanDefinitionReferences in interface BeanDefinitionRegistry@Nonnull public <T> T getBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType)
T - The bean type parameterresolutionContext - The bean context resolutionbeanType - The bean type@Nonnull public <T> T getBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
T - The bean type parameterresolutionContext - The bean context resolutionbeanType - The bean typequalifier - The qualifier@Nonnull public <T> Optional<T> findBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
T - The bean type parameterresolutionContext - The bean context resolutionbeanType - The bean typequalifier - The qualifierOptionalpublic void publishEvent(@Nonnull Object event)
ApplicationEventPublisherpublishEvent in interface ApplicationEventPublisherevent - The event to publish@Nonnull public <T> Optional<BeanDefinition<T>> findProxyBeanDefinition(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
BeanDefinitionRegistryBeanDefinition for a ProxyBeanDefinition.findProxyBeanDefinition in interface BeanDefinitionRegistryT - The concrete typebeanType - The typequalifier - The qualifierOptional of the bean definitionprotected void invalidateCaches()
@Nonnull protected <T> Provider<T> getBeanProvider(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
T - The bean type parameterresolutionContext - The bean resolution contextbeanType - The bean typequalifier - The qualifier@Nonnull protected List<BeanDefinitionReference> resolveBeanDefinitionReferences()
BeanDefinitionReference class instances. Default implementation uses ServiceLoader pattern.@Nonnull protected Iterable<BeanConfiguration> resolveBeanConfigurations()
BeanConfiguration class instances. Default implementation uses ServiceLoader pattern.protected void initializeEventListeners()
protected void initializeContext(@Nonnull List<BeanDefinitionReference> contextScopeBeans, @Nonnull List<BeanDefinitionReference> processedBeans)
Context scope beans.contextScopeBeans - The context scope beansprocessedBeans - The beans that require ExecutableMethodProcessor handling@Nonnull protected <T> Collection<BeanDefinition<T>> findBeanCandidates(@Nonnull Class<T> beanType, @Nullable BeanDefinition<?> filter)
T - The bean generic typebeanType - The bean typefilter - A bean definition to filter out@Nonnull protected <T> Collection<BeanDefinition<T>> findBeanCandidates(@Nonnull Class<T> beanType, @Nullable BeanDefinition<?> filter, boolean filterProxied)
T - The bean generic typebeanType - The bean typefilter - A bean definition to filter outfilterProxied - Whether to filter out bean proxy targets@Nonnull protected <T> Collection<BeanDefinition> findBeanCandidatesForInstance(@Nonnull T instance)
T - The bean generic typeinstance - The bean instanceprotected void registerConfiguration(@Nonnull BeanConfiguration configuration)
configuration - The configuration to register@Nullable protected <T> T doCreateBean(@Nonnull BeanResolutionContext resolutionContext, @Nonnull BeanDefinition<T> beanDefinition, @Nullable Qualifier<T> qualifier, boolean isSingleton, @Nullable Map<String,Object> argumentValues)
T - The bean generic typeresolutionContext - The BeanResolutionContextbeanDefinition - The BeanDefinitionqualifier - The QualifierisSingleton - Whether the bean is a singletonargumentValues - Any argument values passed to create the bean@Nonnull protected <T> BeanDefinition<T> findConcreteCandidate(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier, @Nonnull Collection<BeanDefinition<T>> candidates)
T - The generic timebeanType - The bean typequalifier - The qualifiercandidates - The candidatesprotected void processParallelBeans()