summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ObserverHelper.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2012-08-08 15:22:27 +0200
committerBenoit Foucher <benoit@zeroc.com>2012-08-08 15:22:27 +0200
commitb9e90a9c390c55244a65472ef93d01baefca8c4d (patch)
treead338ae8f6e79297ccf61b7523261e4680492474 /cpp/src/Ice/ObserverHelper.cpp
parentMerge remote-tracking branch 'origin/encoding11' into mx (diff)
downloadice-b9e90a9c390c55244a65472ef93d01baefca8c4d.tar.bz2
ice-b9e90a9c390c55244a65472ef93d01baefca8c4d.tar.xz
ice-b9e90a9c390c55244a65472ef93d01baefca8c4d.zip
Fixes
Diffstat (limited to 'cpp/src/Ice/ObserverHelper.cpp')
-rw-r--r--cpp/src/Ice/ObserverHelper.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/cpp/src/Ice/ObserverHelper.cpp b/cpp/src/Ice/ObserverHelper.cpp
index 6507da82287..93ea3cca669 100644
--- a/cpp/src/Ice/ObserverHelper.cpp
+++ b/cpp/src/Ice/ObserverHelper.cpp
@@ -9,7 +9,12 @@
#include <Ice/ObserverHelper.h>
#include <Ice/Observer.h>
+#include <Ice/Reference.h>
+#include <Ice/Instance.h>
+#include <Ice/Proxy.h>
+using namespace std;
+using namespace Ice;
using namespace IceInternal;
void
@@ -30,3 +35,38 @@ ObserverHelper::failed(const Ice::Instrumentation::ObserverPtr& observer, const
observer->failed(exceptionName);
}
+InvocationObserver::InvocationObserver(IceProxy::Ice::Object* proxy, const string& operation, const Context* context)
+{
+ if(proxy->__reference()->getInstance()->initializationData().observerResolver)
+ {
+ attach(proxy, operation, context);
+ }
+}
+
+InvocationObserver::InvocationObserver()
+{
+}
+
+void
+InvocationObserver::attach(IceProxy::Ice::Object* proxy, const string& operation, const Context* context)
+{
+ const Ice::Instrumentation::ObserverResolverPtr& resolver =
+ proxy->__reference()->getInstance()->initializationData().observerResolver;
+ if(resolver)
+ {
+ if(context)
+ {
+ ObserverHelperT::attach(resolver->getInvocationObserverWithContext(proxy, operation, *context));
+ }
+ else
+ {
+ ObserverHelperT::attach(resolver->getInvocationObserver(proxy, operation));
+ }
+ }
+}
+
+void
+InvocationObserver::retryImpl()
+{
+ _observer->retried();
+}