summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/NodeI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/NodeI.cpp')
-rw-r--r--cpp/src/IceGrid/NodeI.cpp66
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()
{
}