Package io.micronaut.context.event
Interface BeanInitializedEventListener<T>
- Type Parameters:
T
- The event type
- All Superinterfaces:
EventListener
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@Indexed(BeanInitializedEventListener.class)
@FunctionalInterface
public interface BeanInitializedEventListener<T>
extends EventListener
Allows hooking into bean instantiation at the point prior to when PostConstruct
initialization hooks have been called and in the case of bean BeanProvider
instances the
BeanProvider.get()
method has not yet been invoked.
This allows (for example) customization of bean properties prior to any initialization logic or factory logic.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptiononInitialized
(BeanInitializingEvent<T> event) Fired when a bean is instantiated but thePostConstruct
initialization hooks have not yet been called and in this case of beanProvider
instances theProvider.get()
method has not yet been invoked.
-
Method Details
-
onInitialized
Fired when a bean is instantiated but the
PostConstruct
initialization hooks have not yet been called and in this case of beanProvider
instances theProvider.get()
method has not yet been invoked.- Parameters:
event
- The bean initializing event- Returns:
- The bean or a replacement bean of the same type
-