Class ServiceBinderDefault

java.lang.Object
io.helidon.inject.runtime.ServiceBinderDefault
All Implemented Interfaces:
ServiceBinder

public class ServiceBinderDefault extends Object implements ServiceBinder
The default implementation for ServiceBinder.
  • Method Details

    • create

      public static ServiceBinderDefault create(InjectionServices injectionServices, String moduleName, boolean trusted)
      Creates an instance of the default services binder.
      Parameters:
      injectionServices - the services registry instance
      moduleName - the module name
      trusted - are we in trusted mode (typically only set during early initialization sequence)
      Returns:
      the newly created service binder
    • bind

      public void bind(ServiceProvider<?> sp)
      Description copied from interface: ServiceBinder
      Bind a service provider instance into the backing Services service registry.
      Specified by:
      bind in interface ServiceBinder
      Parameters:
      sp - the service provider to bind into the service registry
    • toBindableProvider

      public static Optional<ServiceProviderBindable<?>> toBindableProvider(ServiceProvider<?> sp)
      Returns the bindable service provider for what is passed if available.
      Parameters:
      sp - the service provider
      Returns:
      the bindable service provider if available, otherwise empty
    • toRootProvider

      public static ServiceProvider<?> toRootProvider(ServiceProvider<?> sp)
      Returns the root provider of the service provider passed.
      Parameters:
      sp - the service provider
      Returns:
      the root provider of the service provider, falling back to the service provider passed