ConfigurationServiceLocator
instead.@Deprecated @Singleton public class ConfigurationServiceLocator extends Object implements ServiceLocator
Constructor and Description |
---|
ConfigurationServiceLocator(com.typesafe.config.Config configuration)
Deprecated.
|
ConfigurationServiceLocator(Configuration configuration)
Deprecated.
use
ConfigurationServiceLocator(Config) instead. |
Modifier and Type | Method and Description |
---|---|
<T> CompletionStage<Optional<T>> |
doWithService(String name,
Descriptor.Call<?,?> serviceCall,
Function<URI,CompletionStage<T>> block)
Deprecated.
Do the given action with the given service.
|
CompletionStage<Optional<URI>> |
locate(String name,
Descriptor.Call<?,?> serviceCall)
Deprecated.
Locate a service's URI for the given name.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
locate, locateAll, locateAll
@Inject public ConfigurationServiceLocator(com.typesafe.config.Config configuration)
@Deprecated public ConfigurationServiceLocator(Configuration configuration)
ConfigurationServiceLocator(Config)
instead.public CompletionStage<Optional<URI>> locate(String name, Descriptor.Call<?,?> serviceCall)
ServiceLocator
locate
in interface ServiceLocator
name
- The name of the service.serviceCall
- The service call descriptor that this lookup is for.public <T> CompletionStage<Optional<T>> doWithService(String name, Descriptor.Call<?,?> serviceCall, Function<URI,CompletionStage<T>> block)
ServiceLocator
This should be used in preference to ServiceLocator.locate(String, Descriptor.Call)
when possible
as it will allow the service locator to add in things like circuit breakers.
It is required that the service locator will, based on the service call circuit breaker configuration, wrap the invocation of the passed in block with a circuit breaker.
doWithService
in interface ServiceLocator
name
- The name of the service.serviceCall
- The service call descriptor that this lookup is for.block
- A block of code that takes the URI for the service, and returns a future of some
work done on the service. This will only be executed if the service was found.