@InterfaceAudience.Private public class ServerRpcController extends Object
com.google.protobuf.Service
implementations.
When implementing com.google.protobuf.Service
defined methods,
coprocessor endpoints can use the following
pattern to pass exceptions back to the RPC client:
public void myMethod(RpcController controller, MyRequest request, RpcCallback
Constructor and Description |
---|
ServerRpcController() |
Modifier and Type | Method and Description |
---|---|
void |
checkFailed()
Throws an IOException back out if one is currently stored.
|
String |
errorText() |
boolean |
failed() |
boolean |
failedOnException()
Returns whether or not a server exception was generated in the prior RPC invocation.
|
IOException |
getFailedOn()
Returns any exception thrown during service method invocation, or
null if no exception
was thrown. |
boolean |
isCanceled() |
void |
notifyOnCancel(<any> objectRpcCallback) |
void |
reset() |
void |
setFailed(String message) |
void |
setFailedOn(IOException ioe)
Sets an exception to be communicated back to the
com.google.protobuf.Service client. |
void |
startCancel() |
public void reset()
public boolean failed()
public String errorText()
public void startCancel()
public void setFailed(String message)
public boolean isCanceled()
public void notifyOnCancel(<any> objectRpcCallback)
public void setFailedOn(IOException ioe)
com.google.protobuf.Service
client.ioe
- the exception encountered during execution of the service methodpublic IOException getFailedOn()
null
if no exception
was thrown. This can be used by clients to receive exceptions generated by RPC calls, even
when RpcCallback
s are used and no com.google.protobuf.ServiceException
is
declared.public boolean failedOnException()
public void checkFailed() throws IOException
IOException