publicclassProtocol$AdaptiveimplementsProtocol{publicvoiddestroy(){thrownewUnsupportedOperationException("The method public abstract void org.apache.dubbo.rpc.Protocol.destroy() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!");}publicintgetDefaultPort(){thrownewUnsupportedOperationException("The method public abstract int org.apache.dubbo.rpc.Protocol.getDefaultPort() of interface org.apache.dubbo.rpc.Protocol is not adaptive method!");}publicExporterexport(Invoker arg0)throwsorg.apache.dubbo.rpc.RpcException{if(arg0 ==null)thrownewIllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null");if(arg0.getUrl()==null)thrownewIllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null");URL url = arg0.getUrl();String extName =(url.getProtocol()==null?"dubbo": url.getProtocol());if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.rpc.Protocol) name from url ("+ url.toString()+") use keys([protocol])");Protocol extension =(Protocol)ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(extName);return extension.export(arg0);}publicorg.apache.dubbo.rpc.Invokerrefer(java.lang.Class arg0,org.apache.dubbo.common.URL arg1)throwsorg.apache.dubbo.rpc.RpcException{if(arg1 ==null)thrownewIllegalArgumentException("url == null");URL url = arg1;String extName =(url.getProtocol()==null?"dubbo": url.getProtocol());if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.rpc.Protocol) name from url ("+ url.toString()+") use keys([protocol])");Protocol extension =(Protocol)ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(extName);return extension.refer(arg0, arg1);}}
Cluster$Adaptive
publicclassCluster$AdaptiveimplementsCluster{publicInvokerjoin(Directory arg0)throwsRpcException{if(arg0 ==null)thrownewIllegalArgumentException("org.apache.dubbo.rpc.cluster.Directory argument == null");if(arg0.getUrl()==null)thrownewIllegalArgumentException("org.apache.dubbo.rpc.cluster.Directory argument getUrl() == null");URL url = arg0.getUrl();String extName = url.getParameter("cluster","failover");if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.Cluster) name from url ("+ url.toString()+") use keys([cluster])");Cluster extension =(Cluster)ExtensionLoader.getExtensionLoader(Cluster.class).getExtension(extName);return extension.join(arg0);}}
ProxyFactory$Adaptive
publicclassProxyFactory$AdaptiveimplementsProxyFactory{publicObjectgetProxy(Invoker arg0)throwsRpcException{if(arg0 ==null)thrownewIllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null");if(arg0.getUrl()==null)thrownewIllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null");URL url = arg0.getUrl();String extName = url.getParameter("proxy","javassist");if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url ("+ url.toString()+") use keys([proxy])");ProxyFactory extension =(ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(extName);return extension.getProxy(arg0);}publicObjectgetProxy(Invoker arg0,boolean arg1)throwsRpcException{if(arg0 ==null)thrownewIllegalArgumentException("org.apache.dubbo.rpc.Invoker argument == null");if(arg0.getUrl()==null)thrownewIllegalArgumentException("org.apache.dubbo.rpc.Invoker argument getUrl() == null");URL url = arg0.getUrl();String extName = url.getParameter("proxy","javassist");if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url ("+ url.toString()+") use keys([proxy])");ProxyFactory extension =(ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(extName);return extension.getProxy(arg0, arg1);}publicInvokergetInvoker(Object arg0,java.lang.Class arg1,URL arg2)throwsorg.apache.dubbo.rpc.RpcException{if(arg2 ==null)thrownewIllegalArgumentException("url == null");URL url = arg2;String extName = url.getParameter("proxy","javassist");if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.rpc.ProxyFactory) name from url ("+ url.toString()+") use keys([proxy])");ProxyFactory extension =(ProxyFactory)ExtensionLoader.getExtensionLoader(ProxyFactory.class).getExtension(extName);return extension.getInvoker(arg0, arg1, arg2);}}
ZookeeperTransporter$Adaptive
publicclassZookeeperTransporter$AdaptiveimplementsZookeeperTransporter{publicZookeeperClientconnect(URL arg0){if(arg0 ==null)thrownewIllegalArgumentException("url == null");URL url = arg0;String extName = url.getParameter("client", url.getParameter("transporter","curator"));if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.remoting.zookeeper.ZookeeperTransporter) name from url ("+ url.toString()+") use keys([client, transporter])");ZookeeperTransporter extension =(ZookeeperTransporter)ExtensionLoader.getExtensionLoader(ZookeeperTransporter.class).getExtension(extName);return extension.connect(arg0);}}
RegistryFactory$Adaptive
publicclassRegistryFactory$AdaptiveimplementsRegistryFactory{publicRegistrygetRegistry(URL arg0){if(arg0 ==null)thrownewIllegalArgumentException("url == null");URL url = arg0;String extName =(url.getProtocol()==null?"dubbo": url.getProtocol());if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.registry.RegistryFactory) name from url ("+ url.toString()+") use keys([protocol])");RegistryFactory extension =(RegistryFactory)ExtensionLoader.getExtensionLoader(RegistryFactory.class).getExtension(extName);return extension.getRegistry(arg0);}}
RouterFactory$Adaptive
importorg.apache.dubbo.common.URL;importorg.apache.dubbo.common.extension.ExtensionLoader;importorg.apache.dubbo.rpc.cluster.Router;importorg.apache.dubbo.rpc.cluster.RouterFactory;publicclassRouterFactory$Adaptiveimplementsorg.apache.dubbo.rpc.cluster.RouterFactory{publicRoutergetRouter(URL arg0){if(arg0 ==null)thrownewIllegalArgumentException("url == null");org.apache.dubbo.common.URL url = arg0;String extName = url.getProtocol();if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.RouterFactory) name from url ("+ url.toString()+") use keys([protocol])");RouterFactory extension =(RouterFactory)ExtensionLoader.getExtensionLoader(RouterFactory.class).getExtension(extName);return extension.getRouter(arg0);}}
ConfiguratorFactory$Adaptive
importorg.apache.dubbo.common.URL;importorg.apache.dubbo.common.extension.ExtensionLoader;importorg.apache.dubbo.rpc.cluster.Configurator;importorg.apache.dubbo.rpc.cluster.ConfiguratorFactory;publicclassConfiguratorFactory$AdaptiveimplementsConfiguratorFactory{publicConfiguratorgetConfigurator(URL arg0){if(arg0 ==null)thrownewIllegalArgumentException("url == null");URL url = arg0;String extName = url.getProtocol();if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.rpc.cluster.ConfiguratorFactory) name from url ("+ url.toString()+") use keys([protocol])");ConfiguratorFactory extension =ExtensionLoader.getExtensionLoader(ConfiguratorFactory.class).getExtension(extName);return extension.getConfigurator(arg0);}}
Transporter$Adaptive
importorg.apache.dubbo.common.URL;importorg.apache.dubbo.common.extension.ExtensionLoader;importorg.apache.dubbo.remoting.ChannelHandler;importorg.apache.dubbo.remoting.Client;importorg.apache.dubbo.remoting.RemotingException;importorg.apache.dubbo.remoting.Server;importorg.apache.dubbo.remoting.Transporter;publicclassTransporter$AdaptiveimplementsTransporter{publicClientconnect(URL arg0,ChannelHandler arg1)throwsRemotingException{if(arg0 ==null)thrownewIllegalArgumentException("url == null");URL url = arg0;String extName = url.getParameter("client", url.getParameter("transporter","netty"));if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Transporter) name from url ("+ url.toString()+") use keys([client, transporter])");Transporter extension =ExtensionLoader.getExtensionLoader(Transporter.class).getExtension(extName);return extension.connect(arg0, arg1);}publicServerbind(URL arg0,ChannelHandler arg1)throwsRemotingException{if(arg0 ==null)thrownewIllegalArgumentException("url == null");URL url = arg0;String extName = url.getParameter("server", url.getParameter("transporter","netty"));if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Transporter) name from url ("+ url.toString()+") use keys([server, transporter])");Transporter extension =(Transporter)ExtensionLoader.getExtensionLoader(Transporter.class).getExtension(extName);return extension.bind(arg0, arg1);}}
Dispatcher$Adaptive
publicclassDispatcher$AdaptiveimplementsDispatcher{publicChannelHandlerdispatch(ChannelHandler arg0,URL arg1){if(arg1 ==null)thrownewIllegalArgumentException("url == null");URL url = arg1;String extName = url.getParameter("dispatcher", url.getParameter("dispather", url.getParameter("channel.handler","all")));if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.remoting.Dispatcher) name from url ("+ url.toString()+") use keys([dispatcher, dispather, channel.handler])");Dispatcher extension =(Dispatcher)ExtensionLoader.getExtensionLoader(Dispatcher.class).getExtension(extName);return extension.dispatch(arg0, arg1);}}
ThreadPool$Adaptive
publicclassThreadPool$AdaptiveimplementsThreadPool{publicExecutorgetExecutor(URL arg0){if(arg0 ==null)thrownewIllegalArgumentException("url == null");URL url = arg0;String extName = url.getParameter("threadpool","fixed");if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.common.threadpool.ThreadPool) name from url ("+ url.toString()+") use keys([threadpool])");ThreadPool extension =(ThreadPool)ExtensionLoader.getExtensionLoader(ThreadPool.class).getExtension(extName);return extension.getExecutor(arg0);}}
MonitorFactory$Adaptive
publicclassMonitorFactory$AdaptiveimplementsMonitorFactory{publicMonitorgetMonitor(URL arg0){if(arg0 ==null)thrownewIllegalArgumentException("url == null");URL url = arg0;String extName =(url.getProtocol()==null?"dubbo": url.getProtocol());if(extName ==null)thrownewIllegalStateException("Failed to get extension (org.apache.dubbo.monitor.MonitorFactory) name from url ("+ url.toString()+") use keys([protocol])");MonitorFactory extension =(MonitorFactory)ExtensionLoader.getExtensionLoader(MonitorFactory.class).getExtension(extName);return extension.getMonitor(arg0);}}
SPI常用动态自适应代理类源码Protocol$Adaptivepublic class Protocol$Adaptive implements Protocol { public void destroy() { throw new UnsupportedOperationException("The method public abstract void org.apache.dubbo.rpc.Protocol.destroy() of interface org.ap