Package io.grpc.protobuf.services
Class HealthCheckingLoadBalancerFactory.HealthCheckState.HcStream
- java.lang.Object
-
- io.grpc.ClientCall.Listener<HealthCheckResponse>
-
- io.grpc.protobuf.services.HealthCheckingLoadBalancerFactory.HealthCheckState.HcStream
-
- Enclosing class:
- HealthCheckingLoadBalancerFactory.HealthCheckState
private class HealthCheckingLoadBalancerFactory.HealthCheckState.HcStream extends ClientCall.Listener<HealthCheckResponse>
-
-
Field Summary
Fields Modifier and Type Field Description private ClientCall<HealthCheckRequest,HealthCheckResponse>
call
private boolean
callHasResponded
private java.lang.String
callServiceName
private com.google.common.base.Stopwatch
stopwatch
-
Constructor Summary
Constructors Constructor Description HcStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
cancel(java.lang.String msg)
(package private) void
handleResponse(HealthCheckResponse response)
(package private) void
handleStreamClosed(Status status)
void
onClose(Status status, Metadata trailers)
The ClientCall has been closed.void
onMessage(HealthCheckResponse response)
A response message has been received.(package private) void
start()
java.lang.String
toString()
-
Methods inherited from class io.grpc.ClientCall.Listener
onHeaders, onReady
-
-
-
-
Field Detail
-
call
private final ClientCall<HealthCheckRequest,HealthCheckResponse> call
-
callServiceName
private final java.lang.String callServiceName
-
stopwatch
private final com.google.common.base.Stopwatch stopwatch
-
callHasResponded
private boolean callHasResponded
-
-
Method Detail
-
start
void start()
-
cancel
void cancel(java.lang.String msg)
-
onMessage
public void onMessage(HealthCheckResponse response)
Description copied from class:ClientCall.Listener
A response message has been received. May be called zero or more times depending on whether the call response is empty, a single message or a stream of messages.- Overrides:
onMessage
in classClientCall.Listener<HealthCheckResponse>
- Parameters:
response
- returned by the server
-
onClose
public void onClose(Status status, Metadata trailers)
Description copied from class:ClientCall.Listener
The ClientCall has been closed. Any additional calls to theClientCall
will not be processed by the server. No further receiving will occur and no further notifications will be made.Since
Metadata
is not thread-safe, the caller must not access (read or write)trailers
after this point.If
status
returns false forStatus.isOk()
, then the call failed. An additional block of trailer metadata may be received at the end of the call from the server. An emptyMetadata
object is passed if no trailers are received.This method should not throw. If this method throws, there is no way to be notified of the exception. Implementations should therefore be careful of exceptions which can accidentally leak resources.
- Overrides:
onClose
in classClientCall.Listener<HealthCheckResponse>
- Parameters:
status
- the result of the remote call.trailers
- metadata provided at call completion.
-
handleResponse
void handleResponse(HealthCheckResponse response)
-
handleStreamClosed
void handleStreamClosed(Status status)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-