Module io.helidon.service.registry
Package io.helidon.service.registry
Interface Service.InjectionPointFactory<T>
- Type Parameters:
T
- the type that the factory produces
- All Known Implementing Classes:
GeneratedService.IpFactoryInterceptionWrapper
- Enclosing class:
Service
public static interface Service.InjectionPointFactory<T>
Provides ability to contextualize the injected service by the target receiver of the injection point dynamically
at runtime. This API will provide service instances of type
T
.
The ordering of services, and the preferred service itself, is determined by the service registry implementation.
The service registry does not make any assumptions about qualifiers of the instances being created, though they should
be either the same as the injection point factory itself, or a subset of it, so the service can be discovered through
one of the lookup methods (i.e. the injection point factory may be annotated with a
Service.Named
with Service.Named.WILDCARD_NAME
value, and each instance provided may use a more specific name qualifier).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionGet (or create) an instance of this service type for the given injection point context.default List
<Service.QualifiedInstance<T>> Get (or create) a list of instances matching the criteria for the given injection point context.
-
Field Details
-
TYPE
Type name of this interface.
-
-
Method Details
-
first
Get (or create) an instance of this service type for the given injection point context. This is logically the same as using the first element of the result from callinglist(Lookup)
.- Parameters:
lookup
- the service query- Returns:
- the best service instance matching the criteria, if any matched, with qualifiers (if any)
-
list
Get (or create) a list of instances matching the criteria for the given injection point context.- Parameters:
lookup
- the service query- Returns:
- the service instances matching criteria for the lookup in order of weight, or empty if none matching
-