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.

  • Method Details

    • activateInject

      <T> ActivationResult activateInject(T serviceOrServiceProvider, 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> ActivationResult deactivate(T serviceOrServiceProvider, 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: