Interface Injector


public interface Injector
Used to perform programmatic activation and injection.

Note that the reference implementation of Injection only performs non-reflective, compile-time generation of service activators for services that it manages. This Injector contract is mainly provided in order to allow other library extension implementations to extend the model to perform other types of injection point resolution.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The strategy the injector should attempt to apply.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> io.helidon.inject.api.ActivationResult
    activateInject(T serviceOrServiceProvider, io.helidon.inject.api.InjectorOptions opts)
    Called to activate and inject a manage service instance or service provider, putting it into Phase.ACTIVE.
    <T> io.helidon.inject.api.ActivationResult
    deactivate(T serviceOrServiceProvider, io.helidon.inject.api.InjectorOptions opts)
    Called to deactivate a managed service or service provider, putting it into Phase.DESTROYED.
  • Method Details

    • activateInject

      <T> io.helidon.inject.api.ActivationResult activateInject(T serviceOrServiceProvider, io.helidon.inject.api.InjectorOptions opts) throws InjectionServiceProviderException
      Called to activate and inject a manage service instance or service provider, putting it into Phase.ACTIVE.
      Type Parameters:
      T - the managed service type
      Parameters:
      serviceOrServiceProvider - the target instance or service provider being activated and injected
      opts - the injector options
      Returns:
      the result of the activation
      Throws:
      InjectionServiceProviderException - if an injection or activation problem occurs
      See Also:
    • deactivate

      <T> io.helidon.inject.api.ActivationResult deactivate(T serviceOrServiceProvider, io.helidon.inject.api.InjectorOptions opts) throws InjectionServiceProviderException
      Called to deactivate a managed service or service provider, putting it into Phase.DESTROYED. If a managed service has a PreDestroy annotated method then it will be called during this lifecycle event.
      Type Parameters:
      T - the managed service type
      Parameters:
      serviceOrServiceProvider - the service provider or instance registered and being managed
      opts - the injector options
      Returns:
      the result of the deactivation
      Throws:
      InjectionServiceProviderException - if a problem occurs
      See Also: