diff options
Diffstat (limited to 'cpp/include')
-rw-r--r-- | cpp/include/Ice/ObserverHelper.h | 25 | ||||
-rw-r--r-- | cpp/include/Ice/Outgoing.h | 4 | ||||
-rw-r--r-- | cpp/include/Ice/OutgoingAsync.h | 8 | ||||
-rw-r--r-- | cpp/include/Ice/Proxy.h | 48 |
4 files changed, 57 insertions, 28 deletions
diff --git a/cpp/include/Ice/ObserverHelper.h b/cpp/include/Ice/ObserverHelper.h index 3803b9e5b6a..97b139e9cce 100644 --- a/cpp/include/Ice/ObserverHelper.h +++ b/cpp/include/Ice/ObserverHelper.h @@ -10,7 +10,8 @@ #ifndef ICE_OBSERVERHELPER_H #define ICE_OBSERVERHELPER_H -#include <Ice/ObserverF.h> +#include <Ice/Observer.h> +#include <Ice/ProxyF.h> namespace IceInternal { @@ -99,6 +100,28 @@ protected: TPtr _observer; }; +class InvocationObserver : public ObserverHelperT<Ice::Instrumentation::InvocationObserver> +{ +public: + + InvocationObserver(IceProxy::Ice::Object*, const std::string&, const Ice::Context*); + InvocationObserver(); + + void attach(IceProxy::Ice::Object*, const std::string&, const Ice::Context*); + + void retry() + { + if(_observer) + { + InvocationObserver::retryImpl(); + } + } + +private: + + void retryImpl(); +}; + } #endif diff --git a/cpp/include/Ice/Outgoing.h b/cpp/include/Ice/Outgoing.h index 0f4abee7487..fd1ef681f21 100644 --- a/cpp/include/Ice/Outgoing.h +++ b/cpp/include/Ice/Outgoing.h @@ -77,7 +77,7 @@ class ICE_API Outgoing : public OutgoingMessageCallback { public: - Outgoing(RequestHandler*, const std::string&, Ice::OperationMode, const Ice::Context*); + Outgoing(RequestHandler*, const std::string&, Ice::OperationMode, const Ice::Context*, InvocationObserver&); ~Outgoing(); bool invoke(); // Returns true if ok, false if user exception. @@ -145,7 +145,7 @@ private: // deleted while a stack-allocated Outgoing still holds it. // RequestHandler* _handler; - ObserverHelperT<> _observer; + InvocationObserver& _observer; std::auto_ptr<Ice::LocalException> _exception; diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h index a8c1c13bdd4..2b147ef1cb7 100644 --- a/cpp/include/Ice/OutgoingAsync.h +++ b/cpp/include/Ice/OutgoingAsync.h @@ -21,7 +21,7 @@ #include <Ice/ConnectionIF.h> #include <Ice/Current.h> #include <Ice/BasicStream.h> -#include <Ice/ObserverF.h> +#include <Ice/ObserverHelper.h> #include <memory> @@ -115,7 +115,7 @@ public: static void __check(const AsyncResultPtr&, const Connection*, const ::std::string&); static void __check(const AsyncResultPtr&, const Communicator*, const ::std::string&); - void __exception(const Exception&); // Required to be public for AsynchronousException + virtual void __exception(const Exception&); // Required to be public for AsynchronousException void __sent(); // Required to be public for AsynchronousSent protected: @@ -138,7 +138,7 @@ protected: const std::string& _operation; const IceInternal::CallbackBasePtr _callback; const LocalObjectPtr _cookie; - + IceUtil::Monitor<IceUtil::Mutex> _monitor; IceInternal::BasicStream _is; IceInternal::BasicStream _os; @@ -151,6 +151,7 @@ protected: unsigned char _state; bool _sentSynchronously; std::auto_ptr<Exception> _exception; + IceInternal::InvocationObserver _observer; }; } @@ -295,6 +296,7 @@ public: private: Ice::ObjectPrx _proxy; + IceInternal::InvocationObserver _observer; }; class ICE_API ConnectionBatchOutgoingAsync : public BatchOutgoingAsync diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h index ca179a1d89d..9c99a1a81ae 100644 --- a/cpp/include/Ice/Proxy.h +++ b/cpp/include/Ice/Proxy.h @@ -27,6 +27,7 @@ #include <Ice/Current.h> #include <Ice/StreamF.h> #include <Ice/CommunicatorF.h> +#include <Ice/ObserverHelper.h> #include <iosfwd> namespace IceProxy @@ -601,14 +602,16 @@ public: void end_ice_flushBatchRequests(const ::Ice::AsyncResultPtr&); - ::IceInternal::ReferencePtr __reference() const; + ::IceInternal::ReferencePtr __reference() const { return _reference; } + void __copyFrom(const ::Ice::ObjectPrx&); int __handleException(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>&, const ::Ice::LocalException&, - bool, int&); + bool, int&, ::IceInternal::InvocationObserver&); int __handleExceptionWrapper(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>&, - const ::IceInternal::LocalExceptionWrapper&); + const ::IceInternal::LocalExceptionWrapper&, ::IceInternal::InvocationObserver&); int __handleExceptionWrapperRelaxed(const ::IceInternal::Handle< ::IceDelegate::Ice::Object>&, - const ::IceInternal::LocalExceptionWrapper&, bool, int&); + const ::IceInternal::LocalExceptionWrapper&, bool, int&, + ::IceInternal::InvocationObserver&); void __checkTwowayOnly(const ::std::string&) const; void __checkAsyncTwowayOnly(const ::std::string&) const; @@ -694,14 +697,15 @@ class ICE_API Object : public ::IceUtil::Shared { public: - virtual bool ice_isA(const ::std::string&, const ::Ice::Context*) = 0; - virtual void ice_ping(const ::Ice::Context*) = 0; - virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*) = 0; - virtual ::std::string ice_id(const ::Ice::Context*) = 0; + virtual bool ice_isA(const ::std::string&, const ::Ice::Context*, ::IceInternal::InvocationObserver&) = 0; + virtual void ice_ping(const ::Ice::Context*, ::IceInternal::InvocationObserver&) = 0; + virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*, ::IceInternal::InvocationObserver&) = 0; + virtual ::std::string ice_id(const ::Ice::Context*, ::IceInternal::InvocationObserver&) = 0; virtual bool ice_invoke(const ::std::string&, ::Ice::OperationMode, const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - ::std::vector< ::Ice::Byte>&, const ::Ice::Context*) = 0; - virtual void ice_flushBatchRequests() = 0; + ::std::vector< ::Ice::Byte>&, const ::Ice::Context*, + ::IceInternal::InvocationObserver&) = 0; + virtual void ice_flushBatchRequests(::IceInternal::InvocationObserver&) = 0; virtual ::IceInternal::RequestHandlerPtr __getRequestHandler() const = 0; virtual void __setRequestHandler(const ::IceInternal::RequestHandlerPtr&) = 0; @@ -718,14 +722,14 @@ public: virtual ~Object(); - virtual bool ice_isA(const ::std::string&, const ::Ice::Context*); - virtual void ice_ping(const ::Ice::Context*); - virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*); - virtual ::std::string ice_id(const ::Ice::Context*); + virtual bool ice_isA(const ::std::string&, const ::Ice::Context*, ::IceInternal::InvocationObserver&); + virtual void ice_ping(const ::Ice::Context*, ::IceInternal::InvocationObserver&); + virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*, ::IceInternal::InvocationObserver&); + virtual ::std::string ice_id(const ::Ice::Context*, ::IceInternal::InvocationObserver&); virtual bool ice_invoke(const ::std::string&, ::Ice::OperationMode, const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - ::std::vector< ::Ice::Byte>&, const ::Ice::Context*); - virtual void ice_flushBatchRequests(); + ::std::vector< ::Ice::Byte>&, const ::Ice::Context*, ::IceInternal::InvocationObserver&); + virtual void ice_flushBatchRequests(::IceInternal::InvocationObserver&); virtual ::IceInternal::RequestHandlerPtr __getRequestHandler() const; virtual void __setRequestHandler(const ::IceInternal::RequestHandlerPtr&); @@ -751,14 +755,14 @@ class ICE_API Object : virtual public ::IceDelegate::Ice::Object { public: - virtual bool ice_isA(const ::std::string&, const ::Ice::Context*); - virtual void ice_ping(const ::Ice::Context*); - virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*); - virtual ::std::string ice_id(const ::Ice::Context*); + virtual bool ice_isA(const ::std::string&, const ::Ice::Context*, ::IceInternal::InvocationObserver&); + virtual void ice_ping(const ::Ice::Context*, ::IceInternal::InvocationObserver&); + virtual ::std::vector< ::std::string> ice_ids(const ::Ice::Context*, ::IceInternal::InvocationObserver&); + virtual ::std::string ice_id(const ::Ice::Context*, ::IceInternal::InvocationObserver&); virtual bool ice_invoke(const ::std::string&, ::Ice::OperationMode, const ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, - ::std::vector< ::Ice::Byte>&, const ::Ice::Context*); - virtual void ice_flushBatchRequests(); + ::std::vector< ::Ice::Byte>&, const ::Ice::Context*, ::IceInternal::InvocationObserver&); + virtual void ice_flushBatchRequests(::IceInternal::InvocationObserver&); virtual ::IceInternal::RequestHandlerPtr __getRequestHandler() const; virtual void __setRequestHandler(const ::IceInternal::RequestHandlerPtr&); |