Package io.avaje.inject
Avaje Inject API - see
BeanScope.
Overview
1. @Singleton / @Factory
Put @Singleton on beans that we want avaje-inject to wire.
We can use @Factory/@Bean to programmatically create dependencies
when they have interesting construction logic (e.g. construction depends on
system/environment properties etc - like Spring @Configuration).
{@code-
Interface Summary Interface Description BeanEntry A bean entry with priority and optional name.BeanScope Holds beans created by dependency injection.BeanScopeBuilder Build a bean scope with options for shutdown hook and supplying external dependencies.BeanScopeBuilder.ForTesting Extends the building with testing specific support for mocks and spies. -
Annotation Types Summary Annotation Type Description Bean Marks methods on a@Factorybean that create dependencies.Factory A singleton bean that has methods marked with the@Beanannotation.InjectModule Used to explicitly specify if it depends on externally provided beans or provides.PostConstruct ThePostConstructannotation is used on a method that needs to be executed after dependency injection is done to perform any initialization.PreDestroy ThePreDestroyannotation is used on a method as a callback notification to signal that the instance is in the process of being removed by the container.Primary Identify a bean as being the preferred bean to inject when multiple beans implement the intended interface.Priority ThePriorityannotation can be applied to classes to indicate in what order they should be returned via @BeanScope.listByPriority(Class).Secondary Identify a bean as being the least preferred bean to inject when multiple beans implement the intended interface.