Esempio n. 1
0
 //
 // AMD
 //
 public override void amdAdd_async(Test.AMD_MyObject_amdAdd cb, int x, int y, Ice.Current current)
 {
     Thread thread = new Thread(delegate()
                                {
                                    Thread.Sleep(10);
                                    cb.ice_response(x + y);
                                });
     thread.IsBackground = true;
     thread.Start();
 }
Esempio n. 2
0
    public void shutdown_async(Test.AMD_MyClass_shutdown cb, Ice.Current current)
    {
        while(_opVoidThread != null)
        {
            _opVoidThread.Join();
            _opVoidThread = null;
        }

        current.adapter.getCommunicator().shutdown();
        cb.ice_response();
    }
Esempio n. 3
0
    public void opBoolS_async(Test.AMD_MyClass_opBoolS cb, Test.BoolS p1, Test.BoolS p2, Ice.Current current)
    {
        Test.BoolS p3 = new Test.BoolS();
        p3.AddRange(p1);
        p3.AddRange(p2);

        Test.BoolS r = new Test.BoolS();
        for(int i = 0; i < p1.Count; i++)
        {
            r.Add(p1[p1.Count - (i + 1)]);
        }
        cb.ice_response(r, p3);
    }
Esempio n. 4
0
    public void opBoolSS_async(Test.AMD_MyClass_opBoolSS cb, bool[][] p1, bool[][] p2,
        Ice.Current current)
    {
        bool[][] p3 = new bool[p1.Length + p2.Length][];
        Array.Copy(p1, p3, p1.Length);
        Array.Copy(p2, 0, p3, p1.Length, p2.Length);

        bool[][] r = new bool[p1.Length][];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        cb.ice_response(r, p3);
    }
Esempio n. 5
0
 public override void opBoolBoolSD_async(Test.AMD_MyClass_opBoolBoolSD cb,
     Dictionary<bool, bool[]> p1,
     Dictionary<bool, bool[]> p2,
     Ice.Current current)
 {
     Dictionary<bool, bool[]>  p3 = p2;
     Dictionary<bool, bool[]> r = new Dictionary<bool, bool[]>();
     foreach(KeyValuePair<bool, bool[]> e in p1)
     {
         r[e.Key] = e.Value;
     }
     foreach(KeyValuePair<bool, bool[]> e in p2)
     {
         r[e.Key] = e.Value;
     }
     cb.ice_response(r,p3);
 }
Esempio n. 6
0
    public override void amdAddWithRetry_async(Test.AMD_MyObject_amdAddWithRetry cb, int x, int y, Ice.Current current)
    {
        Thread thread = new Thread(delegate()
                                   {
                                       Thread.Sleep(10);
                                       cb.ice_response(x + y);
                                   });
        thread.IsBackground = true;
        thread.Start();

        if(current.ctx.ContainsKey("retry") && current.ctx["retry"].Equals("no"))
        {
            return;
        }
        else
        {
            throw new Test.RetryException();
        }
    }
Esempio n. 7
0
 public override void opMyStruct1_async(Test.AMD_MyDerivedClass_opMyStruct1 cb, Test.MyStruct1 value,
                                        Ice.Current current)
 {
     cb.ice_response(value);
 }
Esempio n. 8
0
 public override void opStringS2_async(Test.AMD_MyClass_opStringS2 cb, string[] value, Ice.Current current)
 {
     cb.ice_response(value);
 }
Esempio n. 9
0
 public override void opFloat1_async(Test.AMD_MyClass_opFloat1 cb, float value, Ice.Current current)
 {
     cb.ice_response(value);
 }
Esempio n. 10
0
 public override void opDerived_async(Test.AMD_MyDerivedClass_opDerived cb, Ice.Current current)
 {
     cb.ice_response();
 }
Esempio n. 11
0
 public override void opIdempotent_async(Test.AMD_MyClass_opIdempotent cb, Ice.Current current)
 {
     test(current.mode == Ice.OperationMode.Idempotent);
     cb.ice_response();
 }
Esempio n. 12
0
 public override void opStringStringD_async(Test.AMD_MyClass_opStringStringD cb, Dictionary<string, string> p1,
                                            Dictionary<string, string> p2, Ice.Current current)
 {
     Dictionary<string, string> p3 = p1;
     Dictionary<string, string> r = new Dictionary<string, string>();
     foreach(KeyValuePair<string, string> e in p1)
     {
         r[e.Key] = e.Value;
     }
     foreach(KeyValuePair<string, string> e in p2)
     {
         r[e.Key] = e.Value;
     }
     cb.ice_response(r, p3);
 }
Esempio n. 13
0
 public override void opString_async(Test.AMD_MyClass_opString cb, string p1, string p2, Ice.Current current)
 {
     cb.ice_response(p1 + " " + p2, p2 + " " + p1);
 }
Esempio n. 14
0
    public override void opShortIntLongSS_async(Test.AMD_MyClass_opShortIntLongSS cb, short[][] p1,
                                                int[][] p2, long[][] p3, Ice.Current current)
    {
        short[][] p4 = p1;

        int[][] p5 = new int[p2.Length][];
        for(int i = 0; i < p2.Length; i++)
        {
            p5[i] = p2[p2.Length - (i + 1)];
        }

        long[][] p6 = new long[p3.Length + p3.Length][];
        Array.Copy(p3, p6, p3.Length);
        Array.Copy(p3, 0, p6, p3.Length, p3.Length);
        cb.ice_response(p3, p4, p5, p6);
    }
Esempio n. 15
0
 public override void opShortIntLong_async(Test.AMD_MyClass_opShortIntLong cb, short p1, int p2, long p3,
                                           Ice.Current current)
 {
     cb.ice_response(p3, p1, p2, p3);
 }
Esempio n. 16
0
 public override void opDoubleMarshaling_async(Test.AMD_MyClass_opDoubleMarshaling cb, double p1, double[] p2,
                                               Ice.Current current)
 {
     double d = 1278312346.0 / 13.0;
     test(p1 == d);
     for(int i = 0; i < p2.Length; ++i)
     {
         test(p2[i] == d);
     }
     cb.ice_response();
 }
Esempio n. 17
0
    public override void opStringSSS_async(Test.AMD_MyClass_opStringSSS cb, string[][][] p1, string[][][] p2,
                                           Ice.Current current)
    {
        string[][][] p3 = new string[p1.Length + p2.Length][][];
        Array.Copy(p1, p3, p1.Length);
        Array.Copy(p2, 0, p3, p1.Length, p2.Length);

        string[][][] r = new string[p2.Length][][];
        for(int i = 0; i < p2.Length; i++)
        {
            r[i] = p2[p2.Length - (i + 1)];
        }
        cb.ice_response(r, p3);
    }
Esempio n. 18
0
 public override void opMyStructMyEnumD_async(Test.AMD_MyClass_opMyStructMyEnumD cb,
                                              Dictionary<Test.MyStruct, Test.MyEnum> p1,
                                              Dictionary<Test.MyStruct, Test.MyEnum> p2, Ice.Current current)
 {
     Dictionary<Test.MyStruct, Test.MyEnum> p3 = p1;
     Dictionary<Test.MyStruct, Test.MyEnum> r = new Dictionary<Test.MyStruct, Test.MyEnum>();
     foreach(KeyValuePair<Test.MyStruct, Test.MyEnum> e in p1)
     {
         r[e.Key] = e.Value;
     }
     foreach(KeyValuePair<Test.MyStruct, Test.MyEnum> e in p2)
     {
         r[e.Key] = e.Value;
     }
     cb.ice_response(r, p3);
 }
Esempio n. 19
0
 public override void opStruct_async(Test.AMD_MyClass_opStruct cb, Test.Structure p1, Test.Structure p2,
                                     Ice.Current current)
 {
     Test.Structure p3 = p1;
     p3.s.s = "a new string";
     cb.ice_response(p2, p3);
 }
Esempio n. 20
0
    public override void opMyStructMyEnumDS_async(Test.AMD_MyClass_opMyStructMyEnumDS cb,
                                                  Dictionary<Test.MyStruct, Test.MyEnum>[] p1,
                                                  Dictionary<Test.MyStruct, Test.MyEnum>[] p2,
                                                  Ice.Current current)
    {
        Dictionary<Test.MyStruct, Test.MyEnum>[] p3 = new Dictionary<Test.MyStruct, Test.MyEnum>[p1.Length + p2.Length];
        Array.Copy(p2, p3, p2.Length);
        Array.Copy(p1, 0, p3, p2.Length, p1.Length);

        Dictionary<Test.MyStruct, Test.MyEnum>[] r = new Dictionary<Test.MyStruct, Test.MyEnum>[p1.Length];
        for(int i = 0; i < p1.Length; i++)
        {
            r[i] = p1[p1.Length - (i + 1)];
        }
        cb.ice_response(r,p3);
    }
Esempio n. 21
0
 public override void opNonmutating_async(Test.AMD_MyClass_opNonmutating cb, Ice.Current current)
 {
     test(current.mode == Ice.OperationMode.Nonmutating);
     cb.ice_response();
 }
Esempio n. 22
0
 public override void opMyEnumMyEnumSD_async(Test.AMD_MyClass_opMyEnumMyEnumSD cb,
                                             Dictionary<Test.MyEnum, Test.MyEnum[]> p1,
                                             Dictionary<Test.MyEnum, Test.MyEnum[]> p2,
                                             Ice.Current ice)
 {
     Dictionary<Test.MyEnum, Test.MyEnum[]> p3 = p2;
     Dictionary<Test.MyEnum, Test.MyEnum[]> r = new Dictionary<Test.MyEnum, Test.MyEnum[]>();
     foreach(KeyValuePair<Test.MyEnum, Test.MyEnum[]> e in p1)
     {
         r[e.Key] = e.Value;
     }
     foreach(KeyValuePair<Test.MyEnum, Test.MyEnum[]> e in p2)
     {
         r[e.Key] = e.Value;
     }
     cb.ice_response(r,p3);
 }
Esempio n. 23
0
 public override void opLong1_async(Test.AMD_MyClass_opLong1 cb, long value, Ice.Current current)
 {
     cb.ice_response(value);
 }
Esempio n. 24
0
 public override void opIntS_async(Test.AMD_MyClass_opIntS cb, int[] s, Ice.Current current)
 {
     int[] r = new int[s.Length];
     for(int i = 0; i < s.Length; ++i)
     {
         r[i] = -s[i];
     }
     cb.ice_response(r);
 }
Esempio n. 25
0
 public override void opDouble1_async(Test.AMD_MyClass_opDouble1 cb, double value, Ice.Current current)
 {
     cb.ice_response(value);
 }
Esempio n. 26
0
 public override void opContext_async(Test.AMD_MyClass_opContext cb, Ice.Current current)
 {
     cb.ice_response(current.ctx);
 }
Esempio n. 27
0
 public override void opByteBoolD2_async(Test.AMD_MyClass_opByteBoolD2 cb, Dictionary<byte, bool> value,
                                         Ice.Current current)
 {
     cb.ice_response(value);
 }
Esempio n. 28
0
 public override void opByteSOneway_async(Test.AMD_MyClass_opByteSOneway cb, byte[] s, Ice.Current current)
 {
     lock(this)
     {
         ++_opByteSOnewayCallCount;
     }
     cb.ice_response();
 }
Esempio n. 29
0
 public override void delay_async(Test.AMD_MyClass_delay cb, int ms, Ice.Current current)
 {
     System.Threading.Thread.Sleep(ms);
     cb.ice_response();
 }
Esempio n. 30
0
 public override void opByteSOnewayCallCount_async(Test.AMD_MyClass_opByteSOnewayCallCount cb, Ice.Current current)
 {
     lock(this)
     {
         int count = _opByteSOnewayCallCount;
         _opByteSOnewayCallCount = 0;
         cb.ice_response(count);
     }
 }