java.lang.Object
io.helidon.inject.runtime.ServiceBinderDefault
- All Implemented Interfaces:
ServiceBinder
The default implementation for
ServiceBinder.-
Method Summary
Modifier and TypeMethodDescriptionvoidbind(ServiceProvider<?> sp) Bind a service provider instance into the backingServicesservice registry.static ServiceBinderDefaultcreate(InjectionServices injectionServices, String moduleName, boolean trusted) Creates an instance of the default services binder.static Optional<ServiceProviderBindable<?>> Returns the bindable service provider for what is passed if available.static ServiceProvider<?> toRootProvider(ServiceProvider<?> sp) Returns the root provider of the service provider passed.
-
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 instancemoduleName- the module nametrusted- are we in trusted mode (typically only set during early initialization sequence)- Returns:
- the newly created service binder
-
bind
Description copied from interface:ServiceBinderBind a service provider instance into the backingServicesservice registry.- Specified by:
bindin interfaceServiceBinder- Parameters:
sp- the service provider to bind into the service registry
-
toBindableProvider
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
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
-