本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}