Class ProtoReflectionServiceV1.ProtoReflectionStreamObserver
- All Implemented Interfaces:
StreamObserver<ServerReflectionRequest>
,Runnable
- Enclosing class:
ProtoReflectionServiceV1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private ServerReflectionRequest
private final ServerCallStreamObserver
<ServerReflectionResponse> private final ProtoReflectionServiceV1.ServerReflectionIndex
-
Constructor Summary
ConstructorsConstructorDescriptionProtoReflectionStreamObserver
(ProtoReflectionServiceV1.ServerReflectionIndex serverReflectionIndex, ServerCallStreamObserver<ServerReflectionResponse> serverCallStreamObserver) -
Method Summary
Modifier and TypeMethodDescriptionprivate ServerReflectionResponse
createServerReflectionResponse
(ServerReflectionRequest request, com.google.protobuf.Descriptors.FileDescriptor fd) private void
getAllExtensions
(ServerReflectionRequest request) private void
private void
getFileByName
(ServerReflectionRequest request) private void
private void
private void
listServices
(ServerReflectionRequest request) void
Receives a notification of successful stream completion.void
Receives a terminating error from the stream.void
onNext
(ServerReflectionRequest request) Receives a value from the stream.void
run()
private void
sendErrorResponse
(ServerReflectionRequest request, Status.Code code, String message)
-
Field Details
-
serverReflectionIndex
-
serverCallStreamObserver
-
closeAfterSend
private boolean closeAfterSend -
request
-
-
Constructor Details
-
ProtoReflectionStreamObserver
ProtoReflectionStreamObserver(ProtoReflectionServiceV1.ServerReflectionIndex serverReflectionIndex, ServerCallStreamObserver<ServerReflectionResponse> serverCallStreamObserver)
-
-
Method Details
-
run
public void run() -
onNext
Description copied from interface:StreamObserver
Receives a value from the stream.Can be called many times but is never called after
StreamObserver.onError(Throwable)
orStreamObserver.onCompleted()
are called.Unary calls must invoke onNext at most once. Clients may invoke onNext at most once for server streaming calls, but may receive many onNext callbacks. Servers may invoke onNext at most once for client streaming calls, but may receive many onNext callbacks.
If an exception is thrown by an implementation the caller is expected to terminate the stream by calling
StreamObserver.onError(Throwable)
with the caught exception prior to propagating it.- Specified by:
onNext
in interfaceStreamObserver<ServerReflectionRequest>
- Parameters:
request
- the value passed to the stream
-
handleReflectionRequest
private void handleReflectionRequest() -
onCompleted
public void onCompleted()Description copied from interface:StreamObserver
Receives a notification of successful stream completion.May only be called once and if called it must be the last method called. In particular if an exception is thrown by an implementation of
onCompleted
no further calls to any method are allowed.- Specified by:
onCompleted
in interfaceStreamObserver<ServerReflectionRequest>
-
onError
Description copied from interface:StreamObserver
Receives a terminating error from the stream.May only be called once and if called it must be the last method called. In particular if an exception is thrown by an implementation of
onError
no further calls to any method are allowed.t
should be aStatusException
orStatusRuntimeException
, but otherThrowable
types are possible. Callers should generally convert from aStatus
viaStatus.asException()
orStatus.asRuntimeException()
. Implementations should generally convert to aStatus
viaStatus.fromThrowable(Throwable)
.- Specified by:
onError
in interfaceStreamObserver<ServerReflectionRequest>
- Parameters:
cause
- the error occurred on the stream
-
getFileByName
-
getFileContainingSymbol
-
getFileByExtension
-
getAllExtensions
-
listServices
-
sendErrorResponse
-
createServerReflectionResponse
private ServerReflectionResponse createServerReflectionResponse(ServerReflectionRequest request, com.google.protobuf.Descriptors.FileDescriptor fd)
-