summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/LocatorI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2002-06-28 19:20:18 +0000
committerBenoit Foucher <benoit@zeroc.com>2002-06-28 19:20:18 +0000
commit75ac12c02d537f38b03567e406cbeccf29226fe0 (patch)
tree4add4682e2aa8edd9c58f1a23ad3f0ccc8336d02 /cpp/src/IcePack/LocatorI.cpp
parentReplaced invalid struct name Struct with Structure. (diff)
downloadice-75ac12c02d537f38b03567e406cbeccf29226fe0.tar.bz2
ice-75ac12c02d537f38b03567e406cbeccf29226fe0.tar.xz
ice-75ac12c02d537f38b03567e406cbeccf29226fe0.zip
Merged location branch.
Diffstat (limited to 'cpp/src/IcePack/LocatorI.cpp')
-rw-r--r--cpp/src/IcePack/LocatorI.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/cpp/src/IcePack/LocatorI.cpp b/cpp/src/IcePack/LocatorI.cpp
new file mode 100644
index 00000000000..28e62fa48f3
--- /dev/null
+++ b/cpp/src/IcePack/LocatorI.cpp
@@ -0,0 +1,51 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+
+#include <IcePack/AdapterManager.h>
+#include <IcePack/LocatorI.h>
+
+using namespace std;
+using namespace Ice;
+using namespace IcePack;
+
+IcePack::LocatorI::LocatorI(const AdapterManagerPrx& adapters, const LocatorRegistryPrx& registry) :
+ _adapters(adapters),
+ _registry(registry)
+{
+}
+
+Ice::ObjectPrx
+IcePack::LocatorI::findAdapterByName(const string& name, const Current&)
+{
+ try
+ {
+ AdapterPrx adapter = _adapters->findByName(name);
+ if(adapter)
+ {
+ return adapter->getDirectProxy(true);
+ }
+ }
+ catch (const AdapterActivationTimeoutException&)
+ {
+ }
+ catch (const ObjectNotExistException&)
+ {
+ }
+
+ return 0;
+}
+
+Ice::LocatorRegistryPrx
+IcePack::LocatorI::getRegistry(const Current&)
+{
+ return _registry;
+}