Package io.quarkus.arc
Annotation Interface All
The container provides a synthetic bean for an injection point with the required type
List
and the required qualifier
All
. 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 then
Any
is used, i.e. the behavior is equivalent to
@Inject @Any Instance<Service> services
. The semantics is the same as for the Iterable.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 by
InjectableBean.getPriority()
. Higher priority goes first.- See Also:
-
Priority
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Supports inline instantiation of this qualifier.