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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Sep 20 16:00:39 CDT 2011


branch "master" has been updated
       via  46cd353e6e9c738ca42c9aa24913bc95ad4f3699 (commit)
      from  42a97b75bd20881b77d681ccd4ee00bb91577420 (commit)

Summary of changes:
 config/test_component.conf      |   25 ++++++++-----------------
 src/ServiceLocator.cpp          |   14 ++++++++++----
 test/TestComparatorBlocking.cpp |    2 +-
 test/TestServiceLocator.cpp     |    2 +-
 4 files changed, 20 insertions(+), 23 deletions(-)


- Log -----------------------------------------------------------------
commit 46cd353e6e9c738ca42c9aa24913bc95ad4f3699
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Tue Sep 20 15:59:30 2011 -0500

    Added default adapter port settings to make it easier to use ServiceLocator in unit tests.
    Made default port usage consistent.

diff --git a/config/test_component.conf b/config/test_component.conf
index 2cca6a6..18866fe 100644
--- a/config/test_component.conf
+++ b/config/test_component.conf
@@ -29,10 +29,10 @@ ServiceDiscovery.BackplaneAdapter.Endpoints=tcp -p 4410
 ServiceDiscovery.Locator.ServiceAdapter.Endpoints=tcp -p 4411
 
 # Test endpoints for the service locator management adapter
-ServiceDiscovery.Management.ServiceAdapter.Endpoints=tcp -p 4422
+ServiceDiscovery.Management.ServiceAdapter.Endpoints=tcp -p 4412
 
 # Name for the IceStorm instance
-ServiceDiscovery.IceStorm.InstanceName=ServiceDiscoveryIceStorm
+ServiceDiscovery.IceStorm.InstanceName=ServiceDiscovery
 
 # Proxy to the state replicator
 ServiceDiscovery.StateReplicator.Proxy=ServiceLocatorStateReplicatorService:tcp -p 4413
@@ -40,14 +40,11 @@ ServiceDiscovery.StateReplicator.Proxy=ServiceLocatorStateReplicatorService:tcp
 # Configure ourselves as a master
 ServiceDiscovery.Standalone=no
 
-ServiceDiscoveryIceStorm.InstanceName=ServiceDiscoveryIceStorm
-ServiceDiscoveryIceStorm.IceStorm.InstanceName=ServiceDiscoveryIceStorm
-ServiceDiscoveryIceStorm.TopicManager.Endpoints=default -p 4421
-ServiceDiscoveryIceStorm.IceStorm.TopicManager.Endpoints=default -p 4421
-ServiceDiscoveryIceStorm.Publish.Endpoints=default -p 4423
-ServiceDiscoveryIceStorm.Trace.TopicManager=2
-ServiceDiscoveryIceStorm.Transient=1
-ServiceDiscoveryIceStorm.Flush.Timeout=2000
+ServiceDiscovery.IceStorm.TopicManager.Endpoints=default -p 4421
+ServiceDiscovery.IceStorm.Publish.Endpoints=tcp -p 4422:udp -p 4422
+ServiceDiscovery.IceStorm.Trace.TopicManager=2
+ServiceDiscovery.IceStorm.Transient=1
+ServiceDiscovery.IceStorm.Flush.Timeout=2000
 
 #
 # ServiceDiscoveryReplicator configuration
@@ -57,15 +54,9 @@ IceBox.Service.ServiceDiscoveryStateReplicator=ServiceLocatorStateReplicator:cre
 # Test endpoints for the state replicator
 ServiceDiscoveryStateReplicator.Adapter.Endpoints=tcp -p 4413:udp -p 4413
 
-#
-# Logger configuration
-#
-LoggerAdapter.Endpoints=default
-
-#
 # test configuration
-#
 IceBox.Service.ServiceDiscoveryTest=service_locator_test:create
 
 LocatorService.Proxy=LocatorService:tcp -p 4411
+LocatorServiceManagement.Proxy=LocatorServiceManagement:tcp -p 4412
 
diff --git a/src/ServiceLocator.cpp b/src/ServiceLocator.cpp
index 1000781..9bd0eaa 100644
--- a/src/ServiceLocator.cpp
+++ b/src/ServiceLocator.cpp
@@ -172,7 +172,9 @@ void ServiceLocatorApp::start(const string& appName, const Ice::CommunicatorPtr&
                                                                             appName + ".IceStorm.InstanceName", "ServiceDiscovery"),
                                                                         communicator->getProperties());
 
-    mLocalAdapter = communicator->createObjectAdapter(appName + ".BackplaneAdapter");
+    string backplaneAdapterName = appName + ".BackplaneAdapter";
+    mLocalAdapter = communicator->createObjectAdapterWithEndpoints(backplaneAdapterName,
+        communicator->getProperties()->getPropertyWithDefault(backplaneAdapterName + ".Endpoints", "tcp -p 4410"));
 
     ConfiguredIceLoggerPtr mIceLogger = createIceLogger(mLocalAdapter);
 
@@ -231,8 +233,10 @@ void ServiceLocatorApp::start(const string& appName, const Ice::CommunicatorPtr&
      * management may want to be protected so arbitrary people can't inject bad services
      * into the infrastructure while discovery as a read only function may be allowed to all.
      */
-    mManagementAdapter= communicator->createObjectAdapter(
-        appName + ".Management.ServiceAdapter");
+
+    string managementAdapterName = appName + ".Management.ServiceAdapter";
+    mManagementAdapter = communicator->createObjectAdapterWithEndpoints(managementAdapterName,
+        communicator->getProperties()->getPropertyWithDefault(managementAdapterName + ".Endpoints", "tcp -p 4412"));
 
     ServiceLocatorManagementImplPtr locatorServiceManagement =
         new ServiceLocatorManagementImpl(mManagementAdapter, serviceDiscoveryTopic, mReplicaService);
@@ -273,7 +277,9 @@ void ServiceLocatorApp::start(const string& appName, const Ice::CommunicatorPtr&
 
     lg(Info) << "Activated service discovery management.";
 
-    mDiscoveryAdapter = communicator->createObjectAdapter(appName + ".Locator.ServiceAdapter");
+    string locatorAdapterName = appName + ".Locator.ServiceAdapter";
+    mDiscoveryAdapter = communicator->createObjectAdapterWithEndpoints(locatorAdapterName,
+        communicator->getProperties()->getPropertyWithDefault(locatorAdapterName + ".Endpoints", "tcp -p 4411"));
 
     ServiceLocatorPtr locatorService = new ServiceLocatorImpl(locatorServiceManagement);
 
diff --git a/test/TestComparatorBlocking.cpp b/test/TestComparatorBlocking.cpp
index c8cc599..8827fc2 100644
--- a/test/TestComparatorBlocking.cpp
+++ b/test/TestComparatorBlocking.cpp
@@ -145,7 +145,7 @@ public:
         discoveryCommunicator(Ice::initialize()),
         management(ServiceLocatorManagementPrx::checkedCast(
                 discoveryCommunicator->stringToProxy(
-                    "LocatorServiceManagement:tcp -p 4422"))),
+                    "LocatorServiceManagement:tcp -p 4412"))),
         discovery(ServiceLocatorPrx::checkedCast(
                 discoveryCommunicator->stringToProxy(
                     "LocatorService:tcp -p 4411"))),
diff --git a/test/TestServiceLocator.cpp b/test/TestServiceLocator.cpp
index d9d6ef4..7a60b11 100644
--- a/test/TestServiceLocator.cpp
+++ b/test/TestServiceLocator.cpp
@@ -188,7 +188,7 @@ struct GlobalIceFixture
 
             // TODO: This should use a configuration file most likely instead of hardcoding
 
-            testbed.management = ServiceLocatorManagementPrx::checkedCast(testbed.communicatorOutgoing->stringToProxy("LocatorServiceManagement:tcp -p 4422"));
+            testbed.management = ServiceLocatorManagementPrx::checkedCast(testbed.communicatorOutgoing->stringToProxy("LocatorServiceManagement:tcp -p 4412"));
 
             if (!testbed.management)
             {

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


-- 
asterisk-scf/release/servicediscovery.git



More information about the asterisk-scf-commits mailing list