From 8d700ad1e4d35e1c8f2c21ea9fc6ca2d89783a73 Mon Sep 17 00:00:00 2001 From: "ken.lj" Date: Wed, 16 Jan 2019 19:10:10 +0800 Subject: [PATCH] Protocol compatibility --- .../main/java/com/alibaba/dubbo/rpc/Protocol.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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)); + } }