diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/CHANGES | 4 | ||||
-rw-r--r-- | cpp/slice/Ice/Communicator.ice | 11 | ||||
-rw-r--r-- | cpp/slice/Ice/ObjectAdapter.ice | 11 | ||||
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/CommunicatorI.h | 1 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterFactory.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterFactory.h | 1 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/ObjectAdapterI.h | 1 |
9 files changed, 51 insertions, 0 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES index e3698c7bb70..07a95f73156 100644 --- a/cpp/CHANGES +++ b/cpp/CHANGES @@ -1,6 +1,10 @@ Changes since version 3.1.1 --------------------------- +- Added Communicator::isShutdown() and ObjectAdapter::isDeactivated() to + allow applications to determine, respectively, whether communicator has + been shutdown or object adapter has been deactivated. + - The Glacier2 SessionControl object is now registered with the Server adapter rather than the Admin adapter. diff --git a/cpp/slice/Ice/Communicator.ice b/cpp/slice/Ice/Communicator.ice index 35cf5abc5b1..f7c1e5f1ad7 100644 --- a/cpp/slice/Ice/Communicator.ice +++ b/cpp/slice/Ice/Communicator.ice @@ -102,6 +102,17 @@ local interface Communicator /** * + * Check whether communicator has been shutdown. + * + * @return Whether communicator has been shutdown. + * + * @see shutdown + * + **/ + ["cpp:const"] bool isShutdown(); + + /** + * * Convert a string into a proxy. For example, * <tt>MyCategory/MyObject:tcp -h some_host -p * 10000</tt> creates a proxy that refers to the Ice object diff --git a/cpp/slice/Ice/ObjectAdapter.ice b/cpp/slice/Ice/ObjectAdapter.ice index 247986b44da..87d61ef99da 100644 --- a/cpp/slice/Ice/ObjectAdapter.ice +++ b/cpp/slice/Ice/ObjectAdapter.ice @@ -141,6 +141,17 @@ local interface ObjectAdapter /** * + * Check whether object adapter has been deacivated. + * + * @return Whether adapter has been deactivated. + * + * @see shutdown + * + **/ + ["cpp:const"] bool isDeactivated(); + + /** + * * Destroys the object adapter and cleans up all resources * held by the object adapter. If object adapter has not yet * been deactivated, [destroy] implicitly initiates the diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index 1bdeb18fc40..2c759c91951 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -118,6 +118,12 @@ Ice::CommunicatorI::waitForShutdown() _instance->objectAdapterFactory()->waitForShutdown(); } +bool +Ice::CommunicatorI::isShutdown() const +{ + return _instance->objectAdapterFactory()->isShutdown(); +} + ObjectPrx Ice::CommunicatorI::stringToProxy(const string& s) const { diff --git a/cpp/src/Ice/CommunicatorI.h b/cpp/src/Ice/CommunicatorI.h index 0c0d6a0e985..47ba36d4304 100644 --- a/cpp/src/Ice/CommunicatorI.h +++ b/cpp/src/Ice/CommunicatorI.h @@ -27,6 +27,7 @@ public: virtual void destroy(); virtual void shutdown(); virtual void waitForShutdown(); + virtual bool isShutdown() const; virtual ObjectPrx stringToProxy(const std::string&) const; virtual std::string proxyToString(const ObjectPrx&) const; diff --git a/cpp/src/Ice/ObjectAdapterFactory.cpp b/cpp/src/Ice/ObjectAdapterFactory.cpp index bbd67ffd6eb..30b233482fd 100644 --- a/cpp/src/Ice/ObjectAdapterFactory.cpp +++ b/cpp/src/Ice/ObjectAdapterFactory.cpp @@ -95,6 +95,14 @@ IceInternal::ObjectAdapterFactory::waitForShutdown() } } +bool +IceInternal::ObjectAdapterFactory::isShutdown() const +{ + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); + + return _instance == 0; +} + void IceInternal::ObjectAdapterFactory::destroy() { diff --git a/cpp/src/Ice/ObjectAdapterFactory.h b/cpp/src/Ice/ObjectAdapterFactory.h index 5d35df6a568..e92d2c01916 100644 --- a/cpp/src/Ice/ObjectAdapterFactory.h +++ b/cpp/src/Ice/ObjectAdapterFactory.h @@ -23,6 +23,7 @@ public: void shutdown(); void waitForShutdown(); + bool isShutdown() const; void destroy(); ::Ice::ObjectAdapterPtr createObjectAdapter(const std::string&, const std::string&, const Ice::RouterPrx&); diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp index 4ad993dbe06..f9eb4e989d5 100644 --- a/cpp/src/Ice/ObjectAdapterI.cpp +++ b/cpp/src/Ice/ObjectAdapterI.cpp @@ -287,6 +287,14 @@ Ice::ObjectAdapterI::waitForDeactivate() Ice::voidMemFun(&IncomingConnectionFactory::waitUntilFinished)); } +bool +Ice::ObjectAdapterI::isDeactivated() const +{ + IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this); + + return _deactivated; +} + void Ice::ObjectAdapterI::destroy() { diff --git a/cpp/src/Ice/ObjectAdapterI.h b/cpp/src/Ice/ObjectAdapterI.h index d13e63d346e..40d8ba01a6f 100644 --- a/cpp/src/Ice/ObjectAdapterI.h +++ b/cpp/src/Ice/ObjectAdapterI.h @@ -49,6 +49,7 @@ public: virtual void waitForHold(); virtual void deactivate(); virtual void waitForDeactivate(); + virtual bool isDeactivated() const; virtual void destroy(); virtual ObjectPrx add(const ObjectPtr&, const Identity&); |