This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 5a00ef4  InJvmInvoker copied RpcInvoker add targetServiceUniqueName 
(#9247)
5a00ef4 is described below

commit 5a00ef4647472a818d1ef602c512a63fe9a532f6
Author: 吴治国 <[email protected]>
AuthorDate: Wed Nov 10 12:43:43 2021 +0800

    InJvmInvoker copied RpcInvoker add targetServiceUniqueName (#9247)
---
 .../java/org/apache/dubbo/rpc/RpcInvocation.java     | 20 +++++++++++++-------
 .../dubbo/rpc/protocol/injvm/InjvmInvoker.java       |  6 ++++--
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcInvocation.java 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcInvocation.java
index 1b7b412..62c83f4 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcInvocation.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcInvocation.java
@@ -135,40 +135,46 @@ public class RpcInvocation implements Invocation, 
Serializable {
     }
 
     public RpcInvocation(ServiceModel serviceModel, Method method, String 
serviceName, String protocolServiceKey, Object[] arguments, Map<String, Object> 
attachment, Map<Object, Object> attributes) {
-        this(serviceModel, method.getName(), serviceName, protocolServiceKey, 
method.getParameterTypes(), arguments, attachment, null, attributes);
+        this(null, serviceModel, method.getName(), serviceName, 
protocolServiceKey, method.getParameterTypes(), arguments, attachment, null, 
attributes);
     }
 
     @Deprecated
     public RpcInvocation(Method method, String serviceName, String 
protocolServiceKey, Object[] arguments, Map<String, Object> attachment, 
Map<Object, Object> attributes) {
-        this(null, method.getName(), serviceName, protocolServiceKey, 
method.getParameterTypes(), arguments, attachment, null, attributes);
+        this(null, null, method.getName(), serviceName, protocolServiceKey, 
method.getParameterTypes(), arguments, attachment, null, attributes);
     }
 
     public RpcInvocation(ServiceModel serviceModel, String methodName, String 
serviceName, String protocolServiceKey, Class<?>[] parameterTypes, Object[] 
arguments) {
-        this(serviceModel, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, null, null, null);
+        this(null, serviceModel, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, null, null, null);
     }
 
     @Deprecated
     public RpcInvocation(String methodName, String serviceName, String 
protocolServiceKey, Class<?>[] parameterTypes, Object[] arguments) {
-        this(null, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, null, null, null);
+        this(null, null, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, null, null, null);
     }
 
     public RpcInvocation(ServiceModel serviceModel, String methodName, String 
serviceName, String protocolServiceKey, Class<?>[] parameterTypes, Object[] 
arguments, Map<String, Object> attachments) {
-        this(serviceModel, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, attachments, null, null);
+        this(null, serviceModel, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, attachments, null, null);
     }
 
     @Deprecated
     public RpcInvocation(String methodName, String serviceName, String 
protocolServiceKey, Class<?>[] parameterTypes, Object[] arguments, Map<String, 
Object> attachments) {
-        this(null, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, attachments, null, null);
+        this(null, null, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, attachments, null, null);
     }
 
     @Deprecated
     public RpcInvocation(String methodName, String serviceName, String 
protocolServiceKey, Class<?>[] parameterTypes, Object[] arguments,
                          Map<String, Object> attachments, Invoker<?> invoker, 
Map<Object, Object> attributes) {
-        this(null, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, attachments, invoker, attributes);
+        this(null, null, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, attachments, invoker, attributes);
     }
 
     public RpcInvocation(ServiceModel serviceModel, String methodName, String 
serviceName, String protocolServiceKey, Class<?>[] parameterTypes, Object[] 
arguments,
                          Map<String, Object> attachments, Invoker<?> invoker, 
Map<Object, Object> attributes) {
+        this(null, serviceModel, methodName, serviceName, protocolServiceKey, 
parameterTypes, arguments, attachments, invoker, attributes);
+    }
+
+    public RpcInvocation(String targetServiceUniqueName, ServiceModel 
serviceModel, String methodName, String serviceName, String protocolServiceKey, 
Class<?>[] parameterTypes, Object[] arguments,
+                         Map<String, Object> attachments, Invoker<?> invoker, 
Map<Object, Object> attributes) {
+        this.targetServiceUniqueName = targetServiceUniqueName;
         this.serviceModel = serviceModel;
         this.methodName = methodName;
         this.serviceName = serviceName;
diff --git 
a/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmInvoker.java
 
b/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmInvoker.java
index 43fbd97..4b20d26 100644
--- 
a/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmInvoker.java
+++ 
b/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmInvoker.java
@@ -149,7 +149,8 @@ public class InjvmInvoker<T> extends AbstractInvoker<T> {
         String methodName = invocation.getMethodName();
         if(CommonConstants.$INVOKE.equals(methodName)) {
             // generic invoke, skip copy arguments
-            RpcInvocation copiedInvocation = new 
RpcInvocation(providerServiceModel, methodName, invocation.getServiceName(), 
invocation.getProtocolServiceKey(),
+            RpcInvocation copiedInvocation = new 
RpcInvocation(invocation.getTargetServiceUniqueName(),
+                providerServiceModel, methodName, invocation.getServiceName(), 
invocation.getProtocolServiceKey(),
                 invocation.getParameterTypes(), invocation.getArguments(), new 
HashMap<>(invocation.getObjectAttachments()),
                 invocation.getInvoker(), invocation.getAttributes());
             copiedInvocation.setInvoker(invoker);
@@ -177,7 +178,8 @@ public class InjvmInvoker<T> extends AbstractInvoker<T> {
                     realArgument = args;
                 }
 
-                RpcInvocation copiedInvocation = new 
RpcInvocation(providerServiceModel, methodName, invocation.getServiceName(), 
invocation.getProtocolServiceKey(),
+                RpcInvocation copiedInvocation = new 
RpcInvocation(invocation.getTargetServiceUniqueName(),
+                    providerServiceModel, methodName, 
invocation.getServiceName(), invocation.getProtocolServiceKey(),
                     pts, realArgument, new 
HashMap<>(invocation.getObjectAttachments()),
                     invocation.getInvoker(), invocation.getAttributes());
                 copiedInvocation.setInvoker(invoker);

Reply via email to