diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java index 34d56a8e743..57abfb30656 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java @@ -17,6 +17,20 @@ package com.alibaba.dubbo.rpc; +import com.alibaba.dubbo.common.URL; + @Deprecated public interface Protocol extends org.apache.dubbo.rpc.Protocol { + + Exporter export(Invoker invoker) throws RpcException; + + Invoker refer(Class aClass, URL url) throws RpcException; + + default org.apache.dubbo.rpc.Exporter export(org.apache.dubbo.rpc.Invoker invoker) throws RpcException { + return this.export(new Invoker.CompatibleInvoker<>(invoker)); + } + + default org.apache.dubbo.rpc.Invoker refer(Class aClass, org.apache.dubbo.common.URL url) throws RpcException { + return this.refer(aClass, new URL(url)); + } }