[asterisk-scf-commits] asterisk-scf/integration/servicediscovery.git branch "retry_deux" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Mar 8 14:30:22 CST 2012


branch "retry_deux" has been created
        at  ede106cd7214bf79c06ee2d0567e7a10c4ca9b0e (commit)

- Log -----------------------------------------------------------------
commit ede106cd7214bf79c06ee2d0567e7a10c4ca9b0e
Author: Brent Eagles <beagles at digium.com>
Date:   Mon Mar 5 11:50:26 2012 -0330

    Some more build fixes.

diff --git a/src/ServiceLocator.cpp b/src/ServiceLocator.cpp
index fe1241a..6c725ee 100644
--- a/src/ServiceLocator.cpp
+++ b/src/ServiceLocator.cpp
@@ -268,7 +268,7 @@ void ServiceLocatorApp::start(const string& appName, const Ice::CommunicatorPtr&
         if (getBooleanPropertyValueWithDefault(communicator->getProperties(), appName + ".Standalone", false))
         {
 	    mReplicaService->standby(AsteriskSCF::Operations::createContext());
-            mStateReplicator->addListener(replicatorListenerProxy);
+            mStateReplicator->addListener(AsteriskSCF::Operations::createContext(), replicatorListenerProxy);
             lg(Info) << "Operating as a standby replica." << endl;
         }
         else
diff --git a/src/ServiceLocatorManagement.cpp b/src/ServiceLocatorManagement.cpp
index b8e6312..a04fd3f 100644
--- a/src/ServiceLocatorManagement.cpp
+++ b/src/ServiceLocatorManagement.cpp
@@ -618,7 +618,7 @@ void ServiceLocatorManagementImpl::replicateState(const ServiceLocatorStateItemP
     try
     {
         ServiceLocatorStateReplicatorPrx oneway = ServiceLocatorStateReplicatorPrx::uncheckedCast(mImpl->mStateReplicator->ice_oneway());
-        oneway->setState(AsteriskSCF::Operations:::createContext(), items);
+        oneway->setState(AsteriskSCF::Operations::createContext(), items);
     }
 	catch (const Ice::NoEndpointException&)
     {
diff --git a/src/ServiceLocatorStateListener.cpp b/src/ServiceLocatorStateListener.cpp
index af7e5ac..fbc6bf4 100644
--- a/src/ServiceLocatorStateListener.cpp
+++ b/src/ServiceLocatorStateListener.cpp
@@ -185,12 +185,12 @@ ServiceLocatorStateReplicatorListenerI::ServiceLocatorStateReplicatorListenerI(c
 {
 }
 
-void ServiceLocatorStateReplicatorListenerI::stateRemoved(const Ice::StringSeq& itemKeys, const Ice::Current&)
+void ServiceLocatorStateReplicatorListenerI::stateRemoved(const AsteriskSCF::System::V1::OperationContextPtr&, const Ice::StringSeq& itemKeys, const Ice::Current&)
 {
     mImpl->removeStateNoticeImpl(itemKeys);
 }
 
-void ServiceLocatorStateReplicatorListenerI::stateSet(const ServiceLocatorStateItemSeq& items, const Ice::Current&)
+void ServiceLocatorStateReplicatorListenerI::stateSet(const AsteriskSCF::System::V1::OperationContextPtr&, const ServiceLocatorStateItemSeq& items, const Ice::Current&)
 {
     mImpl->setStateNoticeImpl(items);
 }

commit 18067f50f298bc5f9033d93f62f2799c7dfe0b22
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Mar 2 12:58:40 2012 -0330

    Build fixes for recent slice changes

diff --git a/slice/AsteriskSCF/Replication/ServiceLocator/ServiceLocatorStateReplicationIf.ice b/slice/AsteriskSCF/Replication/ServiceLocator/ServiceLocatorStateReplicationIf.ice
old mode 100644
new mode 100755
index 3ec0dd1..e502784
--- a/slice/AsteriskSCF/Replication/ServiceLocator/ServiceLocatorStateReplicationIf.ice
+++ b/slice/AsteriskSCF/Replication/ServiceLocator/ServiceLocatorStateReplicationIf.ice
@@ -19,6 +19,7 @@
 #include <Ice/BuiltinSequences.ice>
 #include <Ice/Identity.ice>
 #include "AsteriskSCF/Core/Discovery/ServiceLocatorIf.ice"
+#include <AsteriskSCF/System/OperationsIf.ice>
 
 module AsteriskSCF
 {
@@ -41,16 +42,16 @@ module V1
 
    interface ServiceLocatorStateReplicatorListener
    {
-	   void stateRemoved(Ice::StringSeq itemKeys);
-	   void stateSet(ServiceLocatorStateItemSeq items);
+	   void stateRemoved(AsteriskSCF::System::V1::OperationContext operationContext, Ice::StringSeq itemKeys);
+	   void stateSet(AsteriskSCF::System::V1::OperationContext operationContext, ServiceLocatorStateItemSeq items);
    };
 
    interface ServiceLocatorStateReplicator
    {
-	   void addListener(ServiceLocatorStateReplicatorListener *listener);
-	   void removeListener(ServiceLocatorStateReplicatorListener *listener);
-	   void setState (ServiceLocatorStateItemSeq items);
-	   void removeState(Ice::StringSeq items);
+	   void addListener(AsteriskSCF::System::V1::OperationContext operationContext, ServiceLocatorStateReplicatorListener *listener);
+	   void removeListener(AsteriskSCF::System::V1::OperationContext operationContext, ServiceLocatorStateReplicatorListener *listener);
+	   void setState (AsteriskSCF::System::V1::OperationContext operationContext, ServiceLocatorStateItemSeq items);
+	   void removeState(AsteriskSCF::System::V1::OperationContext operationContext, Ice::StringSeq items);
 	   idempotent ServiceLocatorStateItemSeq getState(Ice::StringSeq itemKeys);
 	   idempotent ServiceLocatorStateItemSeq getAllState();
    };
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
old mode 100644
new mode 100755
index 6a91640..85d3f77
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -23,5 +23,5 @@ astscf_component_add_files(ServiceLocatorStateReplicator ServiceLocatorStateRepl
 astscf_component_add_ice_libraries(ServiceLocatorStateReplicator IceStorm)
 astscf_component_add_boost_libraries(ServiceLocatorStateReplicator thread date_time)
 astscf_component_build_icebox(ServiceLocatorStateReplicator)
-target_link_libraries(ServiceLocatorStateReplicator LoggingClient)
+target_link_libraries(ServiceLocatorStateReplicator LoggingClient ASTSCFIceUtilCpp)
 astscf_component_install(ServiceLocatorStateReplicator)
diff --git a/src/ServiceLocator.cpp b/src/ServiceLocator.cpp
index 6edfc3e..fe1241a 100644
--- a/src/ServiceLocator.cpp
+++ b/src/ServiceLocator.cpp
@@ -13,6 +13,12 @@
  * the GNU General Public License Version 2. See the LICENSE.txt file
  * at the top of the source tree.
  */
+  
+//
+// These are moved up in include order because boost seems to have some kind of name collision on Windows.
+//
+#include <boost/thread.hpp>
+#include <boost/thread/shared_mutex.hpp>
 
 #include <Ice/Ice.h>
 #include <IceStorm/IceStorm.h>
@@ -25,7 +31,7 @@
 #include <AsteriskSCF/Logger/IceLogger.h>
 #include <AsteriskSCF/System/Component/ReplicaIf.h>
 #include <AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h>
-#include <AsteriskSCF/Helpers/OperationContext.h>
+#include <AsteriskSCF/Operations/OperationContext.h>
 
 #include "ServiceLocatorManagement.h"
 #include "ServiceManagement.h"
@@ -79,34 +85,36 @@ public:
         return mActive;
     }
 
-    bool activate(const Ice::Current&)
+    bool activate(const AsteriskSCF::System::V1::OperationContextPtr& context, const Ice::Current&)
     {
         mActive = true;
 
         for (vector<AsteriskSCF::System::Component::V1::ReplicaListenerPrx>::const_iterator listener = mListeners.begin(); listener != mListeners.end(); ++listener)
         {
-            (*listener)->activated(ReplicaPrx::uncheckedCast(mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
+            (*listener)->activated(AsteriskSCF::Operations::createContext(context),
+                ReplicaPrx::uncheckedCast(mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
         }
 
         return true;
     }
 
-    void standby(const Ice::Current&)
+    void standby(const AsteriskSCF::System::V1::OperationContextPtr& context, const Ice::Current&)
     {
         mActive = false;
 
         for (vector<AsteriskSCF::System::Component::V1::ReplicaListenerPrx>::const_iterator listener = mListeners.begin(); listener != mListeners.end(); ++listener)
         {
-            (*listener)->onStandby(ReplicaPrx::uncheckedCast(mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
+            (*listener)->onStandby(AsteriskSCF::Operations::createContext(context),
+                ReplicaPrx::uncheckedCast(mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
         }
     }
 
-    void addListener(const AsteriskSCF::System::Component::V1::ReplicaListenerPrx& listener, const Ice::Current&)
+    void addListener(const AsteriskSCF::System::V1::OperationContextPtr&, const AsteriskSCF::System::Component::V1::ReplicaListenerPrx& listener, const Ice::Current&)
     {
         mListeners.push_back(listener);
     }
 
-    void removeListener(const AsteriskSCF::System::Component::V1::ReplicaListenerPrx& listener, const Ice::Current&)
+    void removeListener(const AsteriskSCF::System::V1::OperationContextPtr&, const AsteriskSCF::System::Component::V1::ReplicaListenerPrx& listener, const Ice::Current&)
     {
         mListeners.erase(std::remove(mListeners.begin(), mListeners.end(), listener), mListeners.end());
     }
@@ -259,7 +267,7 @@ void ServiceLocatorApp::start(const string& appName, const Ice::CommunicatorPtr&
 
         if (getBooleanPropertyValueWithDefault(communicator->getProperties(), appName + ".Standalone", false))
         {
-	    mReplicaService->standby();
+	    mReplicaService->standby(AsteriskSCF::Operations::createContext());
             mStateReplicator->addListener(replicatorListenerProxy);
             lg(Info) << "Operating as a standby replica." << endl;
         }
@@ -294,11 +302,12 @@ void ServiceLocatorApp::start(const string& appName, const Ice::CommunicatorPtr&
     // we will replicate it.
     if (mReplicaService->isActive() == true)
     {
-	ServiceManagementPrx icestormManagement = locatorServiceManagement->addService(topicManager, "TopicManager", Ice::Current());
+	ServiceManagementPrx icestormManagement = locatorServiceManagement->addService(
+            AsteriskSCF::Operations::createContext(), topicManager, "TopicManager", Ice::Current());
 	ServiceLocatorParamsPtr params = new ServiceLocatorParams;
 	params->category = TopicManagerCategory;
 	params->service = "default";
-	icestormManagement->addLocatorParams(AsteriskSCF::createContext(), params, "");
+	icestormManagement->addLocatorParams(AsteriskSCF::Operations::createContext(), params, "");
     }
 
     mDiscoveryAdapter->activate();
diff --git a/src/ServiceLocatorManagement.cpp b/src/ServiceLocatorManagement.cpp
index 0a953c8..b8e6312 100644
--- a/src/ServiceLocatorManagement.cpp
+++ b/src/ServiceLocatorManagement.cpp
@@ -14,16 +14,20 @@
  * at the top of the source tree.
  */
 
-#include <Ice/Ice.h>
-#include <IceUtil/UUID.h>
-
+//
+// These are moved up in include order because boost seems to have some kind of name collision on Windows.
+//
 #include <boost/thread.hpp>
 #include <boost/thread/shared_mutex.hpp>
 
+#include <Ice/Ice.h>
+#include <IceUtil/UUID.h>
+
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorEventsIf.h>
 #include <AsteriskSCF/Logger.h>
 #include <AsteriskSCF/Async/ResponseCollector.h>
+#include <AsteriskSCF/Operations/OperationContext.h>
 
 #include "ServiceLocatorStateReplicationIf.h"
 
@@ -420,6 +424,7 @@ void ServiceLocatorManagementImpl::locateAll(
  * Implementation of the addService method as defined in service_locator.ice
  */
 ServiceManagementPrx ServiceLocatorManagementImpl::addService(
+    const AsteriskSCF::System::V1::OperationContextPtr&,
     const Ice::ObjectPrx& service, const string& guid, const Ice::Current&)
 {
     lg(Debug) << "addService(" << guid << ')';
@@ -484,7 +489,7 @@ ServiceInfo ServiceLocatorManagementImpl::getService(const std::string &guid, co
 /**
  * Implementation of the addCompare method as defined in service_locator.ice
  */
-void ServiceLocatorManagementImpl::addCompare(const string& guid,
+void ServiceLocatorManagementImpl::addCompare(const AsteriskSCF::System::V1::OperationContextPtr& context, const string& guid,
     const ServiceLocatorParamsComparePrx& service, const Ice::Current&)
 {
     lg(Debug) << "addCompare(" << guid << ')';
@@ -500,14 +505,15 @@ void ServiceLocatorManagementImpl::addCompare(const string& guid,
 
     if (mImpl->mLocatorTopic)
     {
-        mImpl->mLocatorTopic->comparisonRegistered(guid);
+        mImpl->mLocatorTopic->comparisonRegistered(AsteriskSCF::Operations::createContext(context), guid);
     }
 }
 
 /**
  * Implementation of the removeCompare method as defined in service_locator.ice
  */
-void ServiceLocatorManagementImpl::removeCompare(const string& guid, const Ice::Current&)
+void ServiceLocatorManagementImpl::removeCompare(const AsteriskSCF::System::V1::OperationContextPtr& context, 
+    const string& guid, const Ice::Current&)
 {
     lg(Debug) << "removeCompare(" << guid << ')';
     boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
@@ -519,7 +525,7 @@ void ServiceLocatorManagementImpl::removeCompare(const string& guid, const Ice::
     }
     else if (mImpl->mLocatorTopic)
     {
-        mImpl->mLocatorTopic->comparisonUnregistered(guid);
+        mImpl->mLocatorTopic->comparisonUnregistered(AsteriskSCF::Operations::createContext(context), guid);
     }
 }
 
@@ -612,7 +618,7 @@ void ServiceLocatorManagementImpl::replicateState(const ServiceLocatorStateItemP
     try
     {
         ServiceLocatorStateReplicatorPrx oneway = ServiceLocatorStateReplicatorPrx::uncheckedCast(mImpl->mStateReplicator->ice_oneway());
-        oneway->setState(items);
+        oneway->setState(AsteriskSCF::Operations:::createContext(), items);
     }
 	catch (const Ice::NoEndpointException&)
     {
@@ -642,7 +648,7 @@ void ServiceLocatorManagementImpl::removeState(const ServiceLocatorStateItemPtr&
     try
     {
         ServiceLocatorStateReplicatorPrx oneway = ServiceLocatorStateReplicatorPrx::uncheckedCast(mImpl->mStateReplicator->ice_oneway());
-        oneway->removeState(items);
+        oneway->removeState(AsteriskSCF::Operations::createContext(), items);
     }
 	catch (const Ice::NoEndpointException&)
     {
diff --git a/src/ServiceLocatorManagement.h b/src/ServiceLocatorManagement.h
index 468565f..a5aa052 100644
--- a/src/ServiceLocatorManagement.h
+++ b/src/ServiceLocatorManagement.h
@@ -87,15 +87,16 @@ public:
     // AsteriskSCF::Core::Discovery::V1::ServiceLocatorManagement interface.
     //
     AsteriskSCF::Core::Discovery::V1::ServiceManagementPrx addService(
+        const AsteriskSCF::System::V1::OperationContextPtr&, 
         const Ice::ObjectPrx&, const std::string&, const Ice::Current&);
     AsteriskSCF::Core::Discovery::V1::ServiceInfoSeq getServices(
         const ::Ice::Current&) const;
     AsteriskSCF::Core::Discovery::V1::ServiceInfo getService(
         const std::string &, const ::Ice::Current&) const;
-    void addCompare(const std::string&,
+    void addCompare(const AsteriskSCF::System::V1::OperationContextPtr&, const std::string&,
         const AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsComparePrx&,
         const Ice::Current&);
-    void removeCompare(const std::string&, const Ice::Current& = Ice::Current());
+    void removeCompare(const AsteriskSCF::System::V1::OperationContextPtr&, const std::string&, const Ice::Current& = Ice::Current());
 
     void isSupported(const std::string&,
         const AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr&,
diff --git a/src/ServiceLocatorStateListener.cpp b/src/ServiceLocatorStateListener.cpp
index 81f95d6..af7e5ac 100644
--- a/src/ServiceLocatorStateListener.cpp
+++ b/src/ServiceLocatorStateListener.cpp
@@ -14,17 +14,17 @@
  * at the top of the source tree.
  */
 
-#include <IceUtil/UUID.h>
-
 #include <boost/thread.hpp>
 #include <boost/shared_ptr.hpp>
 
+#include <IceUtil/UUID.h>
+
 #include <AsteriskSCF/System/Component/ReplicaIf.h>
 // #include <AsteriskSCF/Discovery/SmartProxy.h>
 
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorEventsIf.h>
-#include <AsteriskSCF/Helpers/OperationContext.h>
+#include <AsteriskSCF/Operations/OperationContext.h>
 
 #include "ServiceLocatorManagement.h"
 #include "ServiceManagement.h"
@@ -47,11 +47,11 @@ public:
     {
 	if (mService)
 	{
-	    mService->unregister();
+	    mService->unregister(AsteriskSCF::Operations::createContext());
 	}
 	if (!mComparator.empty())
 	{
-	    mLocatorManagement->removeCompare(mComparator);
+	    mLocatorManagement->removeCompare(AsteriskSCF::Operations::createContext(), mComparator);
 	}
     }
 
@@ -117,7 +117,8 @@ public:
 		    boost::shared_ptr<ServiceLocatorStateReplicatorItem> newitem(new ServiceLocatorStateReplicatorItem(mLocatorManagement));
                     localitem = newitem;
                     mStateItems.insert(std::make_pair((*item)->key, newitem));
-		    ServiceManagementImplPtr service = mLocatorManagement->addService(serviceState->service, serviceState->guid, serviceState->managementIdentity);
+		    ServiceManagementImplPtr service = mLocatorManagement->addService(
+                        serviceState->service, serviceState->guid, serviceState->managementIdentity);
 		    newitem->setService(service);
 		}
 		else
@@ -128,11 +129,11 @@ public:
 		// The only thing that can be changed by a subsequent state item is the suspend status
 		if (serviceState->suspended == true)
 		{
-		    localitem->getService()->suspend();
+		    localitem->getService()->suspend(AsteriskSCF::Operations::createContext());
 		}
 		else
-		{
-		    localitem->getService()->unsuspend();
+                {
+		    localitem->getService()->unsuspend(AsteriskSCF::Operations::createContext());
 		}
 	    }
 	    else if ((paramsState = ServiceLocatorParamsStateItemPtr::dynamicCast((*item))))
@@ -146,7 +147,7 @@ public:
 		}
 
 		// Parameters are only ever added, they are never modified or removed
-		i->second->getService()->addLocatorParams(AsteriskSCF::createContext(),
+		i->second->getService()->addLocatorParams(AsteriskSCF::Operations::createContext(),
                     paramsState->params, paramsState->compareGuid);
 	    }
 	    else if ((comparatorState = ServiceLocatorComparatorStateItemPtr::dynamicCast((*item))))
@@ -162,7 +163,7 @@ public:
 		try
 		{
 		    Ice::Current current;
-		    mLocatorManagement->addCompare(comparatorState->name, comparatorState->comparator, current);
+		    mLocatorManagement->addCompare(AsteriskSCF::Operations::createContext(), comparatorState->name, comparatorState->comparator, current);
 		    boost::shared_ptr<ServiceLocatorStateReplicatorItem> newitem(new ServiceLocatorStateReplicatorItem(mLocatorManagement));
 		    mStateItems.insert(std::make_pair((*item)->key, newitem));
 		    newitem->setComparator(comparatorState->name);
diff --git a/src/ServiceLocatorStateReplicator.h b/src/ServiceLocatorStateReplicator.h
index 8b64b67..c24dd2e 100644
--- a/src/ServiceLocatorStateReplicator.h
+++ b/src/ServiceLocatorStateReplicator.h
@@ -41,8 +41,8 @@ class ServiceLocatorStateReplicatorListenerI :
 {
 public:
     ServiceLocatorStateReplicatorListenerI(const AsteriskSCF::ServiceDiscovery::ServiceLocatorManagementImplPtr&);
-    void stateRemoved(const Ice::StringSeq&, const Ice::Current&);
-    void stateSet(const AsteriskSCF::Replication::ServiceLocator::V1::ServiceLocatorStateItemSeq&, const Ice::Current&);
+    void stateRemoved(const AsteriskSCF::System::V1::OperationContextPtr&, const Ice::StringSeq&, const Ice::Current&);
+    void stateSet(const AsteriskSCF::System::V1::OperationContextPtr&, const AsteriskSCF::Replication::ServiceLocator::V1::ServiceLocatorStateItemSeq&, const Ice::Current&);
     bool operator==(const ServiceLocatorStateReplicatorListenerI& rhs);
 private:
     boost::shared_ptr<ServiceLocatorStateReplicatorListenerImpl> mImpl;
diff --git a/src/ServiceLocatorStateReplicatorApp.cpp b/src/ServiceLocatorStateReplicatorApp.cpp
index ecc505f..3035efc 100644
--- a/src/ServiceLocatorStateReplicatorApp.cpp
+++ b/src/ServiceLocatorStateReplicatorApp.cpp
@@ -14,6 +14,11 @@
  * at the top of the source tree.
  */
 
+//
+// These are moved up in include order because boost seems to have some kind of name collision on Windows.
+//
+#include <boost/thread.hpp>
+
 #include <Ice/Ice.h>
 #include <IceUtil/UUID.h>
 #include <IceStorm/IceStorm.h>
@@ -65,17 +70,17 @@ public:
     ComponentServiceImpl(ServiceLocatorStateReplicatorService &service) : mService(service) {}
 
 public: // Overrides of the ComponentService interface.
-    virtual void suspend(const ::Ice::Current& = ::Ice::Current())
+    virtual void suspend(const AsteriskSCF::System::V1::OperationContextPtr&, const ::Ice::Current& = ::Ice::Current())
     {
         // TBD
     }
 
-    virtual void resume(const ::Ice::Current& = ::Ice::Current())
+    virtual void resume(const AsteriskSCF::System::V1::OperationContextPtr&, const ::Ice::Current& = ::Ice::Current())
     {
         // TBD
     }
 
-    virtual void shutdown(const ::Ice::Current& = ::Ice::Current())
+    virtual void shutdown(const AsteriskSCF::System::V1::OperationContextPtr&, const ::Ice::Current& = ::Ice::Current())
     {
         // TBD
     }
diff --git a/src/ServiceManagement.cpp b/src/ServiceManagement.cpp
index 34f2e7f..d5d186a 100644
--- a/src/ServiceManagement.cpp
+++ b/src/ServiceManagement.cpp
@@ -14,12 +14,17 @@
  * at the top of the source tree.
  */
 
+//
+// These are moved up in include order because boost seems to have some kind of name collision on Windows.
+//
+#include <boost/thread.hpp>
+#include <boost/thread/shared_mutex.hpp>
+
 #include <Ice/Ice.h>
 #include <IceUtil/UUID.h>
 
-#include <boost/thread.hpp>
-#include <boost/thread/shared_mutex.hpp>
 #include <boost/shared_ptr.hpp>
+#include <AsteriskSCF/Operations/OperationContext.h>
 
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorEventsIf.h>
@@ -112,7 +117,7 @@ public:
         mStateItem->managementIdentity = identity;
         if (mLocatorTopic)
         {
-            mLocatorTopic->serviceRegistered(guid);
+            mLocatorTopic->serviceRegistered(AsteriskSCF::Operations::createContext(), guid);
         }
         mManagement->replicateState(mStateItem);
     }
@@ -383,7 +388,7 @@ void ServiceManagementImpl::addLocatorParams(
 /**
  * Implementation of the suspend method as defined in service_locator.ice
  */
-void ServiceManagementImpl::suspend(const Ice::Current&)
+void ServiceManagementImpl::suspend(const AsteriskSCF::System::V1::OperationContextPtr& context, const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
 
@@ -396,14 +401,14 @@ void ServiceManagementImpl::suspend(const Ice::Current&)
 
     if (mImpl->mLocatorTopic)
     {
-        mImpl->mLocatorTopic->serviceSuspended(mImpl->mStateItem->guid);
+        mImpl->mLocatorTopic->serviceSuspended(AsteriskSCF::Operations::createContext(context), mImpl->mStateItem->guid);
     }
 }
 
 /**
  * Implementation of the unsuspend method as defined in service_locator.ice
  */
-void ServiceManagementImpl::unsuspend(const Ice::Current&)
+void ServiceManagementImpl::unsuspend(const AsteriskSCF::System::V1::OperationContextPtr& context, const Ice::Current&)
 {
     boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
 
@@ -416,7 +421,7 @@ void ServiceManagementImpl::unsuspend(const Ice::Current&)
 
     if (mImpl->mLocatorTopic)
     {
-        mImpl->mLocatorTopic->serviceUnsuspended(mImpl->mStateItem->guid);
+        mImpl->mLocatorTopic->serviceUnsuspended(context, mImpl->mStateItem->guid);
     }
 }
 
@@ -449,7 +454,7 @@ ServiceLocatorParamsSeq ServiceManagementImpl::getLocatorParams(const Ice::Curre
 /**
  * Implementation of the unregister method as defined in service_locator.ice
  */
-void ServiceManagementImpl::unregister(const Ice::Current&)
+void ServiceManagementImpl::unregister(const AsteriskSCF::System::V1::OperationContextPtr& context, 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.
@@ -466,7 +471,7 @@ void ServiceManagementImpl::unregister(const Ice::Current&)
 
         if (mImpl->mLocatorTopic)
         {
-            mImpl->mLocatorTopic->serviceUnregistered(mImpl->mStateItem->guid);
+            mImpl->mLocatorTopic->serviceUnregistered(AsteriskSCF::Operations::createContext(context), mImpl->mStateItem->guid);
         }
     }
     catch(const std::exception& e)
diff --git a/src/ServiceManagement.h b/src/ServiceManagement.h
index 0a6c3d6..e8f0907 100644
--- a/src/ServiceManagement.h
+++ b/src/ServiceManagement.h
@@ -41,9 +41,9 @@ public:
     //
     void addLocatorParams(const AsteriskSCF::System::V1::OperationContextPtr&, 
         const AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr&, const std::string&, const Ice::Current& = Ice::Current());
-    void suspend(const Ice::Current& = Ice::Current());
-    void unsuspend(const Ice::Current& = Ice::Current());
-    void unregister(const Ice::Current& = Ice::Current());
+    void suspend(const AsteriskSCF::System::V1::OperationContextPtr&, const Ice::Current& = Ice::Current());
+    void unsuspend(const AsteriskSCF::System::V1::OperationContextPtr&, const Ice::Current& = Ice::Current());
+    void unregister(const AsteriskSCF::System::V1::OperationContextPtr&, const Ice::Current& = Ice::Current());
     AsteriskSCF::Core::Discovery::V1::ServiceStatus getStatus(const Ice::Current&) const { return getStatus(); }
 
     AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsSeq getLocatorParams(const Ice::Current&);
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
old mode 100644
new mode 100755
index 36889da..1b08f67
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -7,5 +7,6 @@ astscf_component_add_boost_libraries(service_locator_test unit_test_framework th
 astscf_component_add_slice_collection_libraries(service_locator_test ASTSCF)
 astscf_component_build_icebox(service_locator_test)
 astscf_test_icebox(service_locator_test config/test_component.conf)
+target_link_libraries(service_locator_test LoggingClient ASTSCFIceUtilCpp)
 
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/AsteriskSCFIceStorm)
diff --git a/test/TestComparatorBlocking.cpp b/test/TestComparatorBlocking.cpp
index 265355f..234180b 100644
--- a/test/TestComparatorBlocking.cpp
+++ b/test/TestComparatorBlocking.cpp
@@ -34,7 +34,7 @@
 #include <Ice/Ice.h>
 
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
-#include <AsteriskSCF/Helpers/OperationContext.h>
+#include <AsteriskSCF/Operations/OperationContext.h>
 
 using namespace AsteriskSCF::Core::Discovery::V1;
 
@@ -150,7 +150,7 @@ public:
         discovery(ServiceLocatorPrx::checkedCast(
                 discoveryCommunicator->stringToProxy(
                     "LocatorService:tcp -h 127.0.0.1 -p 4411"))),
-        proxy(management->addService(management, "self")),
+        proxy(management->addService(AsteriskSCF::Operations::createContext(), management, "self")),
         params(new ServiceLocatorParams())
     {
         BOOST_REQUIRE(blockerProxy != 0);
@@ -158,17 +158,17 @@ public:
         BOOST_REQUIRE(discovery != 0);
 
         blockerAdapter->activate();
-        management->addCompare("blocker", blockerProxy);
+        management->addCompare(AsteriskSCF::Operations::createContext(), "blocker", blockerProxy);
 
         params->category = "self";
-        proxy->addLocatorParams(AsteriskSCF::createContext(), params, "blocker");
+        proxy->addLocatorParams(AsteriskSCF::Operations::createContext(), params, "blocker");
     }
 
     ~Fixture()
     {
         blocker->unblock();
-        proxy->unregister();
-        management->removeCompare("blocker");
+        proxy->unregister(AsteriskSCF::Operations::createContext());
+        management->removeCompare(AsteriskSCF::Operations::createContext(), "blocker");
         blockerCommunicator->shutdown();
         blockerCommunicator->waitForShutdown();
 
diff --git a/test/TestServiceLocator.cpp b/test/TestServiceLocator.cpp
index fc14e48..a2e7b64 100644
--- a/test/TestServiceLocator.cpp
+++ b/test/TestServiceLocator.cpp
@@ -26,7 +26,7 @@
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorEventsIf.h>
 
-#include <AsteriskSCF/Helpers/OperationContext.h>
+#include <AsteriskSCF/Operations/OperationContext.h>
 
 using namespace std;
 using namespace AsteriskSCF::Core::Discovery::V1;
@@ -307,7 +307,8 @@ BOOST_AUTO_TEST_CASE(AddService)
      */
     try
     {
-        testbed.compareManagement = testbed.management->addService(testbed.compare, "testcompare");
+        testbed.compareManagement = testbed.management->addService(AsteriskSCF::Operations::createContext(), 
+            testbed.compare, "testcompare");
         added = true;
     }
     catch (const Ice::Exception &e)
@@ -355,7 +356,7 @@ BOOST_AUTO_TEST_CASE(AddLocatorParamsWithoutCompareService)
         params->category = "test";
         params->service = "default";
 
-        testbed.compareManagement->addLocatorParams(AsteriskSCF::createContext(), params, "");
+        testbed.compareManagement->addLocatorParams(AsteriskSCF::Operations::createContext(), params, "");
 
         added = true;
     }
@@ -429,7 +430,7 @@ BOOST_AUTO_TEST_CASE(AddCompare)
 
     try
     {
-        testbed.management->addCompare("testcompare", testbed.compare);
+        testbed.management->addCompare(AsteriskSCF::Operations::createContext(), "testcompare", testbed.compare);
 
         added = true;
     }
@@ -457,7 +458,7 @@ BOOST_AUTO_TEST_CASE(AddDuplicateCompare)
 
     try
     {
-        testbed.management->addCompare("testcompare", testbed.compare);
+        testbed.management->addCompare(AsteriskSCF::Operations::createContext(), "testcompare", testbed.compare);
 
         added = true;
     }
@@ -489,7 +490,7 @@ BOOST_AUTO_TEST_CASE(AddLocatorParamsWithCompareService)
         params->category = "test2";
         params->service = "default";
 
-        testbed.compareManagement->addLocatorParams(AsteriskSCF::createContext(), params, "testcompare");
+        testbed.compareManagement->addLocatorParams(AsteriskSCF::Operations::createContext(), params, "testcompare");
 
         added = true;
     }
@@ -550,16 +551,17 @@ BOOST_AUTO_TEST_CASE(UseServiceFoundWithCompareService)
 BOOST_AUTO_TEST_CASE(FindMultipleServices)
 {
     ServiceLocatorParamsPtr params = new ServiceLocatorParams;
-    ServiceManagementPrx compareManagement = testbed.management->addService(testbed.compare, "testcompare2");
+    ServiceManagementPrx compareManagement = testbed.management->addService(AsteriskSCF::Operations::createContext(), 
+        testbed.compare, "testcompare2");
 
     params->category = "test";
     params->service = "default";
 
-    compareManagement->addLocatorParams(AsteriskSCF::createContext(), params, "");
+    compareManagement->addLocatorParams(AsteriskSCF::Operations::createContext(), params, "");
 
     bool found = testbed.findServices("test", "", 2);
 
-    compareManagement->unregister();
+    compareManagement->unregister(AsteriskSCF::Operations::createContext());
 
     BOOST_CHECK(found);
 }
@@ -570,16 +572,17 @@ BOOST_AUTO_TEST_CASE(FindMultipleServices)
 BOOST_AUTO_TEST_CASE(FindMultipleServicesUsingEmptyCategory)
 {
     ServiceLocatorParamsPtr params = new ServiceLocatorParams;
-    ServiceManagementPrx compareManagement = testbed.management->addService(testbed.compare, "testcompare2");
+    ServiceManagementPrx compareManagement = testbed.management->addService(AsteriskSCF::Operations::createContext(), 
+        testbed.compare, "testcompare2");
 
     params->category = "test";
 
-    compareManagement->addLocatorParams(AsteriskSCF::createContext(), params, "");
+    compareManagement->addLocatorParams(AsteriskSCF::Operations::createContext(), params, "");
 
     // This takes into account that the service locator internally publishes an IceStorm topic manager service
     bool found = testbed.findServices("", "", 3);
 
-    compareManagement->unregister();
+    compareManagement->unregister(AsteriskSCF::Operations::createContext());
 
     BOOST_CHECK(found);
 }
@@ -593,7 +596,7 @@ BOOST_AUTO_TEST_CASE(ServiceSuspend)
 
     try
     {
-        testbed.compareManagement->suspend();
+        testbed.compareManagement->suspend(AsteriskSCF::Operations::createContext());
         suspended = true;
     }
     catch (const Ice::Exception &e)
@@ -627,7 +630,7 @@ BOOST_AUTO_TEST_CASE(ServiceUnsuspend)
 
     try
     {
-        testbed.compareManagement->unsuspend();
+        testbed.compareManagement->unsuspend(AsteriskSCF::Operations::createContext());
         unsuspended = true;
     }
     catch (const Ice::Exception &e)
@@ -661,7 +664,7 @@ BOOST_AUTO_TEST_CASE(RemoveNonexistentCompareService)
 
     try
     {
-        testbed.management->removeCompare("testcompare2");
+        testbed.management->removeCompare(AsteriskSCF::Operations::createContext(), "testcompare2");
         removed = true;
     }
     catch (const CompareNotFound&)
@@ -688,7 +691,7 @@ BOOST_AUTO_TEST_CASE(RemoveCompareService)
 
     try
     {
-        testbed.management->removeCompare("testcompare");
+        testbed.management->removeCompare(AsteriskSCF::Operations::createContext(), "testcompare");
         removed = true;
     }
     catch (const CompareNotFound&)
@@ -715,7 +718,7 @@ BOOST_AUTO_TEST_CASE(RemoveAlreadyRemovedCompareService)
 
     try
     {
-        testbed.management->removeCompare("testcompare");
+        testbed.management->removeCompare(AsteriskSCF::Operations::createContext(), "testcompare");
         removed = true;
     }
     catch (const CompareNotFound&)
@@ -752,7 +755,7 @@ BOOST_AUTO_TEST_CASE(ServiceUnregister)
 
     try
     {
-        testbed.compareManagement->unregister();
+        testbed.compareManagement->unregister(AsteriskSCF::Operations::createContext());
         unregistered = true;
     }
     catch (const Ice::Exception &e)

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


-- 
asterisk-scf/integration/servicediscovery.git



More information about the asterisk-scf-commits mailing list