Exemplo n.º 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;
 }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
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);
                }
            }
        }
Exemplo n.º 4
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_);
                }
            }
        }
Exemplo n.º 5
0
 public void invoke(string operation, bool synchronous)
 {
     synchronous_ = synchronous;
     observer_    = ObserverHelper.get(proxy_, operation, null);
     invokeImpl(true); // userThread = true
 }
Exemplo n.º 6
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_);
                }
            }
        }
Exemplo n.º 7
0
 public ProxyFlushBatch(Ice.ObjectPrxHelperBase prx, string operation, object cookie) :
     base(prx, operation, cookie)
 {
     observer_        = ObserverHelper.get(prx, operation);
     _batchRequestNum = prx.getBatchRequestQueue__().swap(os_);
 }