public void finished(Ice.Current current, Ice.Object servant, System.Object cookie) { lock (this) { test(!_deactivated); } // // Ensure finished() is only called once per request. // test(_requestId == current.requestId); _requestId = -1; test(current.id.category.Equals(_category) || _category.Length == 0); test(current.id.name.Equals("locate") || current.id.name.Equals("finished")); if (current.id.name.Equals("finished")) { exception(current); } Cookie co = (Cookie)cookie; test(co.message().Equals("blahblah")); }
/// <summary> /// 启动服务 /// </summary> /// <param name="iceObj"></param> /// <param name="port"></param> /// <returns></returns> public static bool Start(Ice.Object iceObj, int port = 10000) { if (iceObj == null) { throw new ApplicationException("Invalid obj"); } if (run == false) { Ice.Communicator ic = null; //初始化Ice runtime ,将args传递给这个调用,是因为服务器可能 //有run time感兴趣的命令行参数,返回的是一个Ice.Communicator //它是Ice run time的主句柄 ic = Ice.Util.initialize(); //调用createObjectAdapterWithEndpoints创建一个对象适配器,传入的参数为SimplePrinter(适配器名称) //和default -p 10000或者是适配器使用缺省协议TCP/IP在端口10000侦听到来的请求 Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints("SimplePrinter", "default -p " + port); //这时,服务器端run time 已经初始化,我们实例化一个PrinterI 对 //象,为我们的Printer 接口创建一个servant。 //Ice.Object obj = new PrinterI(); //我们调用适配器的add,告诉它有了一个新的servant ;传给add 的参 //数是我们刚才实例化的servant,再加上一个标识符。在这里, //"SimplePrinter" 串是servant 的名字(如果我们有多个打印机,每个 //打印机都会有不同的名字,更正确的说法是,都会有不同的对象标识)。 adapter.add(iceObj, Ice.Util.stringToIdentity("SimplePrinter")); //我们调用适配器的activate 方法激活适配器(适配器一开 //始是在扣留(holding)状态创建的;这种做法在下面这样的情况下很 //有用:如果我们有多个servant,它们共享同一个适配器,而在所有 //servant 实例化之前我们不想处理请求)。一旦适配器被激活,服务器就 //会开始处理来自客户的请求。 adapter.activate(); run = true; } return(run); }
public ServantLocatorI(bool async) { if(async) { _blobject = new BlobjectAsyncI(); } else { _blobject = new BlobjectI(); } }
internal static void twowaysAMI(Ice.Communicator communicator, Test.MyClassPrx p) { { byte[] i = new byte[_length]; for(int c = 0; c < _length; ++c) { i[c] = (byte)c; } AMI_MyClass_opAByteSI cb = new AMI_MyClass_opAByteSI(i); p.opAByteS_async(cb, i); cb.check(); } { List<byte> i = new List<byte>(); for(int c = 0; c < _length; ++c) { i.Add((byte)c); } AMI_MyClass_opLByteSI cb = new AMI_MyClass_opLByteSI(i); p.opLByteS_async(cb, i); cb.check(); } { LinkedList<byte> i = new LinkedList<byte>(); for(int c = 0; c < _length; ++c) { i.AddLast((byte)c); } AMI_MyClass_opKByteSI cb = new AMI_MyClass_opKByteSI(i); p.opKByteS_async(cb, i); cb.check(); } { Queue<byte> i = new Queue<byte>(); for(int c = 0; c < _length; ++c) { i.Enqueue((byte)c); } AMI_MyClass_opQByteSI cb = new AMI_MyClass_opQByteSI(i); p.opQByteS_async(cb, i); cb.check(); } { Stack<byte> i = new Stack<byte>(); for(int c = 0; c < _length; ++c) { i.Push((byte)c); } AMI_MyClass_opSByteSI cb = new AMI_MyClass_opSByteSI(i); p.opSByteS_async(cb, i); cb.check(); } { CByteS i = new CByteS(); for(int c = 0; c < _length; ++c) { i.Add((byte)c); } AMI_MyClass_opCByteSI cb = new AMI_MyClass_opCByteSI(i); p.opCByteS_async(cb, i); cb.check(); } { bool[] i = new bool[_length]; for(int c = 0; c < _length; ++c) { i[c] = c % 1 == 1; } AMI_MyClass_opABoolSI cb = new AMI_MyClass_opABoolSI(i); p.opABoolS_async(cb, i); cb.check(); } { List<bool> i = new List<bool>(); for(int c = 0; c < _length; ++c) { i.Add(c % 1 == 1); } AMI_MyClass_opLBoolSI cb = new AMI_MyClass_opLBoolSI(i); p.opLBoolS_async(cb, i); cb.check(); } { LinkedList<bool> i = new LinkedList<bool>(); for(int c = 0; c < _length; ++c) { i.AddLast(c % 1 == 1); } AMI_MyClass_opKBoolSI cb = new AMI_MyClass_opKBoolSI(i); p.opKBoolS_async(cb, i); cb.check(); } { Queue<bool> i = new Queue<bool>(); for(int c = 0; c < _length; ++c) { i.Enqueue(c % 1 == 1); } AMI_MyClass_opQBoolSI cb = new AMI_MyClass_opQBoolSI(i); p.opQBoolS_async(cb, i); cb.check(); } { Stack<bool> i = new Stack<bool>(); for(int c = 0; c < _length; ++c) { i.Push(c % 1 == 1); } AMI_MyClass_opSBoolSI cb = new AMI_MyClass_opSBoolSI(i); p.opSBoolS_async(cb, i); cb.check(); } { CBoolS i = new CBoolS(); for(int c = 0; c < _length; ++c) { i.Add(c % 1 == 1); } AMI_MyClass_opCBoolSI cb = new AMI_MyClass_opCBoolSI(i); p.opCBoolS_async(cb, i); cb.check(); } { short[] i = new short[_length]; for(int c = 0; c < _length; ++c) { i[c] = (short)c; } AMI_MyClass_opAShortSI cb = new AMI_MyClass_opAShortSI(i); p.opAShortS_async(cb, i); cb.check(); } { List<short> i = new List<short>(); for(int c = 0; c < _length; ++c) { i.Add((short)c); } AMI_MyClass_opLShortSI cb = new AMI_MyClass_opLShortSI(i); p.opLShortS_async(cb, i); cb.check(); } { LinkedList<short> i = new LinkedList<short>(); for(int c = 0; c < _length; ++c) { i.AddLast((short)c); } AMI_MyClass_opKShortSI cb = new AMI_MyClass_opKShortSI(i); p.opKShortS_async(cb, i); cb.check(); } { Queue<short> i = new Queue<short>(); for(int c = 0; c < _length; ++c) { i.Enqueue((short)c); } AMI_MyClass_opQShortSI cb = new AMI_MyClass_opQShortSI(i); p.opQShortS_async(cb, i); cb.check(); } { Stack<short> i = new Stack<short>(); for(int c = 0; c < _length; ++c) { i.Push((short)c); } AMI_MyClass_opSShortSI cb = new AMI_MyClass_opSShortSI(i); p.opSShortS_async(cb, i); cb.check(); } { CShortS i = new CShortS(); for(int c = 0; c < _length; ++c) { i.Add((short)c); } AMI_MyClass_opCShortSI cb = new AMI_MyClass_opCShortSI(i); p.opCShortS_async(cb, i); cb.check(); } { int[] i = new int[_length]; for(int c = 0; c < _length; ++c) { i[c] = (int)c; } AMI_MyClass_opAIntSI cb = new AMI_MyClass_opAIntSI(i); p.opAIntS_async(cb, i); cb.check(); } { List<int> i = new List<int>(); for(int c = 0; c < _length; ++c) { i.Add((int)c); } AMI_MyClass_opLIntSI cb = new AMI_MyClass_opLIntSI(i); p.opLIntS_async(cb, i); cb.check(); } { LinkedList<int> i = new LinkedList<int>(); for(int c = 0; c < _length; ++c) { i.AddLast((int)c); } AMI_MyClass_opKIntSI cb = new AMI_MyClass_opKIntSI(i); p.opKIntS_async(cb, i); cb.check(); } { Queue<int> i = new Queue<int>(); for(int c = 0; c < _length; ++c) { i.Enqueue((int)c); } AMI_MyClass_opQIntSI cb = new AMI_MyClass_opQIntSI(i); p.opQIntS_async(cb, i); cb.check(); } { Stack<int> i = new Stack<int>(); for(int c = 0; c < _length; ++c) { i.Push((int)c); } AMI_MyClass_opSIntSI cb = new AMI_MyClass_opSIntSI(i); p.opSIntS_async(cb, i); cb.check(); } { CIntS i = new CIntS(); for(int c = 0; c < _length; ++c) { i.Add((int)c); } AMI_MyClass_opCIntSI cb = new AMI_MyClass_opCIntSI(i); p.opCIntS_async(cb, i); cb.check(); } { long[] i = new long[_length]; for(int c = 0; c < _length; ++c) { i[c] = (long)c; } AMI_MyClass_opALongSI cb = new AMI_MyClass_opALongSI(i); p.opALongS_async(cb, i); cb.check(); } { List<long> i = new List<long>(); for(int c = 0; c < _length; ++c) { i.Add((long)c); } AMI_MyClass_opLLongSI cb = new AMI_MyClass_opLLongSI(i); p.opLLongS_async(cb, i); cb.check(); } { LinkedList<long> i = new LinkedList<long>(); for(int c = 0; c < _length; ++c) { i.AddLast((long)c); } AMI_MyClass_opKLongSI cb = new AMI_MyClass_opKLongSI(i); p.opKLongS_async(cb, i); cb.check(); } { Queue<long> i = new Queue<long>(); for(int c = 0; c < _length; ++c) { i.Enqueue((long)c); } AMI_MyClass_opQLongSI cb = new AMI_MyClass_opQLongSI(i); p.opQLongS_async(cb, i); cb.check(); } { Stack<long> i = new Stack<long>(); for(int c = 0; c < _length; ++c) { i.Push((long)c); } AMI_MyClass_opSLongSI cb = new AMI_MyClass_opSLongSI(i); p.opSLongS_async(cb, i); cb.check(); } { CLongS i = new CLongS(); for(int c = 0; c < _length; ++c) { i.Add((long)c); } AMI_MyClass_opCLongSI cb = new AMI_MyClass_opCLongSI(i); p.opCLongS_async(cb, i); cb.check(); } { float[] i = new float[_length]; for(int c = 0; c < _length; ++c) { i[c] = (float)c; } AMI_MyClass_opAFloatSI cb = new AMI_MyClass_opAFloatSI(i); p.opAFloatS_async(cb, i); cb.check(); } { List<float> i = new List<float>(); for(int c = 0; c < _length; ++c) { i.Add((float)c); } AMI_MyClass_opLFloatSI cb = new AMI_MyClass_opLFloatSI(i); p.opLFloatS_async(cb, i); cb.check(); } { LinkedList<float> i = new LinkedList<float>(); for(int c = 0; c < _length; ++c) { i.AddLast((float)c); } AMI_MyClass_opKFloatSI cb = new AMI_MyClass_opKFloatSI(i); p.opKFloatS_async(cb, i); cb.check(); } { Queue<float> i = new Queue<float>(); for(int c = 0; c < _length; ++c) { i.Enqueue((float)c); } AMI_MyClass_opQFloatSI cb = new AMI_MyClass_opQFloatSI(i); p.opQFloatS_async(cb, i); cb.check(); } { Stack<float> i = new Stack<float>(); for(int c = 0; c < _length; ++c) { i.Push((float)c); } AMI_MyClass_opSFloatSI cb = new AMI_MyClass_opSFloatSI(i); p.opSFloatS_async(cb, i); cb.check(); } { CFloatS i = new CFloatS(); for(int c = 0; c < _length; ++c) { i.Add((float)c); } AMI_MyClass_opCFloatSI cb = new AMI_MyClass_opCFloatSI(i); p.opCFloatS_async(cb, i); cb.check(); } { double[] i = new double[_length]; for(int c = 0; c < _length; ++c) { i[c] = (double)c; } AMI_MyClass_opADoubleSI cb = new AMI_MyClass_opADoubleSI(i); p.opADoubleS_async(cb, i); cb.check(); } { List<double> i = new List<double>(); for(int c = 0; c < _length; ++c) { i.Add((double)c); } AMI_MyClass_opLDoubleSI cb = new AMI_MyClass_opLDoubleSI(i); p.opLDoubleS_async(cb, i); cb.check(); } { LinkedList<double> i = new LinkedList<double>(); for(int c = 0; c < _length; ++c) { i.AddLast((double)c); } AMI_MyClass_opKDoubleSI cb = new AMI_MyClass_opKDoubleSI(i); p.opKDoubleS_async(cb, i); cb.check(); } { Queue<double> i = new Queue<double>(); for(int c = 0; c < _length; ++c) { i.Enqueue((double)c); } AMI_MyClass_opQDoubleSI cb = new AMI_MyClass_opQDoubleSI(i); p.opQDoubleS_async(cb, i); cb.check(); } { Stack<double> i = new Stack<double>(); for(int c = 0; c < _length; ++c) { i.Push((double)c); } AMI_MyClass_opSDoubleSI cb = new AMI_MyClass_opSDoubleSI(i); p.opSDoubleS_async(cb, i); cb.check(); } { CDoubleS i = new CDoubleS(); for(int c = 0; c < _length; ++c) { i.Add((double)c); } AMI_MyClass_opCDoubleSI cb = new AMI_MyClass_opCDoubleSI(i); p.opCDoubleS_async(cb, i); cb.check(); } { string[] i = new string[_length]; for(int c = 0; c < _length; ++c) { i[c] = c.ToString(); } AMI_MyClass_opAStringSI cb = new AMI_MyClass_opAStringSI(i); p.opAStringS_async(cb, i); cb.check(); } { List<string> i = new List<string>(); for(int c = 0; c < _length; ++c) { i.Add(c.ToString()); } AMI_MyClass_opLStringSI cb = new AMI_MyClass_opLStringSI(i); p.opLStringS_async(cb, i); cb.check(); } { LinkedList<string> i = new LinkedList<string>(); for(int c = 0; c < _length; ++c) { i.AddLast(c.ToString()); } AMI_MyClass_opKStringSI cb = new AMI_MyClass_opKStringSI(i); p.opKStringS_async(cb, i); cb.check(); } { Queue<string> i = new Queue<string>(); for(int c = 0; c < _length; ++c) { i.Enqueue(c.ToString()); } AMI_MyClass_opQStringSI cb = new AMI_MyClass_opQStringSI(i); p.opQStringS_async(cb, i); cb.check(); } { Stack<string> i = new Stack<string>(); for(int c = 0; c < _length; ++c) { i.Push(c.ToString()); } AMI_MyClass_opSStringSI cb = new AMI_MyClass_opSStringSI(i); p.opSStringS_async(cb, i); cb.check(); } { CStringS i = new CStringS(); for(int c = 0; c < _length; ++c) { i.Add(c.ToString()); } AMI_MyClass_opCStringSI cb = new AMI_MyClass_opCStringSI(i); p.opCStringS_async(cb, i); cb.check(); } { Ice.Object[] i = new Ice.Object[_length]; for(int c = 0; c < _length; ++c) { i[c] = new CV(c); } AMI_MyClass_opAObjectSI cb = new AMI_MyClass_opAObjectSI(i); p.opAObjectS_async(cb, i); cb.check(); } { List<Ice.Object> i = new List<Ice.Object>(); for(int c = 0; c < _length; ++c) { i.Add(new CV(c)); } AMI_MyClass_opLObjectSI cb = new AMI_MyClass_opLObjectSI(i); p.opLObjectS_async(cb, i); cb.check(); } { CObjectS i = new CObjectS(); for(int c = 0; c < _length; ++c) { i.Add(new CV(c)); } AMI_MyClass_opCObjectSI cb = new AMI_MyClass_opCObjectSI(i); p.opCObjectS_async(cb, i); cb.check(); } { Ice.ObjectPrx[] i = new Ice.ObjectPrx[_length]; for(int c = 0; c < _length; ++c) { i[c] = communicator.stringToProxy(c.ToString()); } AMI_MyClass_opAObjectPrxSI cb = new AMI_MyClass_opAObjectPrxSI(i); p.opAObjectPrxS_async(cb, i); cb.check(); } { List<Ice.ObjectPrx> i = new List<Ice.ObjectPrx>(); for(int c = 0; c < _length; ++c) { i.Add(communicator.stringToProxy(c.ToString())); } AMI_MyClass_opLObjectPrxSI cb = new AMI_MyClass_opLObjectPrxSI(i); p.opLObjectPrxS_async(cb, i); cb.check(); } { LinkedList<Ice.ObjectPrx> i = new LinkedList<Ice.ObjectPrx>(); for(int c = 0; c < _length; ++c) { i.AddLast(communicator.stringToProxy(c.ToString())); } AMI_MyClass_opKObjectPrxSI cb = new AMI_MyClass_opKObjectPrxSI(i); p.opKObjectPrxS_async(cb, i); cb.check(); } { Queue<Ice.ObjectPrx> i = new Queue<Ice.ObjectPrx>(); for(int c = 0; c < _length; ++c) { i.Enqueue(communicator.stringToProxy(c.ToString())); } AMI_MyClass_opQObjectPrxSI cb = new AMI_MyClass_opQObjectPrxSI(i); p.opQObjectPrxS_async(cb, i); cb.check(); } { Stack<Ice.ObjectPrx> i = new Stack<Ice.ObjectPrx>(); for(int c = 0; c < _length; ++c) { i.Push(communicator.stringToProxy(c.ToString())); } AMI_MyClass_opSObjectPrxSI cb = new AMI_MyClass_opSObjectPrxSI(i); p.opSObjectPrxS_async(cb, i); cb.check(); } { CObjectPrxS i = new CObjectPrxS(); for(int c = 0; c < _length; ++c) { i.Add(communicator.stringToProxy(c.ToString())); } AMI_MyClass_opCObjectPrxSI cb = new AMI_MyClass_opCObjectPrxSI(i); p.opCObjectPrxS_async(cb, i); cb.check(); } { S[] i = new S[_length]; for(int c = 0; c < _length; ++c) { i[c].i = c; } AMI_MyClass_opAStructSI cb = new AMI_MyClass_opAStructSI(i); p.opAStructS_async(cb, i); cb.check(); } { List<S> i = new List<S>(); for(int c = 0; c < _length; ++c) { i.Add(new S(c)); } AMI_MyClass_opLStructSI cb = new AMI_MyClass_opLStructSI(i); p.opLStructS_async(cb, i); cb.check(); } { LinkedList<S> i = new LinkedList<S>(); for(int c = 0; c < _length; ++c) { i.AddLast(new S(c)); } AMI_MyClass_opKStructSI cb = new AMI_MyClass_opKStructSI(i); p.opKStructS_async(cb, i); cb.check(); } { Queue<S> i = new Queue<S>(); for(int c = 0; c < _length; ++c) { i.Enqueue(new S(c)); } AMI_MyClass_opQStructSI cb = new AMI_MyClass_opQStructSI(i); p.opQStructS_async(cb, i); cb.check(); } { Stack<S> i = new Stack<S>(); for(int c = 0; c < _length; ++c) { i.Push(new S(c)); } AMI_MyClass_opSStructSI cb = new AMI_MyClass_opSStructSI(i); p.opSStructS_async(cb, i); cb.check(); } { CStructS i = new CStructS(); for(int c = 0; c < _length; ++c) { i.Add(new S(c)); } AMI_MyClass_opCStructSI cb = new AMI_MyClass_opCStructSI(i); p.opCStructS_async(cb, i); cb.check(); } { SD[] i = new SD[_length]; for(int c = 0; c < _length; ++c) { i[c] = new SD(c); } AMI_MyClass_opAStructSDI cb = new AMI_MyClass_opAStructSDI(i); p.opAStructSD_async(cb, i); cb.check(); } { List<SD> i = new List<SD>(); for(int c = 0; c < _length; ++c) { i.Add(new SD(c)); } AMI_MyClass_opLStructSDI cb = new AMI_MyClass_opLStructSDI(i); p.opLStructSD_async(cb, i); cb.check(); } { LinkedList<SD> i = new LinkedList<SD>(); for(int c = 0; c < _length; ++c) { i.AddLast(new SD(c)); } AMI_MyClass_opKStructSDI cb = new AMI_MyClass_opKStructSDI(i); p.opKStructSD_async(cb, i); cb.check(); } { Queue<SD> i = new Queue<SD>(); for(int c = 0; c < _length; ++c) { i.Enqueue(new SD(c)); } AMI_MyClass_opQStructSDI cb = new AMI_MyClass_opQStructSDI(i); p.opQStructSD_async(cb, i); cb.check(); } { Stack<SD> i = new Stack<SD>(); for(int c = 0; c < _length; ++c) { i.Push(new SD(c)); } AMI_MyClass_opSStructSDI cb = new AMI_MyClass_opSStructSDI(i); p.opSStructSD_async(cb, i); cb.check(); } { CStructSD i = new CStructSD(); for(int c = 0; c < _length; ++c) { i.Add(new SD(c)); } AMI_MyClass_opCStructSDI cb = new AMI_MyClass_opCStructSDI(i); p.opCStructSD_async(cb, i); cb.check(); } { CV[] i = new CV[_length]; for(int c = 0; c < _length; ++c) { i[c] = new CV(c); } AMI_MyClass_opACVSI cb = new AMI_MyClass_opACVSI(i); p.opACVS_async(cb, i); cb.check(); } { List<CV> i = new List<CV>(); for(int c = 0; c < _length; ++c) { i.Add(new CV(c)); } AMI_MyClass_opLCVSI cb = new AMI_MyClass_opLCVSI(i); p.opLCVS_async(cb, i); cb.check(); } { CCVS i = new CCVS(); for(int c = 0; c < _length; ++c) { i.Add(new CV(c)); } AMI_MyClass_opCCVSI cb = new AMI_MyClass_opCCVSI(i); p.opCCVS_async(cb, i); cb.check(); } { CVPrx[] i = new CVPrx[_length]; for(int c = 0; c < _length; ++c) { i[c] = CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())); } AMI_MyClass_opACVPrxSI cb = new AMI_MyClass_opACVPrxSI(i); p.opACVPrxS_async(cb, i); cb.check(); } { List<CVPrx> i = new List<CVPrx>(); for(int c = 0; c < _length; ++c) { i.Add(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString()))); } AMI_MyClass_opLCVPrxSI cb = new AMI_MyClass_opLCVPrxSI(i); p.opLCVPrxS_async(cb, i); cb.check(); } { LinkedList<CVPrx> i = new LinkedList<CVPrx>(); for(int c = 0; c < _length; ++c) { i.AddLast(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString()))); } AMI_MyClass_opKCVPrxSI cb = new AMI_MyClass_opKCVPrxSI(i); p.opKCVPrxS_async(cb, i); cb.check(); } { Queue<CVPrx> i = new Queue<CVPrx>(); for(int c = 0; c < _length; ++c) { i.Enqueue(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString()))); } AMI_MyClass_opQCVPrxSI cb = new AMI_MyClass_opQCVPrxSI(i); p.opQCVPrxS_async(cb, i); cb.check(); } { Stack<CVPrx> i = new Stack<CVPrx>(); for(int c = 0; c < _length; ++c) { i.Push(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString()))); } AMI_MyClass_opSCVPrxSI cb = new AMI_MyClass_opSCVPrxSI(i); p.opSCVPrxS_async(cb, i); cb.check(); } { CCVPrxS i = new CCVPrxS(); for(int c = 0; c < _length; ++c) { i.Add(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString()))); } AMI_MyClass_opCCVPrxSI cb = new AMI_MyClass_opCCVPrxSI(i); p.opCCVPrxS_async(cb, i); cb.check(); } { CR[] i = new CR[_length]; for(int c = 0; c < _length; ++c) { i[c] = new CR(new CV(c)); } AMI_MyClass_opACRSI cb = new AMI_MyClass_opACRSI(i); p.opACRS_async(cb, i); cb.check(); } { List<CR> i = new List<CR>(); for(int c = 0; c < _length; ++c) { i.Add(new CR(new CV(c))); } AMI_MyClass_opLCRSI cb = new AMI_MyClass_opLCRSI(i); p.opLCRS_async(cb, i); cb.check(); } { CCRS i = new CCRS(); for(int c = 0; c < _length; ++c) { i.Add(new CR(new CV(c))); } AMI_MyClass_opCCRSI cb = new AMI_MyClass_opCCRSI(i); p.opCCRS_async(cb, i); cb.check(); } { En[] i = new En[_length]; for(int c = 0; c < _length; ++c) { i[c] = (En)(c % 3); } AMI_MyClass_opAEnSI cb = new AMI_MyClass_opAEnSI(i); p.opAEnS_async(cb, i); cb.check(); } { List<En> i = new List<En>(); for(int c = 0; c < _length; ++c) { i.Add((En)(c % 3)); } AMI_MyClass_opLEnSI cb = new AMI_MyClass_opLEnSI(i); p.opLEnS_async(cb, i); cb.check(); } { LinkedList<En> i = new LinkedList<En>(); for(int c = 0; c < _length; ++c) { i.AddLast((En)(c % 3)); } AMI_MyClass_opKEnSI cb = new AMI_MyClass_opKEnSI(i); p.opKEnS_async(cb, i); cb.check(); } { Queue<En> i = new Queue<En>(); for(int c = 0; c < _length; ++c) { i.Enqueue((En)(c % 3)); } AMI_MyClass_opQEnSI cb = new AMI_MyClass_opQEnSI(i); p.opQEnS_async(cb, i); cb.check(); } { Stack<En> i = new Stack<En>(); for(int c = 0; c < _length; ++c) { i.Push((En)(c % 3)); } AMI_MyClass_opSEnSI cb = new AMI_MyClass_opSEnSI(i); p.opSEnS_async(cb, i); cb.check(); } { CEnS i = new CEnS(); for(int c = 0; c < _length; ++c) { i.Add((En)(c % 3)); } AMI_MyClass_opCEnSI cb = new AMI_MyClass_opCEnSI(i); p.opCEnS_async(cb, i); cb.check(); } { Custom<int> i = new Custom<int>(); for(int c = 0; c < _length; ++c) { i.Add(c); } AMI_MyClass_opCustomIntSI cb = new AMI_MyClass_opCustomIntSI(i); p.opCustomIntS_async(cb, i); cb.check(); } { Custom<CV> i = new Custom<CV>(); for(int c = 0; c < _length; ++c) { i.Add(new CV(c)); } AMI_MyClass_opCustomCVSI cb = new AMI_MyClass_opCustomCVSI(i); p.opCustomCVS_async(cb, i); cb.check(); } { Custom<Custom<int>> i = new Custom<Custom<int>>(); for(int c = 0; c < _length; ++c) { Custom<int> inner = new Custom<int>(); for(int j = 0; j < c; ++j) { inner.Add(j); } i.Add(inner); } AMI_MyClass_opCustomIntSSI cb = new AMI_MyClass_opCustomIntSSI(i); p.opCustomIntSS_async(cb, i); cb.check(); } { Custom<Custom<CV>> i = new Custom<Custom<CV>>(); for(int c = 0; c < _length; ++c) { Custom<CV> inner = new Custom<CV>(); for(int j = 0; j < c; ++j) { inner.Add(new CV(j)); } i.Add(inner); } AMI_MyClass_opCustomCVSSI cb = new AMI_MyClass_opCustomCVSSI(i); p.opCustomCVSS_async(cb, i); cb.check(); } #if !COMPACT && !SILVERLIGHT { Serialize.Small i = null; AMI_MyClass_opSerialSmallCSharpNull cb = new AMI_MyClass_opSerialSmallCSharpNull(); p.opSerialSmallCSharp_async(cb, i); cb.check(); } { Serialize.Small i = new Serialize.Small(); i.i = 99; AMI_MyClass_opSerialSmallCSharp cb = new AMI_MyClass_opSerialSmallCSharp(); p.opSerialSmallCSharp_async(cb, i); cb.check(); } { Serialize.Large i = new Serialize.Large(); i.d1 = 1.0; i.d2 = 2.0; i.d3 = 3.0; i.d4 = 4.0; i.d5 = 5.0; i.d6 = 6.0; i.d7 = 7.0; i.d8 = 8.0; i.d9 = 9.0; i.d10 = 10.0; AMI_MyClass_opSerialLargeCSharp cb = new AMI_MyClass_opSerialLargeCSharp(); p.opSerialLargeCSharp_async(cb, i); cb.check(); } { Serialize.Struct i = new Serialize.Struct(); i.o = null; i.o2 = i; i.s = null; i.s2 = "Hello"; AMI_MyClass_opSerialStructCSharp cb = new AMI_MyClass_opSerialStructCSharp(); p.opSerialStructCSharp_async(cb, i); cb.check(); } #endif }
internal InterceptorI(Ice.Object servant) { servant_ = servant; }
public void invoke(Ice.Object obj) { this.obj = obj; }
internal AMDInterceptorI(Ice.Object servant) : base(servant) { }
finished(Ice.Current current, Ice.Object servant, System.Object cookie) { }
public override Ice.Object pingPong(Ice.Object obj, Ice.Current current) { return(obj); }
allTests(Ice.Communicator communicator) { Ice.ObjectAdapter oa = communicator.createObjectAdapterWithEndpoints("MyOA", "tcp -h localhost"); oa.activate(); Ice.Object servant = new MyObjectI(); // // Register default servant with category "foo" // oa.addDefaultServant(servant, "foo"); // // Start test // Console.Out.Write("testing single category... "); Console.Out.Flush(); Ice.Object r = oa.findDefaultServant("foo"); test(r == servant); r = oa.findDefaultServant("bar"); test(r == null); Ice.Identity identity = new Ice.Identity(); identity.category = "foo"; string[] names = new string[] { "foo", "bar", "x", "y", "abcdefg" }; Test.MyObjectPrx prx = null; for (int idx = 0; idx < 5; ++idx) { identity.name = names[idx]; prx = Test.MyObjectPrxHelper.uncheckedCast(oa.createProxy(identity)); prx.ice_ping(); test(prx.getName() == names[idx]); } identity.name = "ObjectNotExist"; prx = Test.MyObjectPrxHelper.uncheckedCast(oa.createProxy(identity)); try { prx.ice_ping(); test(false); } catch (Ice.ObjectNotExistException) { // Expected } try { prx.getName(); test(false); } catch (Ice.ObjectNotExistException) { // Expected } identity.name = "FacetNotExist"; prx = Test.MyObjectPrxHelper.uncheckedCast(oa.createProxy(identity)); try { prx.ice_ping(); test(false); } catch (Ice.FacetNotExistException) { // Expected } try { prx.getName(); test(false); } catch (Ice.FacetNotExistException) { // Expected } identity.category = "bar"; for (int idx = 0; idx < 5; idx++) { identity.name = names[idx]; prx = Test.MyObjectPrxHelper.uncheckedCast(oa.createProxy(identity)); try { prx.ice_ping(); test(false); } catch (Ice.ObjectNotExistException) { // Expected } try { prx.getName(); test(false); } catch (Ice.ObjectNotExistException) { // Expected } } oa.removeDefaultServant("foo"); identity.category = "foo"; prx = Test.MyObjectPrxHelper.uncheckedCast(oa.createProxy(identity)); try { prx.ice_ping(); } catch (Ice.ObjectNotExistException) { // Expected } Console.Out.WriteLine("ok"); Console.Out.Write("testing default category... "); Console.Out.Flush(); oa.addDefaultServant(servant, ""); r = oa.findDefaultServant("bar"); test(r == null); r = oa.findDefaultServant(""); test(r == servant); for (int idx = 0; idx < 5; ++idx) { identity.name = names[idx]; prx = Test.MyObjectPrxHelper.uncheckedCast(oa.createProxy(identity)); prx.ice_ping(); test(prx.getName() == names[idx]); } Console.Out.WriteLine("ok"); }
public override void pingPong_async(Test.AMD_Initial_pingPong cb, Ice.Object obj, Ice.Current current) { cb.ice_response(obj); }