publicstatic <T> ExtensionLoader<T> getExtensionLoader(Class<T> type){ if (type == null) thrownew IllegalArgumentException("Extension type == null"); //判断是否是接口 if (!type.isInterface()) { thrownew IllegalArgumentException("Extension type(" + type + ") is not interface!"); } //判断是否有SPI注解 if (!withExtensionAnnotation(type)) { thrownew IllegalArgumentException("Extension type(" + type + ") is not extension, because WITHOUT @" + SPI.class.getSimpleName() + " Annotation!"); }
publicclassProtocol$Adaptiveimplementscom.alibaba.dubbo.rpc.Protocol{ publicvoiddestroy(){ thrownew UnsupportedOperationException( "method public abstract void com.alibaba.dubbo.rpc.Protocol.destroy() of interface com.alibaba.dubbo.rpc.Protocol is not adaptive method!"); }
publicintgetDefaultPort(){ thrownew UnsupportedOperationException( "method public abstract int com.alibaba.dubbo.rpc.Protocol.getDefaultPort() of interface com.alibaba.dubbo.rpc.Protocol is not adaptive method!"); }
public com.alibaba.dubbo.rpc.Exporter export( com.alibaba.dubbo.rpc.Invoker arg0) throws com.alibaba.dubbo.rpc.RpcException { if (arg0 == null) { thrownew IllegalArgumentException( "com.alibaba.dubbo.rpc.Invoker argument == null"); }
if (extName == null) { thrownew IllegalStateException( "Fail to get extension(com.alibaba.dubbo.rpc.Protocol) name from url(" + url.toString() + ") use keys([protocol])"); }
if (extName == null) { thrownew IllegalStateException( "Fail to get extension(com.alibaba.dubbo.rpc.Protocol) name from url(" + url.toString() + ") use keys([protocol])"); }