示例#1
0
文件: PluginI.cs 项目: yiqideren/ice
 ice_invoke_async(Ice.AMD_Object_ice_invoke amdCB, byte[] inParams, Ice.Current current)
 {
     lock (this)
     {
         invoke(null, new Request(this, current.operation, current.mode, inParams, current.ctx, amdCB));
     }
 }
示例#2
0
 ice_invoke_async(Ice.AMD_Object_ice_invoke cb, byte[] inParams, Ice.Current current)
 {
     Ice.Communicator communicator = current.adapter.getCommunicator();
     Ice.InputStream  inS          = new Ice.InputStream(communicator, inParams);
     inS.startEncapsulation();
     Ice.OutputStream outS = new Ice.OutputStream(communicator);
     outS.startEncapsulation();
     if (current.operation.Equals("opOneway"))
     {
         cb.ice_response(true, new byte[0]);
     }
     else if (current.operation.Equals("opString"))
     {
         string s = inS.readString();
         outS.writeString(s);
         outS.writeString(s);
         outS.endEncapsulation();
         cb.ice_response(true, outS.finished());
     }
     else if (current.operation.Equals("opException"))
     {
         Test.MyException ex = new Test.MyException();
         outS.writeException(ex);
         outS.endEncapsulation();
         cb.ice_response(false, outS.finished());
     }
     else if (current.operation.Equals("shutdown"))
     {
         communicator.shutdown();
         cb.ice_response(true, null);
     }
     else if (current.operation.Equals("ice_isA"))
     {
         string s = inS.readString();
         if (s.Equals("::Test::MyClass"))
         {
             outS.writeBool(true);
         }
         else
         {
             outS.writeBool(false);
         }
         outS.endEncapsulation();
         cb.ice_response(true, outS.finished());
     }
     else
     {
         Ice.OperationNotExistException ex = new Ice.OperationNotExistException();
         ex.id        = current.id;
         ex.facet     = current.facet;
         ex.operation = current.operation;
         throw ex;
     }
 }
示例#3
0
    ice_invoke_async(Ice.AMD_Object_ice_invoke amdCb, byte[] inEncaps, Ice.Current current)
    {
        bool twoway = current.requestId > 0;

        Ice.ObjectPrx obj = current.con.createProxy(current.id);
        if (!twoway)
        {
            if (_startBatch)
            {
                _startBatch = false;
                _batchProxy = obj.ice_batchOneway();
            }
            if (_batchProxy != null)
            {
                obj = _batchProxy;
            }

            if (current.facet.Length != 0)
            {
                obj = obj.ice_facet(current.facet);
            }

            if (_batchProxy != null)
            {
                byte[] outEncaps;
                obj.ice_invoke(current.operation, current.mode, inEncaps, out outEncaps, current.ctx);
                amdCb.ice_response(true, new byte[0]);
            }
            else
            {
                Callback cb = new Callback(amdCb, false);
                obj.ice_oneway().begin_ice_invoke(current.operation,
                                                  current.mode,
                                                  inEncaps,
                                                  current.ctx).whenCompleted(cb.response, cb.exception)
                .whenSent(cb.sent);
            }
        }
        else
        {
            if (current.facet.Length != 0)
            {
                obj = obj.ice_facet(current.facet);
            }
            Callback cb = new Callback(amdCb, true);
            obj.begin_ice_invoke(current.operation,
                                 current.mode,
                                 inEncaps,
                                 current.ctx).whenCompleted(cb.response, cb.exception).whenSent(cb.sent);
        }
    }
示例#4
0
文件: PluginI.cs 项目: yiqideren/ice
 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;
 }
示例#5
0
文件: PluginI.cs 项目: externl/ice
 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;
 }
示例#6
0
 public Callback(Ice.AMD_Object_ice_invoke cb, bool twoway)
 {
     _cb = cb;
     _twoway = twoway;
 }
示例#7
0
 public Callback(Ice.AMD_Object_ice_invoke cb, bool twoway)
 {
     _cb     = cb;
     _twoway = twoway;
 }