internal static void Cleanup() { var tips = RemotableAttribute.GetTips(); foreach (var tip in tips) { var methodName = RemoteServiceName.GetObject(tip.RemoteType); RPCServer.Close(methodName); } //取消订阅 CancelEvents(); }
public static DTObject GetObject(AggregateRootDefine define, object id) { var remoteType = define.RemoteType; var methodName = RemoteServiceName.GetObject(remoteType); return(RPCClient.Invoke(methodName, (arg) => { arg["id"] = id; arg["typeName"] = remoteType.FullName; arg["schemaCode"] = define.MetadataSchemaCode; arg["identity"] = AppContext.Identity; //没有直接使用session的身份是因为有可能服务点只为一个项目(一个身份)而架设 })); }
internal static void Initialize() { //开启获取远程对象的RPC服务 var tips = RemotableAttribute.GetTips(); foreach (var tip in tips) { var methodName = RemoteServiceName.GetObject(tip.RemoteType); RPCServer.Open(methodName, GetRemoteObject.Instance); } //订阅事件 SubscribeEvents(); }