summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/QueryI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-11-09 10:20:21 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-11-09 10:20:21 +0000
commitea30fa78f02c20b4707ec0df9efd7d3177c0cc59 (patch)
treeabd4e0ff8540b7d86f77b030418756053333874a /cpp/src/IceGrid/QueryI.cpp
parentRemoved current status from adapters in templates (diff)
downloadice-ea30fa78f02c20b4707ec0df9efd7d3177c0cc59.tar.bz2
ice-ea30fa78f02c20b4707ec0df9efd7d3177c0cc59.tar.xz
ice-ea30fa78f02c20b4707ec0df9efd7d3177c0cc59.zip
Changed IceGrid::Query interface.
Diffstat (limited to 'cpp/src/IceGrid/QueryI.cpp')
-rw-r--r--cpp/src/IceGrid/QueryI.cpp38
1 files changed, 33 insertions, 5 deletions
diff --git a/cpp/src/IceGrid/QueryI.cpp b/cpp/src/IceGrid/QueryI.cpp
index 7f9a2bc27bd..38b27f073c6 100644
--- a/cpp/src/IceGrid/QueryI.cpp
+++ b/cpp/src/IceGrid/QueryI.cpp
@@ -28,25 +28,53 @@ QueryI::~QueryI()
Ice::ObjectPrx
QueryI::findObjectById(const Ice::Identity& id, const Ice::Current&) const
{
- return _database->getObjectProxy(id);
+ try
+ {
+ return _database->getObjectProxy(id);
+ }
+ catch(const ObjectNotRegisteredException&)
+ {
+ return 0;
+ }
}
Ice::ObjectPrx
QueryI::findObjectByType(const string& type, const Ice::Current&) const
{
- return _database->getObjectByType(type);
+ try
+ {
+ return _database->getObjectByType(type);
+ }
+ catch(const ObjectNotRegisteredException&)
+ {
+ return 0;
+ }
}
Ice::ObjectPrx
QueryI::findObjectByTypeOnLeastLoadedNode(const string& type, LoadSample sample, const Ice::Current&) const
{
- return _database->getObjectByTypeOnLeastLoadedNode(type, sample);
+ try
+ {
+ return _database->getObjectByTypeOnLeastLoadedNode(type, sample);
+ }
+ catch(const ObjectNotRegisteredException&)
+ {
+ return 0;
+ }
}
Ice::ObjectProxySeq
-QueryI::findAllObjectsWithType(const string& type, const Ice::Current&) const
+QueryI::findAllObjectsByType(const string& type, const Ice::Current&) const
{
- return _database->getObjectsWithType(type);
+ try
+ {
+ return _database->getObjectsByType(type);
+ }
+ catch(const ObjectNotRegisteredException&)
+ {
+ return Ice::ObjectProxySeq();
+ }
}