UnresolvedAddress - The type of address before resolution.ResolvedAddress - The type of address after resolution.E - Type of ServiceDiscovererEvents published from discover(Object).public class DelegatingServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E extends ServiceDiscovererEvent<ResolvedAddress>> extends Object implements ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E>
ServiceDiscoverer that delegates all methods to another ServiceDiscoverer.| Constructor and Description |
|---|
DelegatingServiceDiscoverer(ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E> delegate)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Completable |
closeAsync() |
Completable |
closeAsyncGracefully() |
protected ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E> |
delegate()
Returns the
ServiceDiscoverer delegate. |
Publisher<Collection<E>> |
discover(UnresolvedAddress address)
Subscribe to the service discovery system for changes in the available
ResolvedAddress associated with
address. |
Completable |
onClose() |
Completable |
onClosing() |
String |
toString() |
public DelegatingServiceDiscoverer(ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E> delegate)
delegate - ServiceDiscoverer to which all methods are delegated.protected final ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E> delegate()
ServiceDiscoverer delegate.ServiceDiscoverer.public Publisher<Collection<E>> discover(UnresolvedAddress address)
ServiceDiscovererResolvedAddress associated with
address.
In general a call to this method will continue to discover changes related to address until the
PublisherSource.Subscription corresponding to the return value is cancelled via Cancellable.cancel() or there
are no more changes to be published.
discover in interface ServiceDiscoverer<UnresolvedAddress,ResolvedAddress,E extends ServiceDiscovererEvent<ResolvedAddress>>address - the service address to discover. Examples of what this address maybe are:
Publisher that represents a stream of events from the service discovery system.public Completable onClose()
onClose in interface ListenableAsyncCloseablepublic Completable onClosing()
onClosing in interface ListenableAsyncCloseablepublic Completable closeAsync()
closeAsync in interface AsyncCloseablepublic Completable closeAsyncGracefully()
closeAsyncGracefully in interface AsyncCloseablepublic String toString()
toString in class Object