forked from apache/dubbo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix compatible with zipkin. apache#3728
- Loading branch information
Showing
6 changed files
with
179 additions
and
4 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/exchange/ResponseCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.dubbo.remoting.exchange; | ||
|
||
/** | ||
* 2019-04-18 | ||
*/ | ||
@Deprecated | ||
public interface ResponseCallback extends org.apache.dubbo.remoting.exchange.ResponseCallback { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/FutureAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.dubbo.rpc.protocol.dubbo; | ||
|
||
import org.apache.dubbo.remoting.exchange.ResponseFuture; | ||
|
||
/** | ||
* 2019-04-18 | ||
*/ | ||
public class FutureAdapter<V> extends org.apache.dubbo.rpc.protocol.dubbo.FutureAdapter<V> { | ||
public FutureAdapter(ResponseFuture future) { | ||
super(future); | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/support/RpcUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.alibaba.dubbo.rpc.support; | ||
|
||
import com.alibaba.dubbo.common.URL; | ||
import com.alibaba.dubbo.rpc.Invocation; | ||
|
||
import java.lang.reflect.Method; | ||
import java.lang.reflect.Type; | ||
import java.util.Map; | ||
|
||
/** | ||
* 2019-04-18 | ||
*/ | ||
public class RpcUtils extends org.apache.dubbo.rpc.support.RpcUtils { | ||
|
||
|
||
public static Class<?> getReturnType(Invocation invocation) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.getReturnType(invocation); | ||
} | ||
|
||
// TODO why not get return type when initialize Invocation? | ||
public static Type[] getReturnTypes(Invocation invocation) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.getReturnTypes(invocation); | ||
} | ||
|
||
public static Long getInvocationId(Invocation inv) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.getInvocationId(inv); | ||
} | ||
|
||
/** | ||
* Idempotent operation: invocation id will be added in async operation by default | ||
* | ||
* @param url | ||
* @param inv | ||
*/ | ||
public static void attachInvocationIdIfAsync(URL url, Invocation inv) { | ||
org.apache.dubbo.rpc.support.RpcUtils.attachInvocationIdIfAsync(url.getOriginalURL(), inv); | ||
} | ||
|
||
|
||
public static String getMethodName(Invocation invocation) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.getMethodName(invocation); | ||
} | ||
|
||
public static Object[] getArguments(Invocation invocation) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.getArguments(invocation); | ||
} | ||
|
||
public static Class<?>[] getParameterTypes(Invocation invocation) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.getParameterTypes(invocation); | ||
} | ||
|
||
public static boolean isAsync(URL url, Invocation inv) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.isAsync(url.getOriginalURL(), inv); | ||
} | ||
|
||
public static boolean isReturnTypeFuture(Invocation inv) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.isReturnTypeFuture(inv); | ||
} | ||
|
||
public static boolean hasFutureReturnType(Method method) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.hasFutureReturnType(method); | ||
} | ||
|
||
public static boolean isOneway(URL url, Invocation inv) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.isOneway(url.getOriginalURL(), inv); | ||
} | ||
|
||
public static Map<String, String> getNecessaryAttachments(Invocation inv) { | ||
return org.apache.dubbo.rpc.support.RpcUtils.getNecessaryAttachments(inv); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters