public class ServiceProviderImpl<T> extends java.lang.Object implements ServiceProvider<T>
Constructor and Description |
---|
ServiceProviderImpl(ServiceDiscoveryImpl<T> discovery,
java.lang.String serviceName,
ProviderStrategy<T> providerStrategy,
java.util.concurrent.ThreadFactory threadFactory,
int refreshPaddingMs) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ServiceInstance<T> |
getInstance()
Return an instance for a single use.
|
void |
start()
The provider must be started before use
|
public ServiceProviderImpl(ServiceDiscoveryImpl<T> discovery, java.lang.String serviceName, ProviderStrategy<T> providerStrategy, java.util.concurrent.ThreadFactory threadFactory, int refreshPaddingMs)
public void start() throws java.lang.Exception
start
in interface ServiceProvider<T>
java.lang.Exception
- any errorspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public ServiceInstance<T> getInstance() throws java.lang.Exception
getInstance
in interface ServiceProvider<T>
java.lang.Exception
- any errors