summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/AdapterI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-04-01 15:42:10 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-04-01 15:42:10 +0000
commitf496752b90c2d5c9099b7dbca383bd30820a6ebd (patch)
treedaba3e307aea127eccb2b1c50fe9353f18f1ca05 /cpp/src/IceGrid/AdapterI.cpp
parentObjectNotExistException is now retried. (diff)
downloadice-f496752b90c2d5c9099b7dbca383bd30820a6ebd.tar.bz2
ice-f496752b90c2d5c9099b7dbca383bd30820a6ebd.tar.xz
ice-f496752b90c2d5c9099b7dbca383bd30820a6ebd.zip
Copied IcePack code to IceGrid.
Diffstat (limited to 'cpp/src/IceGrid/AdapterI.cpp')
-rw-r--r--cpp/src/IceGrid/AdapterI.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/cpp/src/IceGrid/AdapterI.cpp b/cpp/src/IceGrid/AdapterI.cpp
new file mode 100644
index 00000000000..c588c2846f1
--- /dev/null
+++ b/cpp/src/IceGrid/AdapterI.cpp
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <IceGrid/AdapterI.h>
+#include <IceGrid/AdapterFactory.h>
+#include <IceGrid/TraceLevels.h>
+
+using namespace std;
+using namespace IceGrid;
+
+StandaloneAdapterI::StandaloneAdapterI(const AdapterFactoryPtr& factory) :
+ _factory(factory)
+{
+}
+
+StandaloneAdapterI::StandaloneAdapterI()
+{
+}
+
+void
+StandaloneAdapterI::activate_async(const AMD_Adapter_activatePtr& cb, const Ice::Current&)
+{
+ IceUtil::Mutex::Lock sync(*this);
+ cb->ice_response(proxy);
+}
+
+Ice::ObjectPrx
+StandaloneAdapterI::getDirectProxy(const Ice::Current&) const
+{
+ IceUtil::Mutex::Lock sync(*this);
+ return proxy;
+}
+
+void
+StandaloneAdapterI::setDirectProxy(const Ice::ObjectPrx& prx, const Ice::Current&)
+{
+ IceUtil::Mutex::Lock sync(*this);
+ proxy = prx;
+}
+
+void
+StandaloneAdapterI::destroy(const Ice::Current& current)
+{
+ if(_factory)
+ {
+ _factory->destroy(current.id);
+ }
+}