Class ProtoReflectionServiceV1.ProtoReflectionStreamObserver
- All Implemented Interfaces:
StreamObserver<ServerReflectionRequest>,Runnable
- Enclosing class:
ProtoReflectionServiceV1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate ServerReflectionRequestprivate final ServerCallStreamObserver<ServerReflectionResponse> private final ProtoReflectionServiceV1.ServerReflectionIndex -
Constructor Summary
ConstructorsConstructorDescriptionProtoReflectionStreamObserver(ProtoReflectionServiceV1.ServerReflectionIndex serverReflectionIndex, ServerCallStreamObserver<ServerReflectionResponse> serverCallStreamObserver) -
Method Summary
Modifier and TypeMethodDescriptionprivate ServerReflectionResponsecreateServerReflectionResponse(ServerReflectionRequest request, com.google.protobuf.Descriptors.FileDescriptor fd) private voidgetAllExtensions(ServerReflectionRequest request) private voidprivate voidgetFileByName(ServerReflectionRequest request) private voidprivate voidprivate voidlistServices(ServerReflectionRequest request) voidReceives a notification of successful stream completion.voidReceives a terminating error from the stream.voidonNext(ServerReflectionRequest request) Receives a value from the stream.voidrun()private voidsendErrorResponse(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:StreamObserverReceives 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:
onNextin interfaceStreamObserver<ServerReflectionRequest>- Parameters:
request- the value passed to the stream
-
handleReflectionRequest
private void handleReflectionRequest() -
onCompleted
public void onCompleted()Description copied from interface:StreamObserverReceives 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
onCompletedno further calls to any method are allowed.- Specified by:
onCompletedin interfaceStreamObserver<ServerReflectionRequest>
-
onError
Description copied from interface:StreamObserverReceives 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
onErrorno further calls to any method are allowed.tshould be aStatusExceptionorStatusRuntimeException, but otherThrowabletypes are possible. Callers should generally convert from aStatusviaStatus.asException()orStatus.asRuntimeException(). Implementations should generally convert to aStatusviaStatus.fromThrowable(Throwable).- Specified by:
onErrorin 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)
-