Module io.helidon.service.registry
Package io.helidon.service.registry
Class GeneratedService.QualifiedFactoryInterceptionWrapper<T,A extends Annotation>
java.lang.Object
io.helidon.service.registry.GeneratedService.QualifiedFactoryInterceptionWrapper<T,A>
- Type Parameters:
T
- type of the provided contractA
- type of the qualifier annotation
- All Implemented Interfaces:
Service.QualifiedFactory<T,
A>
- Enclosing class:
GeneratedService
public abstract static class GeneratedService.QualifiedFactoryInterceptionWrapper<T,A extends Annotation>
extends Object
implements Service.QualifiedFactory<T,A>
Wrapper for generated Service factories that implement a
Service.QualifiedFactory
.-
Field Summary
Fields inherited from interface io.helidon.service.registry.Service.QualifiedFactory
TYPE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new instance delegating service instantiation to the provided qualified factory. -
Method Summary
Modifier and TypeMethodDescriptionfirst
(Qualifier qualifier, Lookup lookup, GenericType<T> type) Get the first instance (if any) matching the qualifier and type.list
(Qualifier qualifier, Lookup lookup, GenericType<T> type) Get all instances matching the qualifier and type.protected abstract T
Wrap the instance for interception.protected Service.QualifiedInstance
<T> wrapQualifiedInstance
(Service.QualifiedInstance<T> qualifiedInstance) Wrap a qualified instance so the actual instance is correctly intercepted.
-
Constructor Details
-
QualifiedFactoryInterceptionWrapper
Creates a new instance delegating service instantiation to the provided qualified factory.- Parameters:
delegate
- used to obtain service instances that will bewrapped
for interception
-
-
Method Details
-
list
public List<Service.QualifiedInstance<T>> list(Qualifier qualifier, Lookup lookup, GenericType<T> type) Description copied from interface:Service.QualifiedFactory
Get all instances matching the qualifier and type.- Specified by:
list
in interfaceService.QualifiedFactory<T,
A extends Annotation> - Parameters:
qualifier
- the qualifier this type supports (same type as theA
type this type implements)lookup
- full lookup used to obtain the value, may contain the actual injection pointtype
- type to be injected (or type requested)- Returns:
- the qualified instance matching the request, or an empty optional if none match
-
first
public Optional<Service.QualifiedInstance<T>> first(Qualifier qualifier, Lookup lookup, GenericType<T> type) Description copied from interface:Service.QualifiedFactory
Get the first instance (if any) matching the qualifier and type.- Specified by:
first
in interfaceService.QualifiedFactory<T,
A extends Annotation> - Parameters:
qualifier
- the qualifier this type supports (same type as theA
type this type implements)lookup
- full lookup used to obtain the value, may contain the actual injection pointtype
- type to be injected (or type requested)- Returns:
- the qualified instance matching the request, or an empty optional if none match
-
wrapQualifiedInstance
protected Service.QualifiedInstance<T> wrapQualifiedInstance(Service.QualifiedInstance<T> qualifiedInstance) Wrap a qualified instance so the actual instance is correctly intercepted.- Parameters:
qualifiedInstance
- qualified instance created by appropriate factory- Returns:
- qualified instance with wrapped instance
-
wrap
Wrap the instance for interception. This method is code generated.- Parameters:
originalInstance
- instance to wrap- Returns:
- wrapped instance
-