[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
Mon Sep 19 14:08:40 CDT 2011
branch "master" has been updated
via 42a97b75bd20881b77d681ccd4ee00bb91577420 (commit)
from 8b7006f218db702c9afcefefc892ea55f11e0e78 (commit)
Summary of changes:
config/test_component.conf | 71 +++++++++++++++++
config/test_component.config | 88 ----------------------
config/test_service_locator.config | 65 ----------------
config/test_service_locator_listener.config | 65 ----------------
config/test_servicelocator_state_replicator.conf | 11 ---
src/ServiceLocator.cpp | 21 +++---
src/ServiceLocatorStateReplicatorApp.cpp | 2 +-
test/CMakeLists.txt | 2 +-
8 files changed, 84 insertions(+), 241 deletions(-)
create mode 100644 config/test_component.conf
delete mode 100644 config/test_component.config
delete mode 100644 config/test_service_locator.config
delete mode 100644 config/test_service_locator_listener.config
delete mode 100644 config/test_servicelocator_state_replicator.conf
- Log -----------------------------------------------------------------
commit 42a97b75bd20881b77d681ccd4ee00bb91577420
Author: Joshua Colp <jcolp at digium.com>
Date: Mon Sep 19 16:14:47 2011 -0300
Make the service locator conform to the configuration file in the examples repo.
diff --git a/config/test_component.conf b/config/test_component.conf
new file mode 100644
index 0000000..2cca6a6
--- /dev/null
+++ b/config/test_component.conf
@@ -0,0 +1,71 @@
+# This is a configuration file used in conjunction with the service discovery test driver
+
+#
+# Ice configuration
+#
+
+# Collocation is incompatible with AMI/AMD which sharing a communicator
+Ice.Default.CollocationOptimized=0
+
+#
+# icebox configuration
+#
+IceBox.InheritProperties=1
+
+#
+# IceBox load order
+#
+IceBox.LoadOrder=ServiceDiscoveryStateReplicator,ServiceDiscovery,ServiceDiscoveryTest
+
+#
+# ServiceDiscovery configuration
+#
+IceBox.Service.ServiceDiscovery=service_locator:create
+
+# Test endpoints for the service locator local adapter
+ServiceDiscovery.BackplaneAdapter.Endpoints=tcp -p 4410
+
+# Test endpoints for the service locator discovery adapter
+ServiceDiscovery.Locator.ServiceAdapter.Endpoints=tcp -p 4411
+
+# Test endpoints for the service locator management adapter
+ServiceDiscovery.Management.ServiceAdapter.Endpoints=tcp -p 4422
+
+# Name for the IceStorm instance
+ServiceDiscovery.IceStorm.InstanceName=ServiceDiscoveryIceStorm
+
+# Proxy to the state replicator
+ServiceDiscovery.StateReplicator.Proxy=ServiceLocatorStateReplicatorService:tcp -p 4413
+
+# 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
+
+#
+# ServiceDiscoveryReplicator configuration
+#
+IceBox.Service.ServiceDiscoveryStateReplicator=ServiceLocatorStateReplicator:create
+
+# 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
+
diff --git a/config/test_component.config b/config/test_component.config
deleted file mode 100644
index 812d22f..0000000
--- a/config/test_component.config
+++ /dev/null
@@ -1,88 +0,0 @@
-# This is a configuration file used in conjunction with the service discovery test driver
-
-#
-# Ice configuration
-#
-
-# Collocation is incompatible with AMI/AMD which sharing a communicator
-Ice.Default.CollocationOptimized=0
-
-#
-# icebox configuration
-#
-IceBox.InheritProperties=1
-
-AsteriskSCFIceStorm.InstanceName=AsteriskSCFIceStorm
-
-#
-# This property defines the endpoints on which the IceStorm
-# TopicManager listens.
-#
-AsteriskSCFIceStorm.TopicManager.Endpoints=default -p 10000
-
-#
-# This property defines the endpoints on which the topic
-# publisher objects listen. If you want to federate
-# IceStorm instances this must run on a fixed port (or use
-# IceGrid).
-#
-AsteriskSCFIceStorm.Publish.Endpoints=tcp -p 10001:udp -p 10001
-
-#
-# TopicManager Tracing
-#
-# 0 = no tracing
-# 1 = trace topic creation, subscription, unsubscription
-# 2 = like 1, but with more detailed subscription information
-#
-AsteriskSCFIceStorm.Trace.TopicManager=2
-
-#
-AsteriskSCFIceStorm.Flush.Timeout=2000
-
-# Service Locator State Replicator Configuration
-IceBox.Service.ServiceDiscoveryStateReplicator=ServiceLocatorStateReplicator:create
-
-# Test endpoints for the state replicator
-ServiceLocatorStateReplicator.Endpoints=tcp -p 4413:udp -p 4413
-
-#
-# ServiceDiscovery configuration
-#
-IceBox.Service.ServiceDiscovery=service_locator:create
-
-# Test endpoints for the service locator local adapter
-ServiceLocatorLocalAdapter.Endpoints=tcp -p 4412
-
-# Test endpoints for the service locator management adapter
-ServiceLocatorManagementAdapter.Endpoints=tcp -p 4422
-
-# Test endpoints for the service locator adapter
-ServiceLocatorAdapter.Endpoints=tcp -p 4411
-
-# Test endpoints for IceStorm
-TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000
-
-# Proxy to the state replicator
-ServiceLocator.StateReplicator.Proxy=ServiceLocatorStateReplicatorService:tcp -p 4413
-
-# Configure ourselves as a master
-ServiceLocatorStateReplicatorListener=no
-
-#
-# Logger configuration
-#
-LoggerAdapter.Endpoints=default
-
-#
-# test configuration
-#
-IceBox.Service.ServiceDiscoveryTest=service_locator_test:create
-
-LocatorService.Proxy=LocatorService:tcp -p 4411
-ServiceLocatorManagement.proxy=ServiceLocatorManagement:tcp -p 4422
-
-#
-# IceBox load order
-#
-IceBox.LoadOrder=ServiceDiscoveryStateReplicator,ServiceDiscovery,ServiceDiscoveryTest
diff --git a/config/test_service_locator.config b/config/test_service_locator.config
deleted file mode 100644
index 2ad533f..0000000
--- a/config/test_service_locator.config
+++ /dev/null
@@ -1,65 +0,0 @@
-# This is a configuration file used in conjunction with the service discovery test driver
-
-
-#
-# Ice configuration
-#
-
-# Collocation is incompatible with AMI/AMD which sharing a communicator
-Ice.Default.CollocationOptimized=0
-
-#
-# IceBox configuration
-#
-
-IceBox.InheritProperties=1
-IceBox.Service.ServiceDiscovery=service_locator:create
-
-AsteriskSCFIceStorm.InstanceName=AsteriskSCFIceStorm
-#
-# This property defines the endpoints on which the IceStorm
-# TopicManager listens.
-#
-AsteriskSCFIceStorm.TopicManager.Endpoints=default -p 10000
-
-#
-# This property defines the endpoints on which the topic
-# publisher objects listen. If you want to federate
-# IceStorm instances this must run on a fixed port (or use
-# IceGrid).
-#
-AsteriskSCFIceStorm.Publish.Endpoints=tcp -p 10001:udp -p 10001
-
-#
-# TopicManager Tracing
-#
-# 0 = no tracing
-# 1 = trace topic creation, subscription, unsubscription
-# 2 = like 1, but with more detailed subscription information
-#
-AsteriskSCFIceStorm.Trace.TopicManager=2
-AsteriskSCFIceStorm.Transient=1
-
-#
-AsteriskSCFIceStorm.Flush.Timeout=2000
-# This is a configuration file used in conjunction with the service locator test driver
-
-# Test endpoints for the service locator management adapter
-ServiceLocatorManagementAdapter.Endpoints=tcp -p 4422
-
-# Test endpoints for the service locator local adapter
-ServiceLocatorLocalAdapter.Endpoints=tcp -p 4412
-
-# Test endpoints for the service locator adapter
-ServiceLocatorAdapter.Endpoints=tcp -p 4411
-LocatorService.Proxy=LocatorService:tcp -p 4411
-
-ServiceLocator.StateReplicator.Proxy=ServiceLocatorStateReplicatorService:tcp -p 4413
-
-ServiceLocatorStateReplicatorListener=no
-
-# Test endpoints for IceStorm
-TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000
-
-# Logger configuration
-LoggerAdapter.Endpoints=default
diff --git a/config/test_service_locator_listener.config b/config/test_service_locator_listener.config
deleted file mode 100644
index 12f1482..0000000
--- a/config/test_service_locator_listener.config
+++ /dev/null
@@ -1,65 +0,0 @@
-# This is a configuration file used in conjunction with the service discovery test driver
-
-
-#
-# Ice configuration
-#
-
-# Collocation is incompatible with AMI/AMD which sharing a communicator
-Ice.Default.CollocationOptimized=0
-
-#
-# IceBox configuration
-#
-
-IceBox.InheritProperties=1
-IceBox.Service.ServiceDiscovery=service_locator:create
-
-AsteriskSCFIceStorm.InstanceName=AsteriskSCFIceStorm
-#
-# This property defines the endpoints on which the IceStorm
-# TopicManager listens.
-#
-AsteriskSCFIceStorm.TopicManager.Endpoints=default -p 10000
-
-#
-# This property defines the endpoints on which the topic
-# publisher objects listen. If you want to federate
-# IceStorm instances this must run on a fixed port (or use
-# IceGrid).
-#
-AsteriskSCFIceStorm.Publish.Endpoints=tcp -p 10001:udp -p 10001
-
-#
-# TopicManager Tracing
-#
-# 0 = no tracing
-# 1 = trace topic creation, subscription, unsubscription
-# 2 = like 1, but with more detailed subscription information
-#
-AsteriskSCFIceStorm.Trace.TopicManager=2
-AsteriskSCFIceStorm.Transient=1
-
-#
-AsteriskSCFIceStorm.Flush.Timeout=2000
-# This is a configuration file used in conjunction with the service locator test driver
-
-# Test endpoints for the service locator management adapter
-ServiceLocatorManagementAdapter.Endpoints=tcp -p 4422
-
-# Test endpoints for the service locator local adapter
-ServiceLocatorLocalAdapter.Endpoints=tcp -p 4412
-
-# Test endpoints for the service locator adapter
-ServiceLocatorAdapter.Endpoints=tcp -p 4411
-LocatorService.Proxy=LocatorService:tcp -p 4411
-
-ServiceLocator.StateReplicator.Proxy=ServiceLocatorStateReplicatorService:tcp -p 4413
-
-ServiceLocatorStateReplicatorListener=yes
-
-# Test endpoints for IceStorm
-TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000
-
-# Logger configuration
-LoggerAdapter.Endpoints=default
diff --git a/config/test_servicelocator_state_replicator.conf b/config/test_servicelocator_state_replicator.conf
deleted file mode 100644
index 98a48d4..0000000
--- a/config/test_servicelocator_state_replicator.conf
+++ /dev/null
@@ -1,11 +0,0 @@
-# Adapter parameters for this component
-ServiceLocatorStateReplicator.Endpoints=tcp -p 4413:udp -p 4413
-ServiceLocatorStateReplicator.ThreadPool.Size=4
-
-# A proxy to the IceStorm topic manager
-TopicManager.Proxy=AsteriskSCFIceStorm/TopicManager:default -p 10000
-
-LocatorService.Proxy=LocatorService:tcp -p 4411
-
-IceBox.InheritProperties=1
-IceBox.Service.ServiceLocatorStateReplicator=ServiceLocatorStateReplicator:create
diff --git a/src/ServiceLocator.cpp b/src/ServiceLocator.cpp
index 34fe063..1000781 100644
--- a/src/ServiceLocator.cpp
+++ b/src/ServiceLocator.cpp
@@ -165,12 +165,14 @@ void ServiceLocatorImpl::locateAll_async(const AMD_ServiceLocator_locateAllPtr&
mLocatorServiceManagement->locateAll(cb, params);
}
-void ServiceLocatorApp::start(const string&, const Ice::CommunicatorPtr& communicator,
+void ServiceLocatorApp::start(const string& appName, const Ice::CommunicatorPtr& communicator,
const Ice::StringSeq&)
{
- mIceStorm = new AsteriskSCF::CollocatedIceStorm::CollocatedIceStorm("AsteriskSCFIceStorm", communicator->getProperties());
+ mIceStorm = new AsteriskSCF::CollocatedIceStorm::CollocatedIceStorm(communicator->getProperties()->getPropertyWithDefault(
+ appName + ".IceStorm.InstanceName", "ServiceDiscovery"),
+ communicator->getProperties());
- mLocalAdapter = communicator->createObjectAdapter("ServiceLocatorLocalAdapter");
+ mLocalAdapter = communicator->createObjectAdapter(appName + ".BackplaneAdapter");
ConfiguredIceLoggerPtr mIceLogger = createIceLogger(mLocalAdapter);
@@ -182,15 +184,14 @@ void ServiceLocatorApp::start(const string&, const Ice::CommunicatorPtr& communi
/* Talk to the topic manager to either create or get the service discovery topic,
* configured or default */
- IceStorm::TopicManagerPrx topicManager = IceStorm::TopicManagerPrx::checkedCast(
- communicator->propertyToProxy("TopicManager.Proxy"));
+ IceStorm::TopicManagerPrx topicManager = mIceStorm->createTopicManagerProxy(communicator);
EventsPrx serviceDiscoveryTopic;
if (topicManager)
{
Ice::PropertiesPtr props = communicator->getProperties();
- string topicName = props->getProperty("ServiceLocator.TopicName");
+ string topicName = props->getProperty(appName + ".TopicName");
if (topicName.empty())
{
@@ -231,7 +232,7 @@ void ServiceLocatorApp::start(const string&, const Ice::CommunicatorPtr& communi
* into the infrastructure while discovery as a read only function may be allowed to all.
*/
mManagementAdapter= communicator->createObjectAdapter(
- "ServiceLocatorManagementAdapter");
+ appName + ".Management.ServiceAdapter");
ServiceLocatorManagementImplPtr locatorServiceManagement =
new ServiceLocatorManagementImpl(mManagementAdapter, serviceDiscoveryTopic, mReplicaService);
@@ -243,13 +244,13 @@ void ServiceLocatorApp::start(const string&, const Ice::CommunicatorPtr& communi
try
{
- mStateReplicator = ServiceLocatorStateReplicatorPrx::checkedCast(communicator->propertyToProxy("ServiceLocator.StateReplicator.Proxy"));
+ mStateReplicator = ServiceLocatorStateReplicatorPrx::checkedCast(communicator->propertyToProxy(appName + ".StateReplicator.Proxy"));
ServiceLocatorStateReplicatorListenerPtr replicatorListener = new ServiceLocatorStateReplicatorListenerI(locatorServiceManagement);
ServiceLocatorStateReplicatorListenerPrx replicatorListenerProxy = ServiceLocatorStateReplicatorListenerPrx::uncheckedCast(mLocalAdapter->addWithUUID(replicatorListener));
locatorServiceManagement->setStateReplicator(mStateReplicator);
- if (communicator->getProperties()->getPropertyWithDefault("ServiceLocatorStateReplicatorListener", "no") == "yes")
+ if (communicator->getProperties()->getPropertyWithDefault(appName + ".Standalone", "no") == "yes")
{
mReplicaService->standby();
mStateReplicator->addListener(replicatorListenerProxy);
@@ -272,7 +273,7 @@ void ServiceLocatorApp::start(const string&, const Ice::CommunicatorPtr& communi
lg(Info) << "Activated service discovery management.";
- mDiscoveryAdapter = communicator->createObjectAdapter("ServiceLocatorAdapter");
+ mDiscoveryAdapter = communicator->createObjectAdapter(appName + ".Locator.ServiceAdapter");
ServiceLocatorPtr locatorService = new ServiceLocatorImpl(locatorServiceManagement);
diff --git a/src/ServiceLocatorStateReplicatorApp.cpp b/src/ServiceLocatorStateReplicatorApp.cpp
index 93bd340..23378f7 100644
--- a/src/ServiceLocatorStateReplicatorApp.cpp
+++ b/src/ServiceLocatorStateReplicatorApp.cpp
@@ -86,7 +86,7 @@ private:
void ServiceLocatorStateReplicatorService::initialize(const std::string appName, const Ice::CommunicatorPtr& ic)
{
- mAdapter = ic->createObjectAdapter("ServiceLocatorStateReplicator");
+ mAdapter = ic->createObjectAdapter(appName + ".Adapter");
// setup logging client
mIceLogger = createIceLogger(mAdapter);
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d5cf790..bbfa333 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -5,6 +5,6 @@ astscf_component_add_ice_libraries(service_locator_test IceStorm)
astscf_component_add_boost_libraries(service_locator_test unit_test_framework thread date_time)
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.config)
+astscf_test_icebox(service_locator_test config/test_component.conf)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/AsteriskSCFIceStorm)
-----------------------------------------------------------------------
--
asterisk-scf/release/servicediscovery.git
More information about the asterisk-scf-commits
mailing list