[asterisk-scf-commits] asterisk-scf/integration/routing.git branch "route_replica" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed May 4 12:24:59 CDT 2011


branch "route_replica" has been updated
       via  52b91059bc4564ca6e967a325320ad526236f4e3 (commit)
      from  ee1ba9122aaf6a3b0c6dfb877cb73454ce1b83ca (commit)

Summary of changes:
 src/BasicRoutingServiceApp.cpp                     |    9 ++++++++-
 src/BasicRoutingStateReplicatorApp.cpp             |    8 ++++----
 ...nectBridgedSessionsWithDestinationOperation.cpp |    8 ++++----
 ...onnectBridgedSessionsWithDestinationOperation.h |    8 ++++----
 src/RouteSessionOperation.cpp                      |   10 +++++-----
 src/RouteSessionOperation.h                        |    8 ++++----
 6 files changed, 29 insertions(+), 22 deletions(-)


- Log -----------------------------------------------------------------
commit 52b91059bc4564ca6e967a325320ad526236f4e3
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Wed May 4 12:14:54 2011 -0500

    Incorporated more review feedback.

diff --git a/src/BasicRoutingServiceApp.cpp b/src/BasicRoutingServiceApp.cpp
index 26e0b8b..2e686fb 100644
--- a/src/BasicRoutingServiceApp.cpp
+++ b/src/BasicRoutingServiceApp.cpp
@@ -153,6 +153,8 @@ private:
     ::Ice::ObjectAdapterPtr mAdapter;
     ::Ice::ObjectAdapterPtr mComponentServiceAdapter;
     ::Ice::CommunicatorPtr mCommunicator;
+
+    boost::shared_mutex mReplicatorLock;
 };
 typedef ::IceUtil::Handle<BasicRoutingServiceApp> BasicRoutingServiceAppPtr;
 
@@ -328,6 +330,8 @@ void BasicRoutingServiceApp::onStandby()
  */
 void BasicRoutingServiceApp::listenToStateReplicator()
 {
+    boost::unique_lock<boost::shared_mutex> lock(mReplicatorLock); 
+
     if ((mReplicationContext->getReplicatorService() == 0) || (mListeningToReplicator == true))
     {
         return;
@@ -360,6 +364,8 @@ void BasicRoutingServiceApp::listenToStateReplicator()
  */
 void BasicRoutingServiceApp::stopListeningToStateReplicator()
 {
+    boost::unique_lock<boost::shared_mutex> lock(mReplicatorLock); 
+
     if ((mReplicationContext->getReplicatorService() == 0) || (mListeningToReplicator == false))
     {
         return;
@@ -598,7 +604,8 @@ void BasicRoutingServiceApp::initialize()
 
         // Create and publish our state replicator listener interface.
         mReplicatorListener = new RoutingStateReplicatorListenerImpl(mEndpointRegistry, mOperationReplicaCache);
-        mReplicatorListenerProxy = RoutingStateReplicatorListenerPrx::uncheckedCast(mAdapter->addWithUUID(mReplicatorListener));
+        RoutingStateReplicatorListenerPrx replicatorListener = RoutingStateReplicatorListenerPrx::uncheckedCast(mAdapter->addWithUUID(mReplicatorListener));
+        mReplicatorListenerProxy = RoutingStateReplicatorListenerPrx::uncheckedCast(replicatorListener->ice_oneway());
 
         if (active)
         {
diff --git a/src/BasicRoutingStateReplicatorApp.cpp b/src/BasicRoutingStateReplicatorApp.cpp
index 95cf205..31bdcc9 100644
--- a/src/BasicRoutingStateReplicatorApp.cpp
+++ b/src/BasicRoutingStateReplicatorApp.cpp
@@ -125,7 +125,7 @@ private:
 class BasicRoutingStateReplicatorCompare : public ServiceLocatorParamsCompare
 {
 public:
-    BasicRoutingStateReplicatorCompare(string name) : mName(name) {}
+    BasicRoutingStateReplicatorCompare(const std::string& name) : mName(name) {}
     bool isSupported(const ServiceLocatorParamsPtr &params, const Ice::Current &)
     {
         RoutingStateReplicatorParamsPtr routingParams = RoutingStateReplicatorParamsPtr::dynamicCast(params);
@@ -190,7 +190,7 @@ void BasicRoutingStateReplicatorService::registerWithServiceLocator()
     }
     catch(...)
     {
-        lg(Error) << "Exception in " << mAppName << BOOST_CURRENT_FUNCTION << endl;
+        lg(Error) << "Exception in " << mAppName << BOOST_CURRENT_FUNCTION;
         throw;
     }
 }
@@ -217,7 +217,7 @@ void BasicRoutingStateReplicatorService::deregisterFromServiceLocator(bool inclu
     }
     catch(...)
     {
-        lg(Error) << "Exception in " << BOOST_CURRENT_FUNCTION << endl;
+        lg(Error) << "Exception in " << BOOST_CURRENT_FUNCTION;
     }
 }
 
@@ -254,7 +254,7 @@ void BasicRoutingStateReplicatorService::initialize(const std::string& appName)
 
     if (mServiceLocatorManagement == 0)
     {
-        lg(Error) << "Unable to obtain proxy to ServiceLocatorManagement interface. Check config file. " << BOOST_CURRENT_FUNCTION << endl;
+        lg(Error) << "Unable to obtain proxy to ServiceLocatorManagement interface. Check config file. " << BOOST_CURRENT_FUNCTION;
     }
 
     mInitialized = true;
diff --git a/src/ConnectBridgedSessionsWithDestinationOperation.cpp b/src/ConnectBridgedSessionsWithDestinationOperation.cpp
index f563d47..768d93d 100644
--- a/src/ConnectBridgedSessionsWithDestinationOperation.cpp
+++ b/src/ConnectBridgedSessionsWithDestinationOperation.cpp
@@ -282,7 +282,7 @@ ConnectBridgedSessionsWithDestinationOperation::~ConnectBridgedSessionsWithDesti
         lg(Debug) << "ConnectBridgedSessionsWithDestinationOperation() being destroyed for " << mDestination ;
 }
 
-void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::OperationStateItemPtr stateItem)
+void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::OperationStateItemPtr& stateItem)
 {
     ConnectBridgedSessionsWithDestinationOpStartPtr start;
     ConnectBridgedSessionsWithDestinationOpWaitLookupStatePtr waitLookup;
@@ -302,7 +302,7 @@ void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(AsteriskSCF::
     }
 }
 
-void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpStartPtr item)
+void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpStartPtr& item)
 {
     mSessionToReplace = item->sessionToReplace;
     mDestination = item->destination;
@@ -311,7 +311,7 @@ void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(AsteriskSCF::
     mReplicatedStates.push_back(ConnectBridgedSessionsWithDestinationOp::STATE_LOOKUP);
 }
 
-void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpWaitLookupStatePtr item)
+void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpWaitLookupStatePtr& item)
 {
     mLookupResult = item->endpoints;
     mRemainingSessions = item->remainingSessions;
@@ -319,7 +319,7 @@ void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(AsteriskSCF::
     mReplicatedStates.push_back(ConnectBridgedSessionsWithDestinationOp::STATE_WAIT_LOOKUP_RESULTS);
 }
 
-void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpBridgingStatePtr item)
+void ConnectBridgedSessionsWithDestinationOperation::reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpBridgingStatePtr& item)
 {
     mBridge = item->bridge;
 
diff --git a/src/ConnectBridgedSessionsWithDestinationOperation.h b/src/ConnectBridgedSessionsWithDestinationOperation.h
index ca1d904..76a9cc1 100644
--- a/src/ConnectBridgedSessionsWithDestinationOperation.h
+++ b/src/ConnectBridgedSessionsWithDestinationOperation.h
@@ -92,7 +92,7 @@ public:
     /**
      * Update a replica object with new state information.
      */
-    void reflectUpdate(AsteriskSCF::BasicRoutingService::V1::OperationStateItemPtr stateItem);
+    void reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::OperationStateItemPtr& stateItem);
 
     /**
      * Set the state machine into the highest state possible based on all of the state updates
@@ -121,9 +121,9 @@ protected:
 private:
     void initStateMachine();
 
-    void reflectUpdate(AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpStartPtr stateItem);
-    void reflectUpdate(AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpWaitLookupStatePtr stateItem);
-    void reflectUpdate(AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpBridgingStatePtr stateItem);
+    void reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpStartPtr& stateItem);
+    void reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpWaitLookupStatePtr& stateItem);
+    void reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::ConnectBridgedSessionsWithDestinationOpBridgingStatePtr& stateItem);
 
     /**
      * This is a state handler for one of this operation's states. 
diff --git a/src/RouteSessionOperation.cpp b/src/RouteSessionOperation.cpp
index d7ce95d..a543fb0 100644
--- a/src/RouteSessionOperation.cpp
+++ b/src/RouteSessionOperation.cpp
@@ -217,7 +217,7 @@ RouteSessionOperation::RouteSessionOperation(const AMD_SessionRouter_routeSessio
                                              const ::std::string& destination, 
                                              const ::Ice::Current& current,
                                              const SessionContextPtr& context,
-                                             OperationsManager*  listener) 
+                                             OperationsManager* const listener) 
         : SessionRouterOperation<AMD_SessionRouter_routeSessionPtr, 
                                   RouteSessionOp::OperationState> (cb, 
                                                                  context, 
@@ -279,7 +279,7 @@ RouteSessionOperationPtr RouteSessionOperation::createReplica(const SessionConte
     return op;
 }
 
-void RouteSessionOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::OperationStateItemPtr stateItem)
+void RouteSessionOperation::reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::OperationStateItemPtr& stateItem)
 {
     RouteSessionOpStartPtr start;
     RouteSessionOpWaitLookupStatePtr waitLookup;
@@ -299,7 +299,7 @@ void RouteSessionOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::
     }
 }
 
-void RouteSessionOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::RouteSessionOpStartPtr item)
+void RouteSessionOperation::reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::RouteSessionOpStartPtr& item)
 {
     mSource = item->source;
     mDestination = item->destination;
@@ -308,14 +308,14 @@ void RouteSessionOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::
     mReplicatedStates.push_back(RouteSessionOp::STATE_LOOKUP);
 }
 
-void RouteSessionOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::RouteSessionOpWaitLookupStatePtr item)
+void RouteSessionOperation::reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::RouteSessionOpWaitLookupStatePtr& item)
 {
     mLookupResult = item->endpoints;
 
     mReplicatedStates.push_back(RouteSessionOp::STATE_WAIT_LOOKUP_RESULTS);
 }
 
-void RouteSessionOperation::reflectUpdate(AsteriskSCF::BasicRoutingService::V1::RouteSessionOpBridgingStatePtr item)
+void RouteSessionOperation::reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::RouteSessionOpBridgingStatePtr& item)
 {
     mBridge = item->bridge;
 
diff --git a/src/RouteSessionOperation.h b/src/RouteSessionOperation.h
index 39d96e9..cd1c6d6 100644
--- a/src/RouteSessionOperation.h
+++ b/src/RouteSessionOperation.h
@@ -89,7 +89,7 @@ public:
     /**
      * Update a replica object with new state information.
      */
-    void reflectUpdate(AsteriskSCF::BasicRoutingService::V1::OperationStateItemPtr stateItem);
+    void reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::OperationStateItemPtr& stateItem);
 
     /**
      * Set the state machine into the highest state possible based on all of the state updates
@@ -116,17 +116,17 @@ private:
     /**
      * Update a replica object with new state information of a specific type.
      */
-    void reflectUpdate(AsteriskSCF::BasicRoutingService::V1::RouteSessionOpStartPtr item);
+    void reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::RouteSessionOpStartPtr& item);
 
     /**
      * Update a replica object with new state information of a specific type.
      */
-    void reflectUpdate(AsteriskSCF::BasicRoutingService::V1::RouteSessionOpWaitLookupStatePtr item);
+    void reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::RouteSessionOpWaitLookupStatePtr& item);
 
     /**
      * Update a replica object with new state information of a specific type.
      */
-    void reflectUpdate(AsteriskSCF::BasicRoutingService::V1::RouteSessionOpBridgingStatePtr item);
+    void reflectUpdate(const AsteriskSCF::BasicRoutingService::V1::RouteSessionOpBridgingStatePtr& item);
 
     /**
      * This is a state handler for one of this operation's states. 

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


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list