public void Invoke(string operation, Ice.OperationMode mode, Ice.FormatType?format, Dictionary <string, string>?context, bool synchronous, System.Action <Ice.OutputStream>?write) { Debug.Assert(Os != null); try { Prepare(operation, mode, context); if (write != null) { Os.StartEncapsulation(Encoding, format); write(Os); Os.EndEncapsulation(); } else { Os.WriteEmptyEncapsulation(Encoding); } Invoke(operation, synchronous); } catch (Ice.Exception ex) { Abort(ex); } }
public void invoke(string operation, Ice.OperationMode mode, Ice.FormatType format, Dictionary <string, string>?context, bool synchronous, System.Action <Ice.OutputStream> write) { try { prepare(operation, mode, context); if (write != null) { os_.StartEncapsulation(encoding_, format); write(os_); os_.EndEncapsulation(); } else { os_.WriteEmptyEncapsulation(encoding_); } invoke(operation, synchronous); } catch (Ice.Exception ex) { abort(ex); } }
// MessageToProtocolRequest // // Converts a IMessage representing a method call (IMethodCallMessage) // into the Ice protocol representation, and writes it to stream outStream. public static void MessageToProtocolRequest(Stream outStream, IMessage msg) { IMethodCallMessage mcall = msg as IMethodCallMessage; Ice.ProtocolWriter pw = new Ice.ProtocolWriter(outStream); // extract message bits from mcall Ice.Identity id = (Ice.Identity)mcall.LogicalCallContext.GetData("__iceIdentity"); string[] facetPath = (string[])mcall.LogicalCallContext.GetData("__iceFacetPath"); Ice.OperationMode opMode = (Ice.OperationMode)mcall.LogicalCallContext.GetData("__iceOperationMode"); Ice.Context ctx = (Ice.Context)mcall.LogicalCallContext.GetData("__iceContext"); bool oneWay = (bool)mcall.LogicalCallContext.GetData("__iceOneWay"); int thisRequestId = 0; if (!oneWay) { thisRequestId = IceChannelUtils.NextRequestId; } mcall.LogicalCallContext.SetData("__iceRequestId", thisRequestId); ParameterInfo[] paramInfos = mcall.MethodBase.GetParameters(); // Create an Ice protocol message pw.BeginMessage(Ice.MessageType.Request); pw.WriteRequestMessageHeader(thisRequestId, id, facetPath, mcall.MethodName, Ice.OperationMode.Normal, ctx); // now write the args pw.BeginEncapsulation(); for (int i = 0; i < mcall.ArgCount; i++) { if (!paramInfos[i].IsOut) { if (Attribute.GetCustomAttribute(paramInfos[i], typeof(Ice.AsProxy)) != null) { pw.WriteProxy(mcall.Args[i], paramInfos[i].ParameterType); } else { pw.WriteObject(mcall.Args[i], paramInfos[i].ParameterType); } } } pw.WriteClassInstances(); pw.EndEncapsulation(); pw.EndMessage(); }
public Request(LocatorI locator, string operation, Ice.OperationMode mode, byte[] inParams, Dictionary <string, string> context) { _locator = locator; _operation = operation; _mode = mode; _inParams = inParams; _context = context; }
public void Invoke(string operation, Ice.OperationMode mode, Ice.FormatType?format, Dictionary <string, string>?context, bool synchronous, System.Action <Ice.OutputStream>?write = null, System.Action <Ice.UserException>?userException = null, System.Func <Ice.InputStream, T>?read = null) { Read = read; UserException = userException; base.Invoke(operation, mode, format, context, synchronous, write); }
public void invoke(string operation, Ice.OperationMode mode, Ice.FormatType format, Dictionary <string, string> context, bool synchronous, System.Action <Ice.OutputStream> write = null, System.Action <Ice.UserException> userException = null, System.Func <Ice.InputStream, T> read = null) { read_ = read; userException_ = userException; base.invoke(operation, mode, format, context, synchronous, write); }
public Request(LocatorI locator, string operation, Ice.OperationMode mode, byte[] inParams, Dictionary <string, string> context, Ice.AMD_Object_ice_invoke amdCB) { _locator = locator; _operation = operation; _mode = mode; _inParams = inParams; _context = context; _amdCB = amdCB; }
// // These functions allow this object to be reused, rather than reallocated. // public void reset(RequestHandler handler, string operation, Ice.OperationMode mode, Dictionary <string, string> context, InvocationObserver observer) { _state = StateUnsent; _exception = null; _sent = false; _handler = handler; _observer = observer; _encoding = Protocol.getCompatibleEncoding(handler.getReference().getEncoding()); Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(_handler.getReference().getProtocol())); writeHeader(operation, mode, context); }
public Outgoing(RequestHandler handler, string operation, Ice.OperationMode mode, Dictionary <string, string> context, InvocationObserver observer) { _state = StateUnsent; _sent = false; _handler = handler; _observer = observer; _encoding = Protocol.getCompatibleEncoding(handler.getReference().getEncoding()); _os = new BasicStream(_handler.getReference().getInstance(), Ice.Util.currentProtocolEncoding); Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(_handler.getReference().getProtocol())); writeHeader(operation, mode, context); }
public Outgoing getOutgoing(string operation, Ice.OperationMode mode, Dictionary <string, string> context, InvocationObserver observer) { _m.Lock(); try { if (!initialized()) { return(new IceInternal.Outgoing(this, operation, mode, context, observer)); } } finally { _m.Unlock(); } return(_connection.getOutgoing(this, operation, mode, context, observer)); }
public void Prepare(string operation, Ice.OperationMode mode, Dictionary <string, string>?context) { Debug.Assert(Os != null); Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(Proxy.IceReference.GetProtocol())); Mode = mode; Observer = ObserverHelper.get(Proxy, operation, context); switch (Proxy.IceReference.GetMode()) { case Ice.InvocationMode.Twoway: case Ice.InvocationMode.Oneway: case Ice.InvocationMode.Datagram: { Os.WriteBlob(Protocol.requestHdr); break; } case Ice.InvocationMode.BatchOneway: case Ice.InvocationMode.BatchDatagram: { Debug.Assert(false); // not implemented break; } } Reference rf = Proxy.IceReference; rf.GetIdentity().IceWrite(Os); // // For compatibility with the old FacetPath. // string facet = rf.GetFacet(); if (facet == null || facet.Length == 0) { Os.WriteStringSeq(null); } else { string[] facetPath = { facet }; Os.WriteStringSeq(facetPath); } Os.WriteString(operation); Os.WriteByte((byte)mode); if (context != null) { // // Explicit context // Ice.ContextHelper.Write(Os, context); } else { // // Implicit context // var implicitContext = (Ice.ImplicitContext?)rf.GetCommunicator().GetImplicitContext(); Dictionary <string, string> prxContext = rf.GetContext(); if (implicitContext == null) { Ice.ContextHelper.Write(Os, prxContext); } else { implicitContext.Write(prxContext, Os); } } }
public Request(LocatorI locator, string operation, Ice.OperationMode mode, byte[] inParams, Dictionary<string, string> context, Ice.AMD_Object_ice_invoke amdCB) { _locator = locator; _operation = operation; _mode = mode; _inParams = inParams; _context = context; _amdCB = amdCB; }
public void prepare(string operation, Ice.OperationMode mode, Dictionary <string, string>?context) { Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(proxy_.IceReference.getProtocol())); mode_ = mode; observer_ = ObserverHelper.get(proxy_, operation, context); switch (proxy_.IceReference.getMode()) { case Ice.InvocationMode.Twoway: case Ice.InvocationMode.Oneway: case Ice.InvocationMode.Datagram: { os_.WriteBlob(Protocol.requestHdr); break; } case Ice.InvocationMode.BatchOneway: case Ice.InvocationMode.BatchDatagram: { Debug.Assert(false); // not implemented break; } } Reference rf = proxy_.IceReference; rf.getIdentity().ice_writeMembers(os_); // // For compatibility with the old FacetPath. // string facet = rf.getFacet(); if (facet == null || facet.Length == 0) { os_.WriteStringSeq(null); } else { string[] facetPath = { facet }; os_.WriteStringSeq(facetPath); } os_.WriteString(operation); os_.WriteByte((byte)mode); if (context != null) { // // Explicit context // Ice.ContextHelper.Write(os_, context); } else { // // Implicit context // Ice.ImplicitContextI implicitContext = (Ice.ImplicitContextI)rf.getCommunicator().getImplicitContext(); Dictionary <string, string> prxContext = rf.getContext(); if (implicitContext == null) { Ice.ContextHelper.Write(os_, prxContext); } else { implicitContext.write(prxContext, os_); } } }
private void writeHeader(string operation, Ice.OperationMode mode, Dictionary <string, string> context) { switch (_handler.getReference().getMode()) { case Reference.Mode.ModeTwoway: case Reference.Mode.ModeOneway: case Reference.Mode.ModeDatagram: { _os.writeBlob(IceInternal.Protocol.requestHdr); break; } case Reference.Mode.ModeBatchOneway: case Reference.Mode.ModeBatchDatagram: { _handler.prepareBatchRequest(_os); break; } } try { _handler.getReference().getIdentity().write__(_os); // // For compatibility with the old FacetPath. // string facet = _handler.getReference().getFacet(); if (facet == null || facet.Length == 0) { _os.writeStringSeq(null); } else { string[] facetPath = { facet }; _os.writeStringSeq(facetPath); } _os.writeString(operation); _os.writeByte((byte)mode); if (context != null) { // // Explicit context // Ice.ContextHelper.write(_os, context); } else { // // Implicit context // Ice.ImplicitContextI implicitContext = _handler.getReference().getInstance().getImplicitContext(); Dictionary <string, string> prxContext = _handler.getReference().getContext(); if (implicitContext == null) { Ice.ContextHelper.write(_os, prxContext); } else { implicitContext.write(prxContext, _os); } } } catch (Ice.LocalException ex) { abort(ex); } }
public void prepare(string operation, Ice.OperationMode mode, Dictionary <string, string> ctx, bool explicitCtx, bool synchronous) { Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(proxy_.reference__().getProtocol())); mode_ = mode; _synchronous = synchronous; if (explicitCtx && ctx == null) { ctx = _emptyContext; } observer_ = ObserverHelper.get(proxy_, operation, ctx); switch (proxy_.reference__().getMode()) { case Reference.Mode.ModeTwoway: case Reference.Mode.ModeOneway: case Reference.Mode.ModeDatagram: { os_.writeBlob(Protocol.requestHdr); break; } case Reference.Mode.ModeBatchOneway: case Reference.Mode.ModeBatchDatagram: { proxy_.getBatchRequestQueue__().prepareBatchRequest(os_); break; } } Reference rf = proxy_.reference__(); rf.getIdentity().write__(os_); // // For compatibility with the old FacetPath. // string facet = rf.getFacet(); if (facet == null || facet.Length == 0) { os_.writeStringSeq(null); } else { string[] facetPath = { facet }; os_.writeStringSeq(facetPath); } os_.writeString(operation); os_.writeByte((byte)mode); if (ctx != null) { // // Explicit context // Ice.ContextHelper.write(os_, ctx); } else { // // Implicit context // Ice.ImplicitContextI implicitContext = rf.getInstance().getImplicitContext(); Dictionary <string, string> prxContext = rf.getContext(); if (implicitContext == null) { Ice.ContextHelper.write(os_, prxContext); } else { implicitContext.write(prxContext, os_); } } }
public Outgoing getOutgoing(string operation, Ice.OperationMode mode, Dictionary <string, string> context, InvocationObserver observer) { return(_connection.getOutgoing(this, operation, mode, context, observer)); }