Dubbo回调onreturn、onthrow

阅读更多
Dubbo
StaticContext.getSystemContext();
//attributes通过系统context进行存储.
StaticContext.getSystemContext().putAll(attributes);
com.alibaba.dubbo.config.ReferenceConfig#init
解析方法上的属性(回调方法)
appendAttributes(attributes, method, prifix + "." + method.getName());
checkAndConvertImplicitConfig(method, map, attributes);

com.alibaba.dubbo.rpc.StaticContext#getContext 回调的集合
方法存在缺陷:如果存在多个onreturn、onthrow的话,方法名不能相同,如果相同就会出现回调覆盖现象
com.alibaba.dubbo.common.utils.ReflectUtils#findMethodByMethodSignature
public static Method findMethodByMethodSignature(Class clazz, String methodName, String[] parameterTypes)
        throws NoSuchMethodException, ClassNotFoundException {
    String signature = methodName;
        if(parameterTypes != null && parameterTypes.length > 0){
            signature = methodName + StringUtils.join(parameterTypes);
        }
        Method method = Signature_METHODS_CACHE.get(signature);
        if(method != null){
            return method;
        }


                         timeout="500" retries="0" mock="true" check="false">
       
       
       
       
       
   

你可能感兴趣的:(Dubbo)