Class ReflectionBasedSingletonServiceProvider<T>

java.lang.Object
io.helidon.inject.runtime.AbstractServiceProvider<T>
io.helidon.inject.testing.ReflectionBasedSingletonServiceProvider<T>
Type Parameters:
T - the service type
All Implemented Interfaces:
io.helidon.common.Weighted, io.helidon.inject.api.ActivationPhaseReceiver, io.helidon.inject.api.Activator, io.helidon.inject.api.DeActivator, io.helidon.inject.api.InjectionPointProvider<T>, io.helidon.inject.api.Resettable, io.helidon.inject.api.ServiceProvider<T>, io.helidon.inject.api.ServiceProviderBindable<T>, Provider<T>, Comparable<io.helidon.common.Weighted>

public class ReflectionBasedSingletonServiceProvider<T> extends AbstractServiceProvider<T>
Creates a simple reflection based service provider - for testing purposes only!
  • Method Details

    • create

      public static <T> ReflectionBasedSingletonServiceProvider<T> create(Class<T> serviceType, io.helidon.inject.api.ServiceInfoBasics siBasics)
      Generates a service provider eligible for binding into the service registry with the following proviso:
      • The service type will be of jakarta.inject.Singleton scope
      • The service type will be created reflectively, and will expect to have an empty constructor
      • The service type will not be able to provide its dependencies, nor will it be able to accept injection
      • The service type will not be able to participate in lifecycle - PostConstructMethod or PreDestroyMethod
      Note: Generally it is encouraged for users to rely on the annotation processors and other built on compile-time tooling to generate the appropriate service providers and modules. This method is an alternative to that mechanism and therefore is discouraged from production use. This method is not used in normal processing by the reference injection provider implementation.
      Type Parameters:
      T - the class of the service type
      Parameters:
      serviceType - the service type
      siBasics - the service info basic descriptor, or null to generate a default (empty) placeholder
      Returns:
      the service provider capable of being bound to the services registry
      See Also:
    • isCustom

      public boolean isCustom()
      Overrides:
      isCustom in class AbstractServiceProvider<T>
    • createServiceProvider

      protected T createServiceProvider(Map<String,Object> deps)
      Overrides:
      createServiceProvider in class AbstractServiceProvider<T>
    • serviceType

      public Class<T> serviceType()