diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-09-10 08:47:58 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-09-10 08:47:58 +0200 |
commit | 9560b7d54ec4411f0605a3b53997835599f70ea2 (patch) | |
tree | c40611c772a7a4f1af4ea0df5d487305dded456d /cpp/src/Ice/ObserverHelper.cpp | |
parent | Fix (diff) | |
download | ice-9560b7d54ec4411f0605a3b53997835599f70ea2.tar.bz2 ice-9560b7d54ec4411f0605a3b53997835599f70ea2.tar.xz ice-9560b7d54ec4411f0605a3b53997835599f70ea2.zip |
Fixed communicator flushBatchRequests to allow tracing
Diffstat (limited to 'cpp/src/Ice/ObserverHelper.cpp')
-rw-r--r-- | cpp/src/Ice/ObserverHelper.cpp | 83 |
1 files changed, 52 insertions, 31 deletions
diff --git a/cpp/src/Ice/ObserverHelper.cpp b/cpp/src/Ice/ObserverHelper.cpp index c4406dd088b..32c162395b1 100644 --- a/cpp/src/Ice/ObserverHelper.cpp +++ b/cpp/src/Ice/ObserverHelper.cpp @@ -15,43 +15,64 @@ using namespace std; using namespace Ice; -using namespace IceInternal; +using namespace Ice::Instrumentation; -InvocationObserver::InvocationObserver(IceProxy::Ice::Object* proxy, const string& operation, const Context* context) +IceInternal::InvocationObserver::InvocationObserver(IceProxy::Ice::Object* proxy, const string& op, const Context* ctx) { - const Ice::Instrumentation::CommunicatorObserverPtr& obsv = - proxy->__reference()->getInstance()->initializationData().observer; - if(obsv) - { - if(context) - { - ObserverHelperT<Ice::Instrumentation::InvocationObserver>::attach( - obsv->getInvocationObserverWithContext(proxy, operation, *context)); - } - else - { - ObserverHelperT<Ice::Instrumentation::InvocationObserver>::attach( - obsv->getInvocationObserver(proxy, operation)); - } + const CommunicatorObserverPtr& obsv = proxy->__reference()->getInstance()->initializationData().observer; + if(!obsv) + { + return; + } + + if(ctx) + { + attach(obsv->getInvocationObserverWithContext(proxy, op, *ctx)); + } + else + { + attach(obsv->getInvocationObserver(proxy, op)); } } +IceInternal::InvocationObserver::InvocationObserver(IceInternal::Instance* instance, const string& op) +{ + const CommunicatorObserverPtr& obsv = instance->initializationData().observer; + if(!obsv) + { + return; + } + + attach(obsv->getInvocationObserver(0, op)); +} + void -InvocationObserver::attach(IceProxy::Ice::Object* proxy, const string& operation, const Context* context) +IceInternal::InvocationObserver::attach(IceProxy::Ice::Object* proxy, const string& op, const Context* ctx) { - const Ice::Instrumentation::CommunicatorObserverPtr& obsv = - proxy->__reference()->getInstance()->initializationData().observer; - if(obsv) - { - if(context) - { - ObserverHelperT<Ice::Instrumentation::InvocationObserver>::attach( - obsv->getInvocationObserverWithContext(proxy, operation, *context)); - } - else - { - ObserverHelperT<Ice::Instrumentation::InvocationObserver>::attach( - obsv->getInvocationObserver(proxy, operation)); - } + const CommunicatorObserverPtr& obsv = proxy->__reference()->getInstance()->initializationData().observer; + if(!obsv) + { + return; } + + if(ctx) + { + attach(obsv->getInvocationObserverWithContext(proxy, op, *ctx)); + } + else + { + attach(obsv->getInvocationObserver(proxy, op)); + } +} + +void +IceInternal::InvocationObserver::attach(IceInternal::Instance* instance, const string& op) +{ + const CommunicatorObserverPtr& obsv = instance->initializationData().observer; + if(!obsv) + { + return; + } + + attach(obsv->getInvocationObserver(0, op)); } |