Package com.google.apphosting.runtime
Class LocalRpcContext<M extends com.google.protobuf.MessageLite>
java.lang.Object
com.google.apphosting.runtime.LocalRpcContext<M>
- All Implemented Interfaces:
AnyRpcServerContext
public class LocalRpcContext<M extends com.google.protobuf.MessageLite>
extends Object
implements AnyRpcServerContext
-
Constructor Summary
ConstructorsConstructorDescriptionLocalRpcContext(Class<M> responseMessageClass) LocalRpcContext(Class<M> responseMessageClass, Duration timeRemaining) -
Method Summary
Modifier and TypeMethodDescriptionvoidfinishWithAppError(int appErrorCode, String errorDetail) Indicates that the RPC was handled in a way that means an "application error" should be signaled to the client.voidfinishWithResponse(com.google.protobuf.MessageLite response) Indicates that the RPC was handled successfully.longReturns a trace id for this request.longReturns the time at which the RPC began, in milliseconds since midnight UTC on 1970-01-01.Returns the remaining time for this call.
-
Constructor Details
-
LocalRpcContext
-
LocalRpcContext
-
-
Method Details
-
finishWithResponse
public void finishWithResponse(com.google.protobuf.MessageLite response) Description copied from interface:AnyRpcServerContextIndicates that the RPC was handled successfully. Here "successfully" means that a normal RPC response will be sent to the client. That response might still indicate an error.- Specified by:
finishWithResponsein interfaceAnyRpcServerContext
-
getResponse
-
finishWithAppError
Description copied from interface:AnyRpcServerContextIndicates that the RPC was handled in a way that means an "application error" should be signaled to the client. If the RPC layer is Stubby, this means the application error is communicated by Stubby itself.- Specified by:
finishWithAppErrorin interfaceAnyRpcServerContext
-
getTimeRemaining
Description copied from interface:AnyRpcServerContextReturns the remaining time for this call. This value decreases while the call is being handled.- Specified by:
getTimeRemainingin interfaceAnyRpcServerContext
-
getGlobalId
public long getGlobalId()Description copied from interface:AnyRpcServerContextReturns a trace id for this request. Ideally provided by the RPC client so that the request is tied to the client's trace span.- Specified by:
getGlobalIdin interfaceAnyRpcServerContext
-
getStartTimeMillis
public long getStartTimeMillis()Description copied from interface:AnyRpcServerContextReturns the time at which the RPC began, in milliseconds since midnight UTC on 1970-01-01.- Specified by:
getStartTimeMillisin interfaceAnyRpcServerContext
-