[asterisk-scf-commits] asterisk-scf/release/bridging.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Jun 8 07:30:35 CDT 2011


branch "master" has been updated
       via  6cffd17652efd700c25edd84d66659d69681b78f (commit)
      from  6595950f2059c14dc1dbc40f3ba76d4a27d72fd5 (commit)

Summary of changes:
 src/Service.cpp |   39 +++++++++++++++++++++++----------------
 1 files changed, 23 insertions(+), 16 deletions(-)


- Log -----------------------------------------------------------------
commit 6cffd17652efd700c25edd84d66659d69681b78f
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Jun 8 09:34:11 2011 -0230

    Have only the standby component register with the locator.

diff --git a/src/Service.cpp b/src/Service.cpp
index fd3fcd6..addafb4 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -63,6 +63,10 @@ public:
         {
             (*i)->activated(ReplicaPrx::uncheckedCast(mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(mReplicaId))));
         }
+        //
+        // A nice thing to do here would be to refresh the proxy that is registered with the service locator. It may not
+        // have really changed (depends on the failover mechanism used) but in the event that it did...
+        //
         return true;
     }
 
@@ -274,23 +278,26 @@ void BridgingApp::start(const std::string& name, const Ice::CommunicatorPtr& com
         manager->activate();
     }
 
-    bool registered = false;
-    try
-    {
-        ServiceLocatorParamsPtr parameters(new ServiceLocatorParams);
-        parameters->category = BridgeServiceDiscoveryCategory;
-        mLocator = 
-            new LocatorRegistrationWrapper<BridgeManagerPrx>(communicator, serviceLocatorManagementProperty, bridgeManagerPrx, 
-               adapterName, parameters);
-        registered = mLocator->registerService();
-    }
-    catch (const Ice::Exception&)
-    {
-    }
-    if (!registered)
+    if (!onStandby)
     {
-        mRegisterThread = new RegisterThread<BridgeManagerPrx>(mLocator);
-        mRegisterThread->start();
+        bool registered = false;
+        try
+        {
+            ServiceLocatorParamsPtr parameters(new ServiceLocatorParams);
+            parameters->category = BridgeServiceDiscoveryCategory;
+            mLocator = 
+                new LocatorRegistrationWrapper<BridgeManagerPrx>(communicator, serviceLocatorManagementProperty, bridgeManagerPrx, 
+                        adapterName, parameters);
+            registered = mLocator->registerService();
+        }
+        catch (const Ice::Exception&)
+        {
+        }
+        if (!registered)
+        {
+            mRegisterThread = new RegisterThread<BridgeManagerPrx>(mLocator);
+            mRegisterThread->start();
+        }
     }
     //
     // TODO: We need to know whether or not to activate!

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


-- 
asterisk-scf/release/bridging.git



More information about the asterisk-scf-commits mailing list