sofastack / sofa-rpc-boot-projects

SOFABoot projects for SOFARPC, include starter and samples.
https://github.com/sofastack/sofa-rpc
Apache License 2.0
292 stars 117 forks source link

Improve callback class set API in RpcBindingParam #119

Closed khotyn closed 5 years ago

khotyn commented 5 years ago

SOFARPC provide a method in RpcBindingParam for users to set callback class when users use callback invocation type, but the method accept a String as type:

public void setCallbackClass(String callbackClass) {
}

We should improve this method to a more strong typed method, such as

public void setCallbackClass(Class<? extends SofaResponseCallback> callbackClass) {
}

so users are less likely to make mistakes.

leizhiyuan commented 5 years ago

这个有一些历史原因,不方便改,新增的话已经有不少了,对于想使用类或者对象的,可以使用

setCallbackHandler方法,直接传入对象。