Class GeneratedService.IpFactoryInterceptionWrapper<T>

java.lang.Object
io.helidon.service.registry.GeneratedService.IpFactoryInterceptionWrapper<T>
Type Parameters:
T - type of the provided contract
All Implemented Interfaces:
Service.InjectionPointFactory<T>
Enclosing class:
GeneratedService

public abstract static class GeneratedService.IpFactoryInterceptionWrapper<T> extends Object implements Service.InjectionPointFactory<T>
Wrapper for generated Service factories that implement a Service.InjectionPointFactory.
  • Constructor Details

    • IpFactoryInterceptionWrapper

      protected IpFactoryInterceptionWrapper(Service.InjectionPointFactory<T> delegate)
      Creates a new instance delegating service instantiation to the provided injection point factory.
      Parameters:
      delegate - used to obtain service instances that will be wrapped for interception
  • Method Details

    • list

      public List<Service.QualifiedInstance<T>> list(Lookup lookup)
      Description copied from interface: Service.InjectionPointFactory
      Get (or create) a list of instances matching the criteria for the given injection point context.
      Specified by:
      list in interface Service.InjectionPointFactory<T>
      Parameters:
      lookup - the service query
      Returns:
      the service instances matching criteria for the lookup in order of weight, or empty if none matching
    • first

      public Optional<Service.QualifiedInstance<T>> first(Lookup lookup)
      Description copied from interface: Service.InjectionPointFactory
      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 calling Service.InjectionPointFactory.list(Lookup).
      Specified by:
      first in interface Service.InjectionPointFactory<T>
      Parameters:
      lookup - the service query
      Returns:
      the best service instance matching the criteria, if any matched, with qualifiers (if any)
    • 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