Interface ServiceProviderBindable<T>

Type Parameters:
T - the type that this service provider manages
All Superinterfaces:
Comparable<Weighted>, InjectionPointProvider<T>, Provider<T>, ServiceProvider<T>, Weighted
All Known Implementing Classes:
AbstractServiceProvider, ConfigDrivenServiceProviderBase, ReflectionBasedSingletonServiceProvider

public interface ServiceProviderBindable<T> extends ServiceProvider<T>
An extension to ServiceProvider that allows for startup binding from a Injection$$Application, and thereby works in conjunction with the ServiceBinder during injection service registry initialization.

The only guarantee the provider implementation has is ensuring that ModuleComponent instances are bound to the Services instances, as well as informed on the module name.

Generally this class should be called internally by the framework, and typically occurs only during initialization sequences.

See Also:
  • Method Details

    • moduleName

      void moduleName(String moduleName)
      Called to inform a service provider the module name it is bound to. Will only be called when there is a non-null module name associated for the given ModuleComponent. A service provider can be associated with 0..1 modules.
      Parameters:
      moduleName - the non-null module name
    • isInterceptor

      default boolean isInterceptor()
      Returns true if this service provider instance is an Interceptor.
      Returns:
      true if this service provider is an interceptor
    • isIntercepted

      default boolean isIntercepted()
      Returns true if this service provider is intercepted.
      Returns:
      flag indicating whether this service provider is intercepted
    • interceptor

      Optional<ServiceProvider<?>> interceptor()
      Returns the service provider that intercepts this provider.
      Returns:
      the service provider that intercepts this provider
    • interceptor

      default void interceptor(ServiceProvider<?> interceptor)
      Sets the interceptor for this service provider.
      Parameters:
      interceptor - the interceptor for this provider
    • rootProvider

      default Optional<ServiceProvider<?>> rootProvider()
      Gets the root/parent provider for this service. A root/parent provider is intended to manage it's underlying providers. Note that "root" and "parent" are interchangeable here since there is at most one level of depth that occurs when ServiceProvider's are wrapped by other providers.
      Returns:
      the root/parent provider or empty if this instance is the root provider
    • isRootProvider

      default boolean isRootProvider()
      Returns true if this provider is the root provider.
      Returns:
      indicates whether this provider is a root provider - the default is true
    • rootProvider

      default void rootProvider(ServiceProvider<T> rootProvider)
      Sets the root/parent provider for this instance.
      Parameters:
      rootProvider - sets the root provider
    • injectionServices

      Optional<InjectionServices> injectionServices()
      Returns the previously assigned InjectionServices instance.
      Returns:
      the previously assigned injection services instance, or empty if never assigned
      See Also:
    • injectionServices

      void injectionServices(Optional<InjectionServices> injectionServices)
      Assigns the services instance this provider is bound to. A service provider can be associated with 0..1 services instance. If not set, the service provider should use InjectionServices.injectionServices() to ascertain the instance.
      Parameters:
      injectionServices - the injection services instance, or empty to clear any active binding
    • injectionPlanBinder

      default Optional<ServiceInjectionPlanBinder.Binder> injectionPlanBinder()
      The binder can be provided by the service provider to deterministically set the injection plan at compile-time, and subsequently loaded at early startup initialization.
      Returns:
      binder used for this service provider, or empty if not capable or ineligible of being bound