private IInvoker GetInvoker(IChannel channel, IInvocation inv) { var isCallBackServiceInvoke = false; var isStubServiceInvoke = false; var port = channel.Url.Port;//todo url.localaddress var path = inv.GetAttachment(Constants.PathKey); isStubServiceInvoke = "true".Equals(inv.GetAttachment(Constants.StubEventKey), StringComparison.OrdinalIgnoreCase); if (isStubServiceInvoke) { port = channel.Url.Port; } isCallBackServiceInvoke = IsClientSide(channel) && !isStubServiceInvoke; if (isCallBackServiceInvoke) { path = path + "." + inv.GetAttachment(Constants.CallbackServiceKey); inv.Attachments.Add(IsCallbackServiceInvoke, "true"); } var serviceKey = ServiceKey(port, path, inv.GetAttachment(Constants.VersionKey), inv.GetAttachment(Constants.GroupKey)); Exporters.TryGetValue(serviceKey, out var exporter); return(exporter?.GetInvoker()); }
public static long GetInvocationId(IInvocation inv) { var id = inv.GetAttachment(Constants.IdKey); long.TryParse(id, out long result); return(result); }
public static bool IsOneway(URL url, IInvocation inv) { bool isOneway; if ("false".Equals(inv.GetAttachment(Constants.ReturnKey))) { isOneway = true; } else { isOneway = !url.GetMethodParameter(GetMethodName(inv), Constants.ReturnKey, true); } return(isOneway); }
public static bool IsAsync(URL url, IInvocation inv) { bool isAsync; if ("true".Equals(inv.GetAttachment(Constants.AsyncKey))) { isAsync = true; } else { isAsync = url.GetMethodParameter(GetMethodName(inv), Constants.AsyncKey, false); } return(isAsync); }