diff options
Diffstat (limited to 'csharp/test/Ice/servantLocator/TestAMDI.cs')
-rw-r--r-- | csharp/test/Ice/servantLocator/TestAMDI.cs | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/csharp/test/Ice/servantLocator/TestAMDI.cs b/csharp/test/Ice/servantLocator/TestAMDI.cs index 4f167c47382..3114d3486a7 100644 --- a/csharp/test/Ice/servantLocator/TestAMDI.cs +++ b/csharp/test/Ice/servantLocator/TestAMDI.cs @@ -7,58 +7,59 @@ // // ********************************************************************** +using System; +using System.Threading.Tasks; using Test; public sealed class TestI : TestIntfDisp_ { - public override void requestFailedException_async(AMD_TestIntf_requestFailedException cb, Ice.Current current) + public override Task requestFailedExceptionAsync(Ice.Current current) { - cb.ice_response(); + return null; } - public override void unknownUserException_async(AMD_TestIntf_unknownUserException cb, Ice.Current current) + public override Task unknownUserExceptionAsync(Ice.Current current) { - cb.ice_response(); + return null; } - public override void unknownLocalException_async(AMD_TestIntf_unknownLocalException cb, Ice.Current current) + public override Task unknownLocalExceptionAsync(Ice.Current current) { - cb.ice_response(); + return null; } - public override void unknownException_async(AMD_TestIntf_unknownException cb, Ice.Current current) + public override Task unknownExceptionAsync(Ice.Current current) { - cb.ice_response(); + return null; } - public override void localException_async(AMD_TestIntf_localException cb, Ice.Current current) + public override Task localExceptionAsync(Ice.Current current) { - cb.ice_response(); + return null; } - public override void userException_async(AMD_TestIntf_userException cb, Ice.Current current) + public override Task userExceptionAsync(Ice.Current current) { - cb.ice_response(); + return null; } - public override void csException_async(AMD_TestIntf_csException cb, Ice.Current current) + public override Task csExceptionAsync(Ice.Current current) { - cb.ice_response(); + return null; } - public override void - unknownExceptionWithServantException_async(AMD_TestIntf_unknownExceptionWithServantException cb, - Ice.Current current) + public override Task + unknownExceptionWithServantExceptionAsync(Ice.Current current) { - cb.ice_exception(new Ice.ObjectNotExistException()); + throw new Ice.ObjectNotExistException(); } - public override void impossibleException_async(AMD_TestIntf_impossibleException cb, bool @throw, - Ice.Current current) + public override Task<string> + impossibleExceptionAsync(bool @throw, Ice.Current current) { if(@throw) { - cb.ice_exception(new Test.TestImpossibleException()); + throw new TestImpossibleException(); } else { @@ -66,15 +67,16 @@ public sealed class TestI : TestIntfDisp_ // Return a value so we can be sure that the stream position // is reset correctly iuf finished throws. // - cb.ice_response("Hello"); + return Task.FromResult<string>("Hello"); } } - public override void intfUserException_async(AMD_TestIntf_intfUserException cb, bool @throw, Ice.Current current) + public override Task<string> + intfUserExceptionAsync(bool @throw, Ice.Current current) { if(@throw) { - cb.ice_exception(new Test.TestIntfUserException()); + throw new TestIntfUserException(); } else { @@ -82,25 +84,25 @@ public sealed class TestI : TestIntfDisp_ // Return a value so we can be sure that the stream position // is reset correctly iuf finished throws. // - cb.ice_response("Hello"); + return Task.FromResult<string>("Hello"); } } - public override void asyncResponse_async(AMD_TestIntf_asyncResponse cb, Ice.Current current) + public override Task asyncResponseAsync(Ice.Current current) { - cb.ice_response(); - throw new Ice.ObjectNotExistException(); + return null; + throw new Ice.ObjectNotExistException(); } - public override void asyncException_async(AMD_TestIntf_asyncException cb, Ice.Current current) + public override Task asyncExceptionAsync(Ice.Current current) { - cb.ice_exception(new Test.TestIntfUserException()); + throw new TestIntfUserException(); throw new Ice.ObjectNotExistException(); } - public override void shutdown_async(AMD_TestIntf_shutdown cb, Ice.Current current) + public override Task shutdownAsync(Ice.Current current) { current.adapter.deactivate(); - cb.ice_response(); + return null; } } |