当前位置: 首页>>代码示例>>Java>>正文


Java RpcUtils.attachInvocationIdIfAsync方法代码示例

本文整理汇总了Java中com.alibaba.dubbo.rpc.support.RpcUtils.attachInvocationIdIfAsync方法的典型用法代码示例。如果您正苦于以下问题:Java RpcUtils.attachInvocationIdIfAsync方法的具体用法?Java RpcUtils.attachInvocationIdIfAsync怎么用?Java RpcUtils.attachInvocationIdIfAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.alibaba.dubbo.rpc.support.RpcUtils的用法示例。


在下文中一共展示了RpcUtils.attachInvocationIdIfAsync方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: invoke

import com.alibaba.dubbo.rpc.support.RpcUtils; //导入方法依赖的package包/类
public Result invoke(final Invocation invocation) throws RpcException {

        checkWhetherDestroyed();

        LoadBalance loadbalance;
        
        List<Invoker<T>> invokers = list(invocation);
        if (invokers != null && invokers.size() > 0) {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
                    .getMethodParameter(invocation.getMethodName(),Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE));
        } else {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
        }
        RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
        return doInvoke(invocation, invokers, loadbalance);
    }
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:17,代码来源:AbstractClusterInvoker.java

示例2: invoke

import com.alibaba.dubbo.rpc.support.RpcUtils; //导入方法依赖的package包/类
public Result invoke(final Invocation invocation) throws RpcException {

        checkWheatherDestoried();

        LoadBalance loadbalance;
        
        List<Invoker<T>> invokers = list(invocation);
        if (invokers != null && invokers.size() > 0) {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
                    .getMethodParameter(invocation.getMethodName(),Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE));
        } else {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
        }
        RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
        return doInvoke(invocation, invokers, loadbalance);
    }
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:17,代码来源:AbstractClusterInvoker.java

示例3: invoke

import com.alibaba.dubbo.rpc.support.RpcUtils; //导入方法依赖的package包/类
public Result invoke(final Invocation invocation) throws RpcException {

        checkWhetherDestroyed();

        LoadBalance loadbalance;

        List<Invoker<T>> invokers = list(invocation);
        if (invokers != null && invokers.size() > 0) {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
                    .getMethodParameter(invocation.getMethodName(), Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE));
        } else {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
        }
        RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
        return doInvoke(invocation, invokers, loadbalance);
    }
 
开发者ID:l1325169021,项目名称:github-test,代码行数:17,代码来源:AbstractClusterInvoker.java

示例4: invoke

import com.alibaba.dubbo.rpc.support.RpcUtils; //导入方法依赖的package包/类
public Result invoke(final Invocation invocation) throws RpcException {

        checkWheatherDestoried();

        LoadBalance loadbalance;
        //FIXME list是路由之后的结果  add by jileng
        List<Invoker<T>> invokers = list(invocation);
        if (invokers != null && invokers.size() > 0) {
            //FIXME  存在多个invoker的情况下  
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
                    .getMethodParameter(invocation.getMethodName(),Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE));
        } else {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
        }
        //FIXME 如果是async调用,则把invocationId放到RpcInvocation里面  add by jileng
        RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
        return doInvoke(invocation, invokers, loadbalance);
    }
 
开发者ID:spccold,项目名称:dubbo-comments,代码行数:19,代码来源:AbstractClusterInvoker.java

示例5: invoke

import com.alibaba.dubbo.rpc.support.RpcUtils; //导入方法依赖的package包/类
public Result invoke(final Invocation invocation) throws RpcException {

        checkWheatherDestoried();

        LoadBalance loadbalance;
        //从Directory中获得集群后面的Invoker列表
        List<Invoker<T>> invokers = list(invocation);
        //通过SPI机制加载需要的LoadBalance
        if (invokers != null && invokers.size() > 0) {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
                    .getMethodParameter(invocation.getMethodName(),Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE));
        } else {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
        }
        RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
        //调用子类重写的doInvoker()方法
        return doInvoke(invocation, invokers, loadbalance);
    }
 
开发者ID:DoubleSmile,项目名称:dubbo-learning,代码行数:19,代码来源:AbstractClusterInvoker.java

示例6: invoke

import com.alibaba.dubbo.rpc.support.RpcUtils; //导入方法依赖的package包/类
public Result invoke(final Invocation invocation) throws JahhanException {

		checkWheatherDestoyed();

		LoadBalance loadbalance;

		List<Invoker<T>> invokers = list(invocation);
		invokers = direct(invokers, invocation);
		if (invokers != null && invokers.size() > 0) {
			loadbalance = ExtensionExtendUtil.getExtension(LoadBalance.class,
					invokers.get(0).getUrl().getMethodParameter(invocation.getMethodName(), Constants.LOADBALANCE_KEY,
							Constants.DEFAULT_LOADBALANCE));
		} else {
			loadbalance = ExtensionExtendUtil.getExtension(LoadBalance.class, Constants.DEFAULT_LOADBALANCE);
		}
		RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
		return doInvoke(invocation, invokers, loadbalance);
	}
 
开发者ID:nince-wyj,项目名称:jahhan,代码行数:19,代码来源:AbstractClusterInvoker.java

示例7: invoke

import com.alibaba.dubbo.rpc.support.RpcUtils; //导入方法依赖的package包/类
public Result invoke(final Invocation invocation) throws RpcException {

        checkWheatherDestoried();

        LoadBalance loadbalance;

        List<Invoker<T>> invokers = list(invocation);
        if (invokers != null && invokers.size() > 0) {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(invokers.get(0).getUrl()
                    .getMethodParameter(invocation.getMethodName(), Constants.LOADBALANCE_KEY, Constants.DEFAULT_LOADBALANCE));
        } else {
            loadbalance = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(Constants.DEFAULT_LOADBALANCE);
        }
        RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
        return doInvoke(invocation, invokers, loadbalance);
    }
 
开发者ID:ketao1989,项目名称:exDubbo,代码行数:17,代码来源:AbstractClusterInvoker.java


注:本文中的com.alibaba.dubbo.rpc.support.RpcUtils.attachInvocationIdIfAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。