[asterisk-scf-commits] asterisk-scf/integration/servicediscovery.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Oct 29 10:33:37 CDT 2010


branch "master" has been updated
       via  91710e91bb1c7e95c7bf880438cb178728c35893 (commit)
      from  06eb4de0b880b18d06e84d1aa866320e2491fe21 (commit)

Summary of changes:
 src/ServiceManagement.cpp |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 91710e91bb1c7e95c7bf880438cb178728c35893
Author: David M. Lee <dlee at digium.com>
Date:   Fri Oct 29 10:21:17 2010 -0500

    Log messages on ServiceManagement.

diff --git a/src/ServiceManagement.cpp b/src/ServiceManagement.cpp
index c9a9914..08bc831 100644
--- a/src/ServiceManagement.cpp
+++ b/src/ServiceManagement.cpp
@@ -24,10 +24,17 @@
 
 #include "ServiceLocatorManagement.h"
 #include "ServiceManagement.h"
+#include "logger.h"
 
 using namespace std;
 using namespace AsteriskSCF::Core::Discovery::V1;
 using namespace AsteriskSCF::ServiceDiscovery;
+using namespace AsteriskSCF::System::Logging;
+
+namespace
+{
+Logger const &lg = getLoggerFactory().getLogger("AsteriskSCF.System.Discovery");
+}
 
 namespace AsteriskSCF
 {
@@ -253,7 +260,11 @@ void ServiceManagementImpl::suspend(const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
 
-    mImpl->mSuspended = true;
+    if (!mImpl->mSuspended)
+    {
+        lg(Info) << "Suspending " << mImpl->mGuid << " " << mImpl->mService->ice_toString();
+        mImpl->mSuspended = true;
+    }
 
     if (mImpl->mLocatorTopic)
     {
@@ -268,7 +279,11 @@ void ServiceManagementImpl::unsuspend(const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
 
-    mImpl->mSuspended = false;
+    if (mImpl->mSuspended)
+    {
+        lg(Info) << "Un-suspending " << mImpl->mGuid << " " << mImpl->mService->ice_toString();
+        mImpl->mSuspended = false;
+    }
 
     if (mImpl->mLocatorTopic)
     {
@@ -284,6 +299,7 @@ void ServiceManagementImpl::unregister(const Ice::Current&)
     /* You'll notice no lock here. That's because we aren't actually modifying any internal state that should
      * be protected, and if we did lock here there is a chance for a deadlock which is super sad.
      */
+    lg(Info) << "Un-register " << mImpl->mGuid << " " << mImpl->mService->ice_toString();
 
     mImpl->mAdapter->remove(mImpl->mManagementPrx->ice_getIdentity());
 

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


-- 
asterisk-scf/integration/servicediscovery.git



More information about the asterisk-scf-commits mailing list