diff options
Diffstat (limited to 'python/test/Ice/binding/TestI.py')
-rw-r--r-- | python/test/Ice/binding/TestI.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/python/test/Ice/binding/TestI.py b/python/test/Ice/binding/TestI.py new file mode 100644 index 00000000000..c24cf074c4b --- /dev/null +++ b/python/test/Ice/binding/TestI.py @@ -0,0 +1,42 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +import Ice, Test + +class RemoteCommunicatorI(Test.RemoteCommunicator): + def createObjectAdapter(self, name, endpoints, current=None): + com = current.adapter.getCommunicator() + com.getProperties().setProperty(name + ".ThreadPool.Size", "1") + adapter = com.createObjectAdapterWithEndpoints(name, endpoints) + return Test.RemoteObjectAdapterPrx.uncheckedCast(current.adapter.addWithUUID(RemoteObjectAdapterI(adapter))) + + def deactivateObjectAdapter(self, adapter, current=None): + adapter.deactivate() + + def shutdown(self, current=None): + current.adapter.getCommunicator().shutdown() + +class RemoteObjectAdapterI(Test.RemoteObjectAdapter): + def __init__(self, adapter): + self._adapter = adapter + self._testIntf = Test.TestIntfPrx.uncheckedCast(self._adapter.add(TestI(), adapter.getCommunicator().stringToIdentity("test"))) + self._adapter.activate() + + def getTestIntf(self, current=None): + return self._testIntf + + def deactivate(self, current=None): + try: + self._adapter.destroy() + except Ice.ObjectAdapterDeactivatedException: + pass + +class TestI(Test.TestIntf): + def getAdapterName(self, current=None): + return current.adapter.getName() |