summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ObserverHelper.cpp
diff options
context:
space:
mode:
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();
+}