diff options
Diffstat (limited to 'cpp/include/Ice/OutgoingAsync.h')
-rw-r--r-- | cpp/include/Ice/OutgoingAsync.h | 74 |
1 files changed, 70 insertions, 4 deletions
diff --git a/cpp/include/Ice/OutgoingAsync.h b/cpp/include/Ice/OutgoingAsync.h index ffcc03236e0..8871ba08a68 100644 --- a/cpp/include/Ice/OutgoingAsync.h +++ b/cpp/include/Ice/OutgoingAsync.h @@ -11,8 +11,10 @@ #define ICE_OUTGOING_ASYNC_H #include <IceUtil/Monitor.h> -#include <IceUtil/RecMutex.h> +#include <IceUtil/Mutex.h> +#include <IceUtil/Timer.h> #include <Ice/OutgoingAsyncF.h> +#include <Ice/InstanceF.h> #include <Ice/ReferenceF.h> #include <Ice/ConnectionIF.h> #include <Ice/Current.h> @@ -21,22 +23,43 @@ namespace IceInternal { class BasicStream; +class LocalExceptionWrapper; +class Outgoing; + +class ICE_API OutgoingAsyncMessageCallback : virtual public IceUtil::Shared +{ +public: + + virtual ~OutgoingAsyncMessageCallback() { } + + virtual void __sent(Ice::ConnectionI*) = 0; + virtual void __finished(const Ice::LocalException&) = 0; +}; // // We need virtual inheritance from shared, because the user might use // multiple inheritance from IceUtil::Shared. // -class ICE_API OutgoingAsync : virtual public IceUtil::Shared +class ICE_API OutgoingAsync : public OutgoingAsyncMessageCallback, public IceUtil::TimerTask { public: OutgoingAsync(); virtual ~OutgoingAsync(); + void __sent(Ice::ConnectionI*); + + BasicStream* + __getOs() + { + return __os; + } + virtual void ice_exception(const Ice::Exception&) = 0; void __finished(BasicStream&); void __finished(const Ice::LocalException&); + void __finished(const LocalExceptionWrapper&); protected: @@ -50,17 +73,51 @@ protected: private: + void runTimerTask(); // Implementation of TimerTask::runTimerTask() + void warning(const std::exception&) const; void warning() const; void cleanup(); + bool _sent; + bool _response; ::Ice::ObjectPrx _proxy; - ::IceInternal::Handle< ::IceDelegate::Ice::Object> _delegate; + Handle< ::IceDelegate::Ice::Object> _delegate; int _cnt; Ice::OperationMode _mode; - IceUtil::Monitor<IceUtil::RecMutex> _monitor; + Ice::ConnectionIPtr _timerTaskConnection; + IceUtil::Monitor<IceUtil::Mutex> _monitor; +}; + +class ICE_API BatchOutgoingAsync : public OutgoingAsyncMessageCallback +{ +public: + + BatchOutgoingAsync(); + + void __prepare(const InstancePtr&); + virtual void __sent(Ice::ConnectionI*); + virtual void __finished(const Ice::LocalException&); + + BasicStream* + __getOs() + { + return _os; + } + + virtual void ice_exception(const Ice::Exception&) = 0; + +private: + + void warning(const std::exception&) const; + void warning() const; + + void cleanup(); + + IceUtil::Monitor<IceUtil::Mutex> _monitor; + BasicStream* _os; }; } @@ -98,6 +155,15 @@ protected: virtual void __response(bool); }; +class ICE_API AMI_Object_ice_flushBatchRequests : public IceInternal::BatchOutgoingAsync +{ +public: + + void __invoke(const Ice::ObjectPrx&); + + virtual void ice_exception(const Ice::Exception&) = 0; +}; + } #endif |