Package io.quarkus.arc
Annotation Type All
-
@Qualifier @Retention(RUNTIME) @Target({TYPE,FIELD,METHOD,PARAMETER}) public @interface All
The container provides a synthetic bean for an injection point with the required typeListand the required qualifierAll. The injected instance is an immutable list of the contextual references of the disambiguated beans.@ApplicationScoped public class Processor { @Inject @All List<Service> services; }If the injection point declares no other qualifier thenAnyis used, i.e. the behavior is equivalent to@Inject @Any Instance<Service> services. The semantics is the same as for theIterable.iterator(), i.e. the container attempts to resolve ambiguities. In general, if multiple beans are eligible then the container eliminates all beans that are:- not alternatives, except for producer methods and fields of beans that are alternatives,
- default beans.
InstanceHandle. This can be useful if you need to inspect the bean metadata.@ApplicationScoped public class Processor { @Inject @All List<InstanceHandle<Service>> services; void doSomething() { for (InstanceHandle<Service> handle : services) { if (handle.getBean().getScope().equals(Dependent.class)) { handle.get().process(); break; } } } }The list is sorted byInjectableBean.getPriority(). Higher priority goes first.- See Also:
Priority