public abstract class BoltSendableResponseCallback<T> extends Object implements SendableResponseCallback<T>
| 限定符和类型 | 字段和说明 |
|---|---|
protected com.alipay.remoting.AsyncContext |
asyncContext
请求对应的上下文
|
protected SofaRequest |
request |
| 构造器和说明 |
|---|
BoltSendableResponseCallback() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
checkState()
检测是否已经返回过响应,不能重复发送
|
protected void |
init()
初始化数据
|
void |
onAppException(Throwable throwable,
String methodName,
RequestBase request)
SOFA RPC will callback this method when server meet exception
|
void |
onSofaException(SofaRpcException sofaException,
String methodName,
RequestBase request)
SOFA RPC will callback this method when framework meet exception
|
void |
sendAppException(Throwable throwable)
A->B(当前)->C的场景下,将远程服务端C的业务异常异步返回给调用者A
|
void |
sendAppResponse(Object appResponse)
A->B(当前)->C的场景下,将远程服务端C的结果异步返回给调用者A
|
void |
sendSofaException(SofaRpcException sofaException)
A->B(当前)->C的场景下,将远程服务端C的RPc异常异步返回给调用者A
|
protected void |
sendSofaResponse(SofaResponse response,
SofaRpcException sofaException)
发送响应数据
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonAppResponseprotected com.alipay.remoting.AsyncContext asyncContext
protected SofaRequest request
protected void init()
public void onAppException(Throwable throwable, String methodName, RequestBase request)
SofaResponseCallbackonAppException 在接口中 SofaResponseCallback<T>throwable - app's exceptionmethodName - the invoked methodrequest - the invoked requestpublic void onSofaException(SofaRpcException sofaException, String methodName, RequestBase request)
SofaResponseCallbackonSofaException 在接口中 SofaResponseCallback<T>sofaException - framework exceptionmethodName - the invoked methodrequest - the invoked request objectpublic void sendAppResponse(Object appResponse)
sendAppResponse 在接口中 SendableResponseCallback<T>appResponse - 返回给A的值SofaResponseCallback.onAppResponse(Object, String, RequestBase)public void sendAppException(Throwable throwable)
sendAppException 在接口中 SendableResponseCallback<T>throwable - 返回给A的异常SofaResponseCallback.onAppException(Throwable, String, RequestBase)public void sendSofaException(SofaRpcException sofaException)
sendSofaException 在接口中 SendableResponseCallback<T>sofaException - 返回给A的异常SofaResponseCallback.onSofaException(SofaRpcException, String, RequestBase)protected void checkState()
protected void sendSofaResponse(SofaResponse response, SofaRpcException sofaException)
response - 响应sofaException - SofaRpcExceptionCopyright © 2008–2018 The Ant Financial. All rights reserved.