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 |
DEFAULT
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> |
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,
String method,
Class[] arguments)
Finds the original unproxied method for a
ProxyBeanDefinition . |
<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, wait
build, build, createBean, createBean, createBean, registerSingleton, registerSingleton, registerSingleton, registerSingleton, run, run
getExecutableMethod, getExecutionHandle, getExecutionHandle, getProxyTargetMethod
findBean, findOrInstantiateBean, streamOfType
containsBean, findBeanDefinition, getBeanDefinition, getBeanDefinition, getProxyTargetBeanDefinition
resolveMetadata
protected 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)
AnnotationMetadataResolver
AnnotationMetadata
for the given type.resolveMetadata
in interface AnnotationMetadataResolver
type
- The typeAnnotationMetadata
public <T> Optional<T> refreshBean(BeanIdentifier identifier)
BeanContext
Refresh 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 BeanContext
T
- The concrete classidentifier
- The BeanIdentifier
Optional
of the instance if it exists for the given registrationpublic Collection<BeanRegistration<?>> getActiveBeanRegistrations(Qualifier<?> qualifier)
BeanDefinitionRegistry
Singleton
beans for the given qualifier.getActiveBeanRegistrations
in interface BeanDefinitionRegistry
qualifier
- The qualifierpublic <T> Collection<BeanRegistration<T>> getActiveBeanRegistrations(Class<T> beanType)
BeanDefinitionRegistry
Singleton
beans for the given bean type.getActiveBeanRegistrations
in interface BeanDefinitionRegistry
T
- The concrete typebeanType
- The bean typepublic <T> Collection<BeanRegistration<T>> getBeanRegistrations(Class<T> beanType)
BeanDefinitionRegistry
Singleton
beans for the given bean type, returning all the active registrations.getBeanRegistrations
in interface BeanDefinitionRegistry
T
- The concrete typebeanType
- The bean typepublic <T> Optional<BeanRegistration<T>> findBeanRegistration(T bean)
BeanDefinitionRegistry
BeanDefinition
for the given bean.findBeanRegistration
in interface BeanDefinitionRegistry
T
- The concrete typebean
- The beanOptional
of the bean definitionpublic <T,R> Optional<MethodExecutionHandle<T,R>> findExecutionHandle(Class<T> beanType, String method, Class... arguments)
ExecutionHandleLocator
findExecutionHandle
in interface ExecutionHandleLocator
T
- 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)
ExecutionHandleLocator
findExecutionHandle
in interface ExecutionHandleLocator
T
- 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)
ExecutionHandleLocator
findExecutableMethod
in interface ExecutionHandleLocator
T
- 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)
ExecutionHandleLocator
findExecutionHandle
in interface ExecutionHandleLocator
T
- 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)
BeanDefinitionRegistry
Registers 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 BeanContext
registerSingleton
in interface BeanDefinitionRegistry
T
- 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 BeanContext
public Optional<BeanConfiguration> findBeanConfiguration(String configurationName)
BeanDefinitionRegistry
findBeanConfiguration
in interface BeanDefinitionRegistry
configurationName
- The configuration namepublic <T> Optional<BeanDefinition<T>> findBeanDefinition(Class<T> beanType, Qualifier<T> qualifier)
BeanDefinitionRegistry
BeanDefinition
for the given type.findBeanDefinition
in interface BeanDefinitionRegistry
T
- The concrete typebeanType
- The typequalifier
- The qualifierOptional
of the bean definitionpublic <T> Collection<BeanDefinition<T>> getBeanDefinitions(Class<T> beanType)
BeanDefinitionRegistry
BeanDefinition
for the given type.getBeanDefinitions
in interface BeanDefinitionRegistry
T
- The concrete typebeanType
- The typeOptional
of the bean definitionpublic <T> Collection<BeanDefinition<T>> getBeanDefinitions(Class<T> beanType, Qualifier<T> qualifier)
BeanDefinitionRegistry
BeanDefinition
for the given type.getBeanDefinitions
in interface BeanDefinitionRegistry
T
- The concrete typebeanType
- The typequalifier
- The qualifierOptional
of the bean definitionpublic <T> boolean containsBean(@Nonnull Class<T> beanType, Qualifier<T> qualifier)
BeanDefinitionRegistry
containsBean
in interface BeanDefinitionRegistry
T
- The concrete typebeanType
- The bean typequalifier
- The qualifier for the beanpublic <T> T getBean(Class<T> beanType, Qualifier<T> qualifier)
BeanLocator
getBean
in interface BeanLocator
T
- The bean type parameterbeanType
- The bean typequalifier
- The qualifierQualifiers
public <T> T getBean(Class<T> beanType)
BeanLocator
getBean
in interface BeanLocator
T
- The bean type parameterbeanType
- The bean typepublic <T> Optional<T> findBean(Class<T> beanType, Qualifier<T> qualifier)
BeanLocator
findBean
in interface BeanLocator
T
- The bean type parameterbeanType
- The bean typequalifier
- The qualifierOptional
that is either empty or containing the specified beanQualifiers
public <T> Collection<T> getBeansOfType(Class<T> beanType)
BeanLocator
getBeansOfType
in interface BeanLocator
T
- The bean type parameterbeanType
- The bean typepublic <T> Collection<T> getBeansOfType(Class<T> beanType, Qualifier<T> qualifier)
BeanLocator
getBeansOfType
in interface BeanLocator
T
- The bean type parameterbeanType
- The bean typequalifier
- The qualifierpublic <T> Stream<T> streamOfType(Class<T> beanType, Qualifier<T> qualifier)
BeanLocator
streamOfType
in interface BeanLocator
T
- The bean concrete typebeanType
- The bean typequalifier
- The qualifierQualifiers
protected <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)
BeanContext
inject
in interface BeanContext
T
- The bean generic typeinstance
- The instance to inject@Nonnull public <T> T createBean(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
BeanContext
Note that the instance returned is not saved as a singleton in the context.
createBean
in interface BeanContext
T
- 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)
BeanContext
Creates 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 BeanContext
T
- 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)
BeanContext
Creates 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 BeanContext
T
- 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)
BeanContext
destroyBean
in interface BeanContext
T
- The concrete classbeanType
- The bean type@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)
BeanLocator
getProxyTargetBean
in interface BeanLocator
T
- 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)
ExecutionHandleLocator
ProxyBeanDefinition
.findProxyTargetMethod
in interface ExecutionHandleLocator
T
- The bean type classR
- The result type of the execution handlebeanType
- The bean typemethod
- The methodarguments
- The arguments@Nonnull public <T> Optional<BeanDefinition<T>> findProxyTargetBeanDefinition(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
BeanDefinitionRegistry
BeanDefinition
for a ProxyBeanDefinition
.findProxyTargetBeanDefinition
in interface BeanDefinitionRegistry
T
- The concrete typebeanType
- The typequalifier
- The qualifierOptional
of the bean definition@Nonnull public Collection<BeanDefinition<?>> getBeanDefinitions(@Nullable Qualifier<Object> qualifier)
BeanDefinitionRegistry
BeanDefinition
for the given qualifier.getBeanDefinitions
in interface BeanDefinitionRegistry
qualifier
- The qualifer@Nonnull public Collection<BeanDefinition<?>> getAllBeanDefinitions()
BeanDefinitionRegistry
BeanDefinition
.getAllBeanDefinitions
in interface BeanDefinitionRegistry
@Nonnull public Collection<BeanDefinitionReference<?>> getBeanDefinitionReferences()
BeanDefinitionRegistry
BeanDefinitionReference
.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 qualifierOptional
public void publishEvent(@Nonnull Object event)
ApplicationEventPublisher
publishEvent
in interface ApplicationEventPublisher
event
- The event to publish@Nonnull public <T> Optional<BeanDefinition<T>> findProxyBeanDefinition(@Nonnull Class<T> beanType, @Nullable Qualifier<T> qualifier)
BeanDefinitionRegistry
BeanDefinition
for a ProxyBeanDefinition
.findProxyBeanDefinition
in interface BeanDefinitionRegistry
T
- 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> findBeanCandidatesForInstance(@Nonnull T instance)
T
- The bean generic typeinstance
- The bean instanceprotected void registerConfiguration(@Nonnull BeanConfiguration configuration)
configuration
- The configuration to register@Nonnull protected <T> T doCreateBean(@Nullable BeanResolutionContext resolutionContext, @Nonnull BeanDefinition<T> beanDefinition, @Nullable Qualifier<T> qualifier, boolean isSingleton, @Nullable Map<String,Object> argumentValues)
T
- The bean generic typeresolutionContext
- The BeanResolutionContext
beanDefinition
- The BeanDefinition
qualifier
- The Qualifier
isSingleton
- 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()