diff options
author | Jose <jose@zeroc.com> | 2012-08-14 00:05:17 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-08-14 00:05:17 +0200 |
commit | b3a890faf5841289df3299bac6ada7120b324c16 (patch) | |
tree | eacdb167a4d1e6310bfd49827f90fb2ddf2c144a /cpp/src/IceGrid/NodeI.cpp | |
parent | missing filter properties (diff) | |
download | ice-b3a890faf5841289df3299bac6ada7120b324c16.tar.bz2 ice-b3a890faf5841289df3299bac6ada7120b324c16.tar.xz ice-b3a890faf5841289df3299bac6ada7120b324c16.zip |
ICE-4809 - AMI metadata in Ice services internal definitions
Diffstat (limited to 'cpp/src/IceGrid/NodeI.cpp')
-rw-r--r-- | cpp/src/IceGrid/NodeI.cpp | 66 |
1 files changed, 24 insertions, 42 deletions
diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index 2a44b98dbdb..ed33cc0fd36 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -188,7 +188,7 @@ private: string _dest; }; -class NodeUp : public NodeI::Update, public AMI_NodeObserver_nodeUp +class NodeUp : public NodeI::Update { public: @@ -202,7 +202,7 @@ public: { try { - _observer->nodeUp_async(this, _info); + _observer->begin_nodeUp(_info, newCallback(static_cast<NodeI::Update*>(this), &NodeI::Update::completed)); } catch(const Ice::LocalException&) { @@ -210,25 +210,13 @@ public: } return true; } - - virtual void - ice_response() - { - finished(true); - } - - virtual void - ice_exception(const Ice::Exception&) - { - finished(false); - } private: NodeDynamicInfo _info; }; -class UpdateServer : public NodeI::Update, public AMI_NodeObserver_updateServer +class UpdateServer : public NodeI::Update { public: @@ -242,7 +230,9 @@ public: { try { - _observer->updateServer_async(this, _node->getName(), _info); + _observer->begin_updateServer(_node->getName(), + _info, + newCallback(static_cast<NodeI::Update*>(this), &NodeI::Update::completed)); } catch(const Ice::LocalException&) { @@ -250,25 +240,13 @@ public: } return true; } - - virtual void - ice_response() - { - finished(true); - } - - virtual void - ice_exception(const Ice::Exception&) - { - finished(false); - } private: ServerDynamicInfo _info; }; -class UpdateAdapter : public NodeI::Update, public AMI_NodeObserver_updateAdapter +class UpdateAdapter : public NodeI::Update { public: @@ -282,7 +260,9 @@ public: { try { - _observer->updateAdapter_async(this, _node->getName(), _info); + _observer->begin_updateAdapter(_node->getName(), + _info, + newCallback(static_cast<NodeI::Update*>(this), &NodeI::Update::completed)); } catch(const Ice::LocalException&) { @@ -290,18 +270,6 @@ public: } return true; } - - virtual void - ice_response() - { - finished(true); - } - - virtual void - ice_exception(const Ice::Exception&) - { - finished(false); - } private: @@ -384,6 +352,20 @@ NodeI::NodeI(const Ice::ObjectAdapterPtr& adapter, } } +void +NodeI::Update::completed(const Ice::AsyncResultPtr& result) +{ + try + { + result->throwLocalException(); + finished(true); + } + catch(const Ice::LocalException& ex) + { + finished(false); + } +} + NodeI::~NodeI() { } |