public interface ServiceProvider<T> extends Closeable
ProviderStrategy
paired with an InstanceProvider
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the provider.
|
Collection<ServiceInstance<T>> |
getAllInstances()
Return the current available set of instances IMPORTANT: users
should not hold on to the instance returned.
|
ServiceInstance<T> |
getInstance()
Return an instance for a single use.
|
void |
noteError(ServiceInstance<T> instance)
Take note of an error connecting to the given instance.
|
void |
start()
The provider must be started before use
|
void start() throws Exception
Exception
- any errorsServiceInstance<T> getInstance() throws Exception
Exception
- any errorsCollection<ServiceInstance<T>> getAllInstances() throws Exception
Exception
- any errorsvoid noteError(ServiceInstance<T> instance)
DownInstancePolicy
.instance
- instance that had an errorvoid close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.