Пример #1
0
 setReplicatedAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setReplicatedAdapterDirectProxy cb,
                                       string adapterId,
                                       string replicaGroupId,
                                       Ice.ObjectPrx proxy,
                                       Ice.Current current)
 {
     lock (this)
     {
         if (proxy != null)
         {
             _adapters.Add(adapterId, proxy);
             HashSet <string> adapterIds;
             if (!_replicaGroups.TryGetValue(replicaGroupId, out adapterIds))
             {
                 adapterIds = new HashSet <string>();
                 _replicaGroups.Add(replicaGroupId, adapterIds);
             }
             adapterIds.Add(adapterId);
         }
         else
         {
             _adapters.Remove(adapterId);
             HashSet <string> adapterIds;
             if (_replicaGroups.TryGetValue(replicaGroupId, out adapterIds))
             {
                 adapterIds.Remove(adapterId);
                 if (adapterIds.Count == 0)
                 {
                     _replicaGroups.Remove(replicaGroupId);
                 }
             }
         }
     }
     cb.ice_response();
 }
Пример #2
0
 public override void setReplicatedAdapterDirectProxy_async(
     Ice.AMD_LocatorRegistry_setReplicatedAdapterDirectProxy cb,
     string adapter, string replica, Ice.ObjectPrx obj, Ice.Current current)
 {
     if (obj != null)
     {
         _adapters[adapter] = obj;
         _adapters[replica] = obj;
     }
     else
     {
         _adapters.Remove(adapter);
         _adapters.Remove(replica);
     }
     cb.ice_response();
 }