finishRequest(Reference @ref, List <Reference> wellKnownRefs, Ice.ObjectPrx proxy, bool notRegistered) { Ice.ObjectPrxHelperBase @base = proxy as Ice.ObjectPrxHelperBase; if (proxy == null || @base.iceReference().isIndirect()) { // // Remove the cached references of well-known objects for which we tried // to resolved the endpoints if these endpoints are empty. // foreach (Reference r in wellKnownRefs) { _table.removeObjectReference(r.getIdentity()); } } if ([email protected]()) { if (proxy != null && [email protected]().isIndirect()) { // Cache the adapter endpoints. _table.addAdapterEndpoints(@ref.getAdapterId(), @base.iceReference().getEndpoints()); } else if (notRegistered) // If the adapter isn't registered anymore, remove it from the cache. { _table.removeAdapterEndpoints(@ref.getAdapterId()); } lock (this) { Debug.Assert(_adapterRequests.ContainsKey(@ref.getAdapterId())); _adapterRequests.Remove(@ref.getAdapterId()); } } else { if (proxy != null && [email protected]().isWellKnown()) { // Cache the well-known object reference. _table.addObjectReference(@ref.getIdentity(), @base.iceReference()); } else if (notRegistered) // If the well-known object isn't registered anymore, remove it from the cache. { _table.removeObjectReference(@ref.getIdentity()); } lock (this) { Debug.Assert(_objectRequests.ContainsKey(@ref.getIdentity())); _objectRequests.Remove(@ref.getIdentity()); } } }
protected ProxyOutgoingAsyncBase(Ice.ObjectPrxHelperBase prx, OutgoingAsyncCompletionCallback completionCallback, Ice.OutputStream os = null, Ice.InputStream iss = null) : base(prx.iceReference().getInstance(), completionCallback, os, iss) { proxy_ = prx; mode_ = Ice.OperationMode.Normal; _cnt = 0; _sent = false; }
public Dictionary <string, string> proxyToProperty(Ice.ObjectPrx proxy, string prefix) { if (proxy != null) { Ice.ObjectPrxHelperBase h = (Ice.ObjectPrxHelperBase)proxy; return(h.iceReference().toProperty(prefix)); } else { return(new Dictionary <string, string>()); } }
public string proxyToString(Ice.ObjectPrx proxy) { if (proxy != null) { Ice.ObjectPrxHelperBase h = (Ice.ObjectPrxHelperBase)proxy; return(h.iceReference().ToString()); } else { return(""); } }
private static void writeValue(string name, object val, Dictionary <Ice.Object, object> objectTable, OutputBase output) { if (val == null) { writeName(name, output); output.print("(null)"); } else { System.Type c = val.GetType(); if (c.Equals(typeof(byte)) || c.Equals(typeof(short)) || c.Equals(typeof(int)) || c.Equals(typeof(long)) || c.Equals(typeof(double)) || c.Equals(typeof(float)) || c.Equals(typeof(bool))) { writeName(name, output); output.print(val.ToString()); } else if (c.Equals(typeof(string))) { writeName(name, output); output.print("\""); output.print(val.ToString()); output.print("\""); } else if (val is IList) { int n = 0; IEnumerator i = ((IList)val).GetEnumerator(); while (i.MoveNext()) { string elem = (name != null ? name : ""); elem += "[" + n++ + "]"; writeValue(elem, i.Current, objectTable, output); } } else if (val is IDictionary) { foreach (DictionaryEntry entry in (IDictionary)val) { string elem = name != null ? name + "." : ""; writeValue(elem + "key", entry.Key, objectTable, output); writeValue(elem + "value", entry.Value, objectTable, output); } } else if (val is Ice.ObjectPrxHelperBase) { writeName(name, output); Ice.ObjectPrxHelperBase proxy = (Ice.ObjectPrxHelperBase)val; output.print(proxy.iceReference().ToString()); } else if (val is Ice.Object) { // // Check for recursion. // if (objectTable != null && objectTable.ContainsKey((Ice.Object)val)) { writeName(name, output); output.print("(recursive)"); } else { if (objectTable == null) { objectTable = new Dictionary <Ice.Object, object>(); } objectTable[(Ice.Object)val] = null; writeFields(name, val, c, objectTable, output); } } else if (c.IsEnum) { writeName(name, output); output.print(val.ToString()); } else { // // Must be struct. // writeFields(name, val, c, objectTable, output); } } }