示例#1
0
 public ProxyGetConnection(Ice.ObjectPrxHelperBase prx, string operation,
                           ProxyTwowayCallback <Ice.Callback_Object_ice_getConnection> cb, object cookie) :
     base(prx, operation, cookie)
 {
     observer_  = ObserverHelper.get(prx, operation);
     _completed = cb;
 }
示例#2
0
        public void Invoke(string operation,
                           bool idempotent,
                           bool oneway,
                           IReadOnlyDictionary <string, string>?context,
                           bool synchronous)
        {
            try
            {
                Proxy.IceReference.Protocol.CheckSupported();

                IsIdempotent = idempotent;
                IsOneway     = oneway;
                context ??= ProxyAndCurrentContext();
                Observer = ObserverHelper.GetInvocationObserver(Proxy, operation, context);

                switch (Proxy.IceReference.InvocationMode)
                {
                case InvocationMode.BatchOneway:
                case InvocationMode.BatchDatagram:
                {
                    Debug.Assert(false);     // not implemented
                    break;
                }
                }
                Invoke(synchronous);
            }
            catch (Exception ex)
            {
                Abort(ex);
            }
        }
示例#3
0
        public CommunicatorFlushBatch(Ice.Communicator communicator, Instance instance, string op, object cookie) :
            base(communicator, instance, op, cookie)
        {
            observer_ = ObserverHelper.get(instance, op);

            //
            // _useCount is initialized to 1 to prevent premature callbacks.
            // The caller must invoke ready() after all flush requests have
            // been initiated.
            //
            _useCount = 1;
        }
示例#4
0
        public void Prepare(string operation, bool idempotent, bool oneway, IReadOnlyDictionary <string, string>?context)
        {
            Debug.Assert(Os != null);
            Proxy.IceReference.GetProtocol().CheckSupported();

            IsIdempotent = idempotent;
            IsOneway     = oneway;

            context ??= ProxyAndCurrentContext();

            Observer = ObserverHelper.GetInvocationObserver(Proxy, operation, context);

            switch (Proxy.IceReference.GetMode())
            {
            case Ice.InvocationMode.Twoway:
            case Ice.InvocationMode.Oneway:
            case Ice.InvocationMode.Datagram:
            {
                Os.WriteSpan(Ice1Definitions.RequestHeader.AsSpan());
                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(System.Array.Empty <string>());
            }
            else
            {
                Os.WriteStringSeq(new string[] { facet });
            }

            Os.WriteString(operation);
            Os.Write(idempotent ? OperationMode.Idempotent : OperationMode.Normal);

            Ice.ContextHelper.Write(Os, context);
        }
示例#5
0
        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);
                }
            }
        }
示例#6
0
        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_);
                }
            }
        }
示例#7
0
 public void invoke(string operation, bool synchronous)
 {
     synchronous_ = synchronous;
     observer_    = ObserverHelper.get(proxy_, operation, null);
     invokeImpl(true); // userThread = true
 }
示例#8
0
 // Called by IceInvokeAsync
 internal void Invoke(string operation, IReadOnlyDictionary <string, string>?context, bool synchronous)
 {
     context ??= ProxyAndCurrentContext();
     Observer = ObserverHelper.GetInvocationObserver(Proxy, operation, context);
     Invoke(synchronous);
 }
示例#9
0
        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_);
                }
            }
        }
示例#10
0
 public ProxyFlushBatch(Ice.ObjectPrxHelperBase prx, string operation, object cookie) :
     base(prx, operation, cookie)
 {
     observer_        = ObserverHelper.get(prx, operation);
     _batchRequestNum = prx.getBatchRequestQueue__().swap(os_);
 }