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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Aug 18 12:31:12 CDT 2010


branch "master" has been updated
       via  9e6083851eba7c875d8102dd6b5ac9fa693339a5 (commit)
      from  4386433605ea8ffbe47071a4d741947fe7a9ee93 (commit)

Summary of changes:
 src/CMakeLists.txt |    1 +
 src/Service.cpp    |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)


- Log -----------------------------------------------------------------
commit 9e6083851eba7c875d8102dd6b5ac9fa693339a5
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Aug 18 14:43:45 2010 -0300

    Add service locator logic to the bridge service.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bd20407..42a7295 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,6 +4,7 @@ hydra_component_add_slice(bridgeservice ComponentServiceIf)
 hydra_component_add_slice(bridgeservice SessionIf)
 hydra_component_add_slice(bridgeservice BridgeServiceIf)
 hydra_component_add_slice(bridgeservice BridgeServiceEventsIf)
+hydra_component_add_slice(bridgeservice ServiceLocatorIf)
 hydra_component_add_file(bridgeservice Service.cpp)
 hydra_component_add_file(bridgeservice BridgeImpl.cpp)
 hydra_component_add_file(bridgeservice BridgeFactoryImpl.cpp)
diff --git a/src/Service.cpp b/src/Service.cpp
index b4844bd..dbd153c 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -4,6 +4,8 @@
 #include <Ice/Ice.h>
 #include <IceStorm/IceStorm.h>
 
+#include "Core/Discovery/ServiceLocatorIf.h"
+
 class BridgingApp : public Ice::Application
 {
 public:
@@ -76,9 +78,18 @@ int BridgingApp::run(int, char*[])
     }
     Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hydra.BridgeService");
     Hydra::Core::Bridging::V1::BridgeFactoryPtr f(new Hydra::BridgeService::BridgeFactoryImpl(adapter, events));
-    adapter->add(f, communicator()->stringToIdentity("BridgeFactory"));
+    Hydra::Core::Bridging::V1::BridgeFactoryPrx s = Hydra::Core::Bridging::V1::BridgeFactoryPrx::uncheckedCast(adapter->add(f, communicator()->stringToIdentity("BridgeFactory")));
     adapter->activate();
+
+    Hydra::Core::Discovery::V1::ServiceLocatorManagementPrx management = Hydra::Core::Discovery::V1::ServiceLocatorManagementPrx::checkedCast(communicator()->propertyToProxy("ServiceLocatorManagementProxy"));
+    Hydra::Core::Discovery::V1::ServiceManagementPrx service_management = Hydra::Core::Discovery::V1::ServiceManagementPrx::uncheckedCast(management->addService(s, "BridgeFactoryService"));
+    Hydra::Core::Discovery::V1::ServiceLocatorParamsPtr params = new Hydra::Core::Discovery::V1::ServiceLocatorParams();
+    params->category = "bridging";
+    service_management->addLocatorParams(params, "");
+
     communicator()->waitForShutdown();
+
+    service_management->unregister();
     return EXIT_SUCCESS;
 }
 

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list