【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
package com.alibaba.dubbo.rpc;
import com.alibaba.dubbo.common.Node;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.extension.ExtensionLoader;
public class ProxyFactory$Adaptive
implements ProxyFactory
{
public Object getProxy(Invoker paramInvoker)
throws RpcException
{
if (paramInvoker == null) {
throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
}
if (paramInvoker.getUrl() == null) {
throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");
}
URL localURL = paramInvoker.getUrl();
String str = localURL.getParameter("proxy", "javassist");
if (str == null) {
throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + localURL.toString() + ") use keys([proxy])");
}
ProxyFactory localProxyFactory = (ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(str);
return localProxyFactory.getProxy(paramInvoker);
}
public Object getProxy(Invoker paramInvoker, boolean paramBoolean)
throws RpcException
{
if (paramInvoker == null) {
throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
}
if (paramInvoker.getUrl() == null) {
throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");
}
URL localURL = paramInvoker.getUrl();
String str = localURL.getParameter("proxy", "javassist");
if (str == null) {
throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + localURL.toString() + ") use keys([proxy])");
}
ProxyFactory localProxyFactory = (ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(str);
return localProxyFactory.getProxy(paramInvoker, paramBoolean);
}
public Invoker getInvoker(Object paramObject, Class paramClass, URL paramURL)
throws RpcException
{
if (paramURL == null) {
throw new IllegalArgumentException("url == null");
}
URL localURL = paramURL;
String str = localURL.getParameter("proxy", "javassist");
if (str == null) {
throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + localURL.toString() + ") use keys([proxy])");
}
ProxyFactory localProxyFactory = (ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(str);
return localProxyFactory.getInvoker(paramObject, paramClass, paramURL);
}
}
来源:oschina
链接:https://my.oschina.net/u/2937247/blog/3147364