[asterisk-scf-commits] asterisk-scf/release/ice-util-cpp.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Sep 19 12:27:13 CDT 2011


branch "master" has been updated
       via  afaf84290379d63d85c66a197c0c8ebac81d194a (commit)
      from  1f46a195dc0bf69cb6ea3e1d2a67874b1b2fb862 (commit)

Summary of changes:
 .../CollocatedIceStorm/CollocatedIceStorm.h        |    9 +++++++++
 src/CollocatedIceStorm/CollocatedIceStorm.cpp      |   10 ++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)


- Log -----------------------------------------------------------------
commit afaf84290379d63d85c66a197c0c8ebac81d194a
Author: Brent Eagles <beagles at digium.com>
Date:   Mon Sep 19 12:25:52 2011 -0230

    Adding a facility to the collocated Ice storm class to allow the topic manager
    proxy to be created using information provided when the IceStorm instance was
    created. This makes it unnecessary for the service creating the collocated
    IceStorm instance to have a property for obtaining the proxy for the collocated
    topic manager.

diff --git a/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h b/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
index 4cac3e1..37b51bc 100644
--- a/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
+++ b/include/AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h
@@ -43,11 +43,20 @@ public:
      */
     void stop();
 
+    /**
+     *
+     * We need to hand in the communicator that the proxy should be created on to avoid
+     * unexpected behavior.
+     *
+     */
+    IceStorm::TopicManagerPrx createTopicManagerProxy(const Ice::CommunicatorPtr& communicator);
+
 private:
     IceUtilInternal::DynamicLibraryPtr mLibrary;
     IceBox::ServicePtr mService;
     Ice::CommunicatorPtr mCommunicator;
     bool mStopped;
+    std::string mTopicManagerString;
 };
 
 typedef IceUtil::Handle<CollocatedIceStorm> CollocatedIceStormPtr;
diff --git a/src/CollocatedIceStorm/CollocatedIceStorm.cpp b/src/CollocatedIceStorm/CollocatedIceStorm.cpp
index cd37418..0f24f46 100644
--- a/src/CollocatedIceStorm/CollocatedIceStorm.cpp
+++ b/src/CollocatedIceStorm/CollocatedIceStorm.cpp
@@ -17,6 +17,7 @@
 #include <IceStorm/IceStorm.h>
 #include <assert.h>
 #include <algorithm>
+#include <sstream>
 
 #include <AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h>
 
@@ -52,6 +53,10 @@ CollocatedIceStorm::CollocatedIceStorm(const std::string& namePrefix, const Ice:
     assert(mService != 0);
     Ice::StringSeq options;
     mService->start(namePrefix, mCommunicator, options);
+    std::stringstream os;
+    os << properties->getPropertyWithDefault(namePrefix + ".IceStorm.InstanceName", "IceStorm") << "/TopicManager:";
+    os << properties->getProperty(namePrefix + ".IceStorm.TopicManager.Endpoints");
+    mTopicManagerString = os.str();
 }
 
 CollocatedIceStorm::~CollocatedIceStorm()
@@ -86,3 +91,8 @@ ASTSCF_DLL_EXPORT void CollocatedIceStorm::stop()
         mStopped = true;
     }
 }
+
+IceStorm::TopicManagerPrx CollocatedIceStorm::createTopicManagerProxy(const Ice::CommunicatorPtr& communicator)
+{
+    return IceStorm::TopicManagerPrx::checkedCast(communicator->stringToProxy(mTopicManagerString));
+}

-----------------------------------------------------------------------


-- 
asterisk-scf/release/ice-util-cpp.git



More information about the asterisk-scf-commits mailing list