Skip to content

Commit

Permalink
Protocol compatibility (#3254)
Browse files Browse the repository at this point in the history
add default method into Protocol .
  • Loading branch information
chickenlj authored and cvictory committed Jan 16, 2019
1 parent e24e568 commit a8e1d26
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Protocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

<T> Exporter<T> export(Invoker <T> invoker) throws RpcException;

<T> Invoker<T> refer(Class<T> aClass, URL url) throws RpcException;

default <T> org.apache.dubbo.rpc.Exporter<T> export(org.apache.dubbo.rpc.Invoker<T> invoker) throws RpcException {
return this.export(new Invoker.CompatibleInvoker<>(invoker));
}

default <T> org.apache.dubbo.rpc.Invoker<T> refer(Class<T> aClass, org.apache.dubbo.common.URL url) throws RpcException {
return this.refer(aClass, new URL(url));
}
}

0 comments on commit a8e1d26

Please sign in to comment.