Package io.grpc.internal
Class ForwardingNameResolver
- java.lang.Object
-
- io.grpc.NameResolver
-
- io.grpc.internal.ForwardingNameResolver
-
- Direct Known Subclasses:
RetryingNameResolver
abstract class ForwardingNameResolver extends NameResolver
A forwarding class to ensure non overridden methods are forwarded to the delegate.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.NameResolver
NameResolver.Args, NameResolver.ConfigOrError, NameResolver.Factory, NameResolver.Listener, NameResolver.Listener2, NameResolver.ResolutionResult, NameResolver.ResolutionResultAttr, NameResolver.ServiceConfigParser
-
-
Field Summary
Fields Modifier and Type Field Description private NameResolver
delegate
-
Constructor Summary
Constructors Constructor Description ForwardingNameResolver(NameResolver delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getServiceAuthority()
Returns the authority used to authenticate connections to servers.void
refresh()
Re-resolve the name.void
shutdown()
Stops the resolution.void
start(NameResolver.Listener listener)
Deprecated.void
start(NameResolver.Listener2 listener)
Starts the resolution.java.lang.String
toString()
-
-
-
Field Detail
-
delegate
private final NameResolver delegate
-
-
Constructor Detail
-
ForwardingNameResolver
ForwardingNameResolver(NameResolver delegate)
-
-
Method Detail
-
getServiceAuthority
public java.lang.String getServiceAuthority()
Description copied from class:NameResolver
Returns the authority used to authenticate connections to servers. It must be from a trusted source, because if the authority is tampered with, RPCs may be sent to the attackers which may leak sensitive user data.An implementation must generate it without blocking, typically in line, and must keep it unchanged.
NameResolver
s created from the same factory with the same argument must return the same authority.- Specified by:
getServiceAuthority
in classNameResolver
-
start
@Deprecated public void start(NameResolver.Listener listener)
Deprecated.Description copied from class:NameResolver
Starts the resolution. The method is not supposed to throw any exceptions. That might cause the Channel that the name resolver is serving to crash. Errors should be propagated throughNameResolver.Listener.onError(io.grpc.Status)
.An instance may not be started more than once, by any overload of this method, even after an intervening call to
NameResolver.shutdown()
.- Overrides:
start
in classNameResolver
- Parameters:
listener
- used to receive updates on the target
-
start
public void start(NameResolver.Listener2 listener)
Description copied from class:NameResolver
Starts the resolution. The method is not supposed to throw any exceptions. That might cause the Channel that the name resolver is serving to crash. Errors should be propagated throughNameResolver.Listener2.onError(io.grpc.Status)
.An instance may not be started more than once, by any overload of this method, even after an intervening call to
NameResolver.shutdown()
.- Overrides:
start
in classNameResolver
- Parameters:
listener
- used to receive updates on the target
-
shutdown
public void shutdown()
Description copied from class:NameResolver
Stops the resolution. Updates to the Listener will stop.- Specified by:
shutdown
in classNameResolver
-
refresh
public void refresh()
Description copied from class:NameResolver
Re-resolve the name.Can only be called after
NameResolver.start(io.grpc.NameResolver.Listener)
has been called.This is only a hint. Implementation takes it as a signal but may not start resolution immediately. It should never throw.
The default implementation is no-op.
- Overrides:
refresh
in classNameResolver
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-