summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/CommunicatorI.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2009-12-09 15:12:12 +1000
committerMichi Henning <michi@zeroc.com>2009-12-09 15:12:12 +1000
commitd0d27bb7cf7b5ff8f9f3028f63f650f1d0b01678 (patch)
tree9524523d712bca42f6bd36fabd72c76371ecdca8 /cpp/src/Ice/CommunicatorI.cpp
parentMerge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff)
parentfix for cpp/test/Ice/Makefile.mak (diff)
downloadice-d0d27bb7cf7b5ff8f9f3028f63f650f1d0b01678.tar.bz2
ice-d0d27bb7cf7b5ff8f9f3028f63f650f1d0b01678.tar.xz
ice-d0d27bb7cf7b5ff8f9f3028f63f650f1d0b01678.zip
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Diffstat (limited to 'cpp/src/Ice/CommunicatorI.cpp')
-rw-r--r--cpp/src/Ice/CommunicatorI.cpp58
1 files changed, 57 insertions, 1 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp
index a7de37f5f5a..8e9d9b1de5c 100644
--- a/cpp/src/Ice/CommunicatorI.cpp
+++ b/cpp/src/Ice/CommunicatorI.cpp
@@ -11,6 +11,7 @@
#include <Ice/CommunicatorI.h>
#include <Ice/Instance.h>
#include <Ice/Properties.h>
+#include <Ice/ConnectionFactory.h>
#include <Ice/ReferenceFactory.h>
#include <Ice/ProxyFactory.h>
#include <Ice/ObjectFactoryManager.h>
@@ -296,7 +297,62 @@ Ice::CommunicatorI::getPluginManager() const
void
Ice::CommunicatorI::flushBatchRequests()
{
- _instance->flushBatchRequests();
+ AsyncResultPtr r = begin_flushBatchRequests();
+ end_flushBatchRequests(r);
+}
+
+AsyncResultPtr
+Ice::CommunicatorI::begin_flushBatchRequests()
+{
+ return begin_flushBatchRequestsInternal(0, 0);
+}
+
+AsyncResultPtr
+Ice::CommunicatorI::begin_flushBatchRequests(const CallbackPtr& cb, const LocalObjectPtr& cookie)
+{
+ return begin_flushBatchRequestsInternal(cb, cookie);
+}
+
+AsyncResultPtr
+Ice::CommunicatorI::begin_flushBatchRequests(const Callback_Communicator_flushBatchRequestsPtr& cb,
+ const LocalObjectPtr& cookie)
+{
+ return begin_flushBatchRequestsInternal(cb, cookie);
+}
+
+static const ::std::string __flushBatchRequests_name = "flushBatchRequests";
+
+AsyncResultPtr
+Ice::CommunicatorI::begin_flushBatchRequestsInternal(const IceInternal::CallbackBasePtr& cb,
+ const LocalObjectPtr& cookie)
+{
+ OutgoingConnectionFactoryPtr connectionFactory = _instance->outgoingConnectionFactory();
+ ObjectAdapterFactoryPtr adapterFactory = _instance->objectAdapterFactory();
+
+ //
+ // This callback object receives the results of all invocations
+ // of Connection::begin_flushBatchRequests.
+ //
+ CommunicatorBatchOutgoingAsyncPtr result =
+ new CommunicatorBatchOutgoingAsync(this, _instance, __flushBatchRequests_name, cb, cookie);
+
+ connectionFactory->flushAsyncBatchRequests(result);
+ adapterFactory->flushAsyncBatchRequests(result);
+
+ //
+ // Inform the callback that we have finished initiating all of the
+ // flush requests.
+ //
+ result->ready();
+
+ return result;
+}
+
+void
+Ice::CommunicatorI::end_flushBatchRequests(const AsyncResultPtr& r)
+{
+ AsyncResult::__check(r, this, __flushBatchRequests_name);
+ r->__wait();
}
ObjectPrx