Package io.grpc
Interface NameResolver.Listener
-
- All Known Implementing Classes:
NameResolver.Listener2
- Enclosing class:
- NameResolver
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770") @ThreadSafe public static interface NameResolver.Listener
Receives address updates.All methods are expected to return quickly.
- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onAddresses(List<EquivalentAddressGroup> servers, Attributes attributes)
Handles updates on resolved addresses and attributes.void
onError(Status error)
Handles an error from the resolver.
-
-
-
Method Detail
-
onAddresses
void onAddresses(List<EquivalentAddressGroup> servers, @ResolutionResultAttr Attributes attributes)
Handles updates on resolved addresses and attributes.Implementations will not modify the given
servers
.- Parameters:
servers
- the resolved server addresses. An empty list will triggeronError(io.grpc.Status)
attributes
- extra information from naming system.- Since:
- 1.3.0
-
onError
void onError(Status error)
Handles an error from the resolver. The listener is responsible for eventually invokingNameResolver.refresh()
to re-attempt resolution.- Parameters:
error
- a non-OK status- Since:
- 1.0.0
-
-