ri.addAttribute(SESSION_ID_KEY, sessionId); ri.addAttribute(HOST_KEY, host);
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation = new RemoteInvocation(methodInvocation); invocation.addAttribute("myKey", "myValue"); try { invocation.addAttribute("myKey", "myValue"); fail("Should have thrown IllegalStateException"); } catch (IllegalStateException ex) { // expected: already defined } assertNotNull(invocation.getAttributes()); assertEquals(1, invocation.getAttributes().size()); assertEquals("myValue", invocation.getAttributes().get("myKey")); assertEquals("myValue", invocation.getAttribute("myKey")); return invocation; } });
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation; /* package was renamed to 'org.apache.dubbo' in v2.7.0, so only provider versions after v2.7.0 can recognize org.apache.xxx.HttpRemoteInvocation'. */ if (Version.isRelease270OrHigher(url.getParameter(Constants.RELEASE_KEY))) { invocation = new HttpRemoteInvocation(methodInvocation); } else { /* The customized 'com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation' was firstly introduced in v2.6.3. The main purpose is to support transformation of attachments in HttpProtocol, see https://github.com/apache/incubator-dubbo/pull/1827. To guarantee interoperability with lower versions, we need to check if the provider is v2.6.3 or higher before sending customized HttpRemoteInvocation. */ if (Version.isRelease263OrHigher(url.getParameter(Constants.DUBBO_VERSION_KEY))) { invocation = new com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation(methodInvocation); } else { invocation = new RemoteInvocation(methodInvocation); } } if (isGeneric) { invocation.addAttribute(Constants.GENERIC_KEY, generic); } return invocation; } });
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation; /* package was renamed to 'org.apache.dubbo' in v2.7.0, so only provider versions after v2.7.0 can recognize org.apache.xxx.HttpRemoteInvocation'. */ if (Version.isRelease270OrHigher(url.getParameter(Constants.RELEASE_KEY))) { invocation = new HttpRemoteInvocation(methodInvocation); } else { /* The customized 'com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation' was firstly introduced in v2.6.3. The main purpose is to support transformation of attachments in HttpProtocol, see https://github.com/apache/incubator-dubbo/pull/1827. To guarantee interoperability with lower versions, we need to check if the provider is v2.6.3 or higher before sending customized HttpRemoteInvocation. */ if (Version.isRelease263OrHigher(url.getParameter(Constants.DUBBO_VERSION_KEY))) { invocation = new com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation(methodInvocation); } else { invocation = new RemoteInvocation(methodInvocation); } } if (isGeneric) { invocation.addAttribute(Constants.GENERIC_KEY, generic); } return invocation; } });
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation = new HttpRemoteInvocation(methodInvocation); if (isGeneric) { invocation.addAttribute(Constants.GENERIC_KEY, generic); } return invocation; } });
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation = new HttpRemoteInvocation(methodInvocation); if (isGeneric) { invocation.addAttribute(Constants.GENERIC_KEY, generic); } return invocation; } });
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation retval = super.createRemoteInvocation(methodInvocation); // Add the interface that is being used to access this service as an invocation attibute retval.addAttribute(ATTRIBUTE_INTERFACE_NAME, this.getServiceInterface().getName()); return retval; } }
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation ri = super.createRemoteInvocation(methodInvocation); ri.addAttribute("callContext", CallContextUtil.getContext()); return ri; }
ri.addAttribute(SESSION_ID_KEY, sessionId); ri.addAttribute(HOST_KEY, host);
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation; /* package was renamed to 'org.apache.dubbo' in v2.7.0, so only provider versions after v2.7.0 can recognize org.apache.xxx.HttpRemoteInvocation'. */ if (Version.isRelease270OrHigher(url.getParameter(Constants.RELEASE_KEY))) { invocation = new HttpRemoteInvocation(methodInvocation); } else { /* The customized 'com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation' was firstly introduced in v2.6.3. The main purpose is to support transformation of attachments in HttpProtocol, see https://github.com/apache/incubator-dubbo/pull/1827. To guarantee interoperability with lower versions, we need to check if the provider is v2.6.3 or higher before sending customized HttpRemoteInvocation. */ if (Version.isRelease263OrHigher(url.getParameter(Constants.DUBBO_VERSION_KEY))) { invocation = new com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation(methodInvocation); } else { invocation = new RemoteInvocation(methodInvocation); } } if (isGeneric) { invocation.addAttribute(Constants.GENERIC_KEY, generic); } return invocation; } });
@Override public RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation) { RemoteInvocation invocation; /* package was renamed to 'org.apache.dubbo' in v2.7.0, so only provider versions after v2.7.0 can recognize org.apache.xxx.HttpRemoteInvocation'. */ if (Version.isRelease270OrHigher(url.getParameter(Constants.RELEASE_KEY))) { invocation = new HttpRemoteInvocation(methodInvocation); } else { /* The customized 'com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation' was firstly introduced in v2.6.3. The main purpose is to support transformation of attachments in HttpProtocol, see https://github.com/apache/incubator-dubbo/pull/1827. To guarantee interoperability with lower versions, we need to check if the provider is v2.6.3 or higher before sending customized HttpRemoteInvocation. */ if (Version.isRelease263OrHigher(url.getParameter(Constants.DUBBO_VERSION_KEY))) { invocation = new com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation(methodInvocation); } else { invocation = new RemoteInvocation(methodInvocation); } } if (isGeneric) { invocation.addAttribute(Constants.GENERIC_KEY, generic); } return invocation; } });