java.lang.Object
io.helidon.inject.runtime.ServiceBinderDefault
- All Implemented Interfaces:
ServiceBinder
The default implementation for
ServiceBinder
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
bind
(ServiceProvider<?> sp) Bind a service provider instance into the backingServices
service registry.static ServiceBinderDefault
create
(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:ServiceBinder
Bind a service provider instance into the backingServices
service registry.- Specified by:
bind
in 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
-