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 contract
A - 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.
  • Constructor Details

    • QualifiedFactoryInterceptionWrapper

      protected QualifiedFactoryInterceptionWrapper(Service.QualifiedFactory<T,A> delegate)
      Creates a new instance delegating service instantiation to the provided qualified factory.
      Parameters:
      delegate - used to obtain service instances that will be wrapped 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 interface Service.QualifiedFactory<T,A extends Annotation>
      Parameters:
      qualifier - the qualifier this type supports (same type as the A type this type implements)
      lookup - full lookup used to obtain the value, may contain the actual injection point
      type - 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 interface Service.QualifiedFactory<T,A extends Annotation>
      Parameters:
      qualifier - the qualifier this type supports (same type as the A type this type implements)
      lookup - full lookup used to obtain the value, may contain the actual injection point
      type - 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

      protected abstract T wrap(T originalInstance)
      Wrap the instance for interception. This method is code generated.
      Parameters:
      originalInstance - instance to wrap
      Returns:
      wrapped instance