summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/ObjectAdapter.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-09-19 07:00:13 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-09-19 07:00:13 +0000
commit3fd5c8c4ce1c04fc1a55e859d17cc79ca7a0a770 (patch)
tree02a62bd5cacbbe9740ff56c9fbf47cb3d46ecbc1 /py/modules/IcePy/ObjectAdapter.cpp
parenthttp://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=435. added (diff)
downloadice-3fd5c8c4ce1c04fc1a55e859d17cc79ca7a0a770.tar.bz2
ice-3fd5c8c4ce1c04fc1a55e859d17cc79ca7a0a770.tar.xz
ice-3fd5c8c4ce1c04fc1a55e859d17cc79ca7a0a770.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=459
Diffstat (limited to 'py/modules/IcePy/ObjectAdapter.cpp')
-rw-r--r--py/modules/IcePy/ObjectAdapter.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/py/modules/IcePy/ObjectAdapter.cpp b/py/modules/IcePy/ObjectAdapter.cpp
index 0e9831c53ab..3ddf84a197b 100644
--- a/py/modules/IcePy/ObjectAdapter.cpp
+++ b/py/modules/IcePy/ObjectAdapter.cpp
@@ -1264,6 +1264,37 @@ adapterAddRouter(ObjectAdapterObject* self, PyObject* args)
extern "C"
#endif
static PyObject*
+adapterRemoveRouter(ObjectAdapterObject* self, PyObject* args)
+{
+ PyObject* proxyType = lookupType("Ice.RouterPrx");
+ PyObject* proxy;
+ if(!PyArg_ParseTuple(args, STRCAST("O!"), proxyType, &proxy))
+ {
+ return NULL;
+ }
+
+ Ice::RouterPrx router = Ice::RouterPrx::uncheckedCast(getProxy(proxy));
+
+ assert(self->adapter);
+ try
+ {
+ AllowThreads allowThreads; // Release Python's global interpreter lock during blocking calls.
+ (*self->adapter)->removeRouter(router);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ setPythonException(ex);
+ return NULL;
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+#ifdef WIN32
+extern "C"
+#endif
+static PyObject*
adapterSetLocator(ObjectAdapterObject* self, PyObject* args)
{
PyObject* proxyType = lookupType("Ice.LocatorPrx");
@@ -1341,6 +1372,8 @@ static PyMethodDef AdapterMethods[] =
PyDoc_STR(STRCAST("createReverseProxy(identity) -> Ice.ObjectPrx")) },
{ STRCAST("addRouter"), (PyCFunction)adapterAddRouter, METH_VARARGS,
PyDoc_STR(STRCAST("addRouter(proxy) -> None")) },
+ { STRCAST("removeRouter"), (PyCFunction)adapterRemoveRouter, METH_VARARGS,
+ PyDoc_STR(STRCAST("removeaddRouter(proxy) -> None")) },
{ STRCAST("setLocator"), (PyCFunction)adapterSetLocator, METH_VARARGS,
PyDoc_STR(STRCAST("setLocator(proxy) -> None")) },
{ NULL, NULL} /* sentinel */