[asterisk-scf-commits] asterisk-scf/integration/ice-util-cpp.git branch "basecomponentfix" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Sep 26 15:41:51 CDT 2011


branch "basecomponentfix" has been updated
       via  fbf3aa417a714bd6af55145ab6df60f7b9a26d72 (commit)
      from  cf940fff375cc8b87db6681f854abfc6d4406515 (commit)

Summary of changes:
 src/Component/Component.cpp |  118 +++++++++++++++++++++----------------------
 1 files changed, 58 insertions(+), 60 deletions(-)


- Log -----------------------------------------------------------------
commit fbf3aa417a714bd6af55145ab6df60f7b9a26d72
Author: Benjamin Oldenburg <benjamin.oldenburg at bericom.eu>
Date:   Mon Sep 26 22:41:43 2011 +0200

    Fixed formatting issues

diff --git a/src/Component/Component.cpp b/src/Component/Component.cpp
index 2fd3fba..ea7d899 100644
--- a/src/Component/Component.cpp
+++ b/src/Component/Component.cpp
@@ -749,70 +749,68 @@ void Component::createBackplaneServices()
  */
 void Component::initServiceLocatorProxies()
 {
-	int timeout = 0, retryDelay = 0;
-
-	try
-	{
-		timeout = mCommunicator->getProperties()->getPropertyAsIntWithDefault(mName + ".InitServiceLocatorTimeout", 30);
-		retryDelay	= mCommunicator->getProperties()->getPropertyAsIntWithDefault(mName + ".InitServiceLocatorRetryDelay", 2);
-	}
-	catch(const Ice::Exception& e)
-	{
-		mLogger(Error) << BOOST_CURRENT_FUNCTION << "Failure to get property." << e.what();
+    int timeout = 0, retryDelay = 0;
+
+    try
+    {
+        timeout = mCommunicator->getProperties()->getPropertyAsIntWithDefault(mName + ".InitServiceLocatorTimeout", 30);
+        retryDelay	= mCommunicator->getProperties()->getPropertyAsIntWithDefault(mName + ".InitServiceLocatorRetryDelay", 2);
+    }
+    catch(const Ice::Exception& e)
+    {
+        mLogger(Error) << BOOST_CURRENT_FUNCTION << "Failure to get property." << e.what();
         throw;
-	}
-	
-	if(timeout < 1)
-	{
-		mLogger(Error) << BOOST_CURRENT_FUNCTION << "The value (=" << timeout << ") of the property '"
-			<< mName + ".InitServiceLocatorTimeout"
-			<< "' cannot be less than 1.";
+    }
+
+    if(timeout < 1)
+    {
+        mLogger(Error) << BOOST_CURRENT_FUNCTION << "The value (=" << timeout << ") of the property '"
+            << mName + ".InitServiceLocatorTimeout"
+            << "' cannot be less than 1.";
         throw;
-	}
+    }
 
-	if(retryDelay < 1)
-	{
-		mLogger(Error) << BOOST_CURRENT_FUNCTION << "The value (=" << retryDelay << ") of the property '"
-			<< mName + ".InitServiceLocatorRetryDelay"
-			<< "' cannot be less than 1.";
+    if(retryDelay < 1)
+    {
+        mLogger(Error) << BOOST_CURRENT_FUNCTION << "The value (=" << retryDelay << ") of the property '"
+            << mName + ".InitServiceLocatorRetryDelay"
+            << "' cannot be less than 1.";
         throw;
-	}
-	
-	IceUtil::Time tTimeout = IceUtil::Time::now() + IceUtil::Time::seconds(timeout);
-	
-	while( IceUtil::Time::now() < tTimeout)
-	{
-
-	    try
-		{
-	        // Get a proxy to the management interface for the Service Locator manager.
-	        mServiceLocatorManagement = 
-	            ServiceLocatorManagementPrx::checkedCast(mCommunicator->stringToProxy(
-	                 mCommunicator->getProperties()->getPropertyWithDefault(
-	                  ServiceLocatorManagementPropertyName, "LocatorServiceManagement:tcp -p 4412")));
-	
-	        // Get a proxy to the interface for the Service Locator.
-	        mServiceLocator = 
-	            ServiceLocatorPrx::checkedCast(mCommunicator->stringToProxy(
-	                 mCommunicator->getProperties()->getPropertyWithDefault(
-	                  ServiceLocatorPropertyName, "LocatorService:default -p 4411")));
-
-			// If we made it to this point, everything's good.
-			return;
-	    }
-	    catch(const Ice::Exception& e)
-	    {
-			mLogger(Notice) << " Unable to obtain proxies to ServiceLocator. Retry in " << retryDelay << " seconds.";
-	    }
-
-		// Wait a little before retrying.
-		IceUtil::ThreadControl::sleep (IceUtil::Time::seconds(retryDelay));
-
-	}
-
-	// Timeout
-	mLogger(Error) << BOOST_CURRENT_FUNCTION << " Unable to obtain proxies to ServiceLocator for " << timeout << " seconds. Timeout!.";
-	throw; 
+    }
+
+    IceUtil::Time tTimeout = IceUtil::Time::now() + IceUtil::Time::seconds(timeout);
+
+    while( IceUtil::Time::now() < tTimeout)
+    {
+        try
+        {
+            // Get a proxy to the management interface for the Service Locator manager.
+            mServiceLocatorManagement = 
+                ServiceLocatorManagementPrx::checkedCast(mCommunicator->stringToProxy(
+                    mCommunicator->getProperties()->getPropertyWithDefault(
+                        ServiceLocatorManagementPropertyName, "LocatorServiceManagement:tcp -p 4412")));
+
+            // Get a proxy to the interface for the Service Locator.
+            mServiceLocator = 
+                ServiceLocatorPrx::checkedCast(mCommunicator->stringToProxy(
+                     mCommunicator->getProperties()->getPropertyWithDefault(
+                      ServiceLocatorPropertyName, "LocatorService:default -p 4411")));
+
+            // If we made it to this point, everything's good.
+            return;
+        }
+        catch(const Ice::Exception& e)
+        {
+            mLogger(Notice) << " Unable to obtain proxies to ServiceLocator. Retry in " << retryDelay << " seconds.";
+        }
+
+        // Wait a little before retrying.
+        IceUtil::ThreadControl::sleep (IceUtil::Time::seconds(retryDelay));
+    }
+
+    // Timeout
+    mLogger(Error) << BOOST_CURRENT_FUNCTION << " Unable to obtain proxies to ServiceLocator for " << timeout << " seconds. Timeout!.";
+    throw; 
 }
 
 void Component::verifyProperties()

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


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



More information about the asterisk-scf-commits mailing list