Class GeneratedService.OptionalSupplierFactoryInterceptionWrapper<T>

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

public abstract static class GeneratedService.OptionalSupplierFactoryInterceptionWrapper<T> extends Object implements Supplier<Optional<T>>
Wrapper for generated Service factories that implement a Supplier of an optional service.
  • Constructor Details

    • OptionalSupplierFactoryInterceptionWrapper

      protected OptionalSupplierFactoryInterceptionWrapper(Supplier<Optional<T>> delegate)
      Creates a new instance delegating service instantiation to the provided supplier.
      Parameters:
      delegate - used to obtain optional service instance that will be wrapped for interception
      Throws:
      NullPointerException - when delegate is null
  • Method Details

    • get

      public Optional<T> get()
      Specified by:
      get in interface Supplier<T>
    • 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