Skip to content

Commit a8e1d26

Browse files
chickenljcvictory
authored andcommitted
Protocol compatibility (#3254)
add default method into Protocol .
1 parent e24e568 commit a8e1d26

File tree

1 file changed

+14
-0
lines changed
  • dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc

1 file changed

+14
-0
lines changed

dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@
1717

1818
package com.alibaba.dubbo.rpc;
1919

20+
import com.alibaba.dubbo.common.URL;
21+
2022
@Deprecated
2123
public interface Protocol extends org.apache.dubbo.rpc.Protocol {
24+
25+
<T> Exporter<T> export(Invoker <T> invoker) throws RpcException;
26+
27+
<T> Invoker<T> refer(Class<T> aClass, URL url) throws RpcException;
28+
29+
default <T> org.apache.dubbo.rpc.Exporter<T> export(org.apache.dubbo.rpc.Invoker<T> invoker) throws RpcException {
30+
return this.export(new Invoker.CompatibleInvoker<>(invoker));
31+
}
32+
33+
default <T> org.apache.dubbo.rpc.Invoker<T> refer(Class<T> aClass, org.apache.dubbo.common.URL url) throws RpcException {
34+
return this.refer(aClass, new URL(url));
35+
}
2236
}

0 commit comments

Comments
 (0)