public ICollection <IDistributedObject> GetDistributedObjects()
 {
     try
     {
         var request  = ClientGetDistributedObjectsCodec.EncodeRequest();
         var task     = _invocationService.InvokeOnRandomTarget(request);
         var response = ThreadUtil.GetResult(task);
         var result   = ClientGetDistributedObjectsCodec.DecodeResponse(response).response;
         foreach (var data in result)
         {
             var o = _serializationService.ToObject <DistributedObjectInfo>(data);
             GetDistributedObject <IDistributedObject>(o.GetServiceName(), o.GetName());
         }
         return(_proxyManager.GetDistributedObjects());
     }
     catch (Exception e)
     {
         throw ExceptionUtil.Rethrow(e);
     }
 }
Example #2
0
        public ICollection <IDistributedObject> GetDistributedObjects()
        {
            try
            {
                var request  = ClientGetDistributedObjectsCodec.EncodeRequest();
                var task     = _client.GetInvocationService().InvokeOnRandomTarget(request);
                var response = ThreadUtil.GetResult(task);
                var result   = ClientGetDistributedObjectsCodec.DecodeResponse(response).response;
                foreach (var distributedObjectInfo in result)
                {
                    var proxy = InitProxyLocal(distributedObjectInfo.ServiceName, distributedObjectInfo.ObjectName,
                                               typeof(IDistributedObject));
                    _proxies.TryAdd(distributedObjectInfo, proxy);
                }

                return(GetLocalDistributedObjects());
            }
            catch (Exception e)
            {
                throw ExceptionUtil.Rethrow(e);
            }
        }