diff options
author | Benoit Foucher <benoit@zeroc.com> | 2009-01-15 16:02:54 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2009-01-15 16:02:54 +0100 |
commit | a10f33af6ee6298b4a7412a3819cc4818f086fa4 (patch) | |
tree | 7dc924b0692491a6419b81ae419b559ccef467cf /cpp/src/Ice/LocatorInfo.h | |
parent | bug 3266 - fix IceSSL/C++ for custom contexts (diff) | |
download | ice-a10f33af6ee6298b4a7412a3819cc4818f086fa4.tar.bz2 ice-a10f33af6ee6298b4a7412a3819cc4818f086fa4.tar.xz ice-a10f33af6ee6298b4a7412a3819cc4818f086fa4.zip |
- Fixed errorDetection test
- Fixed bug 3504, added locator request queue.
Diffstat (limited to 'cpp/src/Ice/LocatorInfo.h')
-rw-r--r-- | cpp/src/Ice/LocatorInfo.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/cpp/src/Ice/LocatorInfo.h b/cpp/src/Ice/LocatorInfo.h index ad8db69fe27..a4fe455a942 100644 --- a/cpp/src/Ice/LocatorInfo.h +++ b/cpp/src/Ice/LocatorInfo.h @@ -12,6 +12,7 @@ #include <IceUtil/Shared.h> #include <IceUtil/Mutex.h> +#include <IceUtil/Monitor.h> #include <IceUtil/Time.h> #include <Ice/LocatorInfoF.h> #include <Ice/LocatorF.h> @@ -71,6 +72,44 @@ class LocatorInfo : public IceUtil::Shared, public IceUtil::Mutex { public: + class RequestCallback : virtual public IceUtil::Shared + { + public: + + virtual void response(const LocatorInfoPtr&, const Ice::ObjectPrx&) = 0; + virtual void exception(const LocatorInfoPtr&, const Ice::Exception&) = 0; + }; + typedef IceUtil::Handle<RequestCallback> RequestCallbackPtr; + + class Request : virtual public IceUtil::Shared + { + public: + + void addCallback(const RequestCallbackPtr&); + Ice::ObjectPrx getProxy(); + + protected: + + Request(const LocatorInfoPtr&); + + void response(const Ice::ObjectPrx&); + void exception(const Ice::Exception&); + + virtual void send() = 0; + + const LocatorInfoPtr _locatorInfo; + + private: + + IceUtil::Monitor<IceUtil::Mutex> _monitor; + std::vector<RequestCallbackPtr> _callbacks; + bool _sent; + bool _response; + Ice::ObjectPrx _proxy; + std::auto_ptr<Ice::Exception> _exception; + }; + typedef IceUtil::Handle<Request> RequestPtr; + class GetEndpointsCallback : virtual public IceUtil::Shared { public: @@ -105,13 +144,25 @@ public: void getEndpointsException(const ReferencePtr&, const Ice::Exception&, const GetEndpointsCallbackPtr&); void getEndpointsTrace(const ReferencePtr&, const std::vector<EndpointIPtr>&, bool); + const LocatorTablePtr& getTable() { return _table; } + + RequestPtr getAdapterRequest(const std::string&); + void removeAdapterRequest(const std::string&); + + RequestPtr getObjectRequest(const Ice::Identity&); + void removeObjectRequest(const Ice::Identity&); + private: + void trace(const std::string&, const ReferencePtr&, const std::vector<EndpointIPtr>&); const Ice::LocatorPrx _locator; Ice::LocatorRegistryPrx _locatorRegistry; const LocatorTablePtr _table; + + std::map<std::string, RequestPtr> _adapterRequests; + std::map<Ice::Identity, RequestPtr> _objectRequests; }; } |