[asterisk-scf-commits] asterisk-scf/integration/logger.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Oct 4 14:50:51 CDT 2010
branch "master" has been updated
via 0bdb9df057dff809cee78205769a50c7e0a6784a (commit)
from 8cbc97a73e0196d39aa727fc55ba4c0d5b9c9161 (commit)
Summary of changes:
cmake | 2 +-
server/config/logging-server.conf | 5 +++-
server/src/CMakeLists.txt | 4 +-
server/src/main.cpp | 54 +++++++++++++++++++-----------------
server/test/CMakeLists.txt | 12 +-------
5 files changed, 37 insertions(+), 40 deletions(-)
mode change 100644 => 100755 server/config/logging-server.conf
mode change 100644 => 100755 server/src/CMakeLists.txt
mode change 100644 => 100755 server/src/main.cpp
mode change 100644 => 100755 server/test/CMakeLists.txt
- Log -----------------------------------------------------------------
commit 0bdb9df057dff809cee78205769a50c7e0a6784a
Author: David M. Lee <dlee at digium.com>
Date: Mon Oct 4 14:22:48 2010 -0500
Run LoggingServer as an icebox service.
diff --git a/cmake b/cmake
index 9615ced..e348824 160000
--- a/cmake
+++ b/cmake
@@ -1 +1 @@
-Subproject commit 9615ced9f07f8c01ca1c8b3f2b29aa5d05a185da
+Subproject commit e3488247f81dfae2695e778565a7c43182836313
diff --git a/server/config/logging-server.conf b/server/config/logging-server.conf
old mode 100644
new mode 100755
index a601ad9..ca14501
--- a/server/config/logging-server.conf
+++ b/server/config/logging-server.conf
@@ -1,5 +1,8 @@
# Configuration file for the logging server
+# load w/ icebox
+IceBox.Service.Logger=logging-service:createLoggingService --Ice.Config=server/config/logging-server.conf
+
# Ice config
AsteriskSCF.LoggingService.Endpoints=default
@@ -11,4 +14,4 @@ TopicManager.Proxy=HydraIceStorm/TopicManager:default -p 10000
# Log levels
AsteriskSCF.Logging.logger=Error
-AsteriskSCF.Logging.logger.AsteriskSCF=Info
\ No newline at end of file
+AsteriskSCF.Logging.logger.AsteriskSCF=Info
diff --git a/server/src/CMakeLists.txt b/server/src/CMakeLists.txt
old mode 100644
new mode 100755
index 02198f9..2959867
--- a/server/src/CMakeLists.txt
+++ b/server/src/CMakeLists.txt
@@ -26,6 +26,6 @@ hydra_component_add_file(logging-service LoggingServer.h)
hydra_add_ice_libraries(IceStorm)
-hydra_component_build_standalone(logging-service)
+hydra_component_build_icebox(logging-service)
-hydra_component_install(logging-service RUNTIME bin "Logging Service" System)
+#hydra_component_install(logging-service RUNTIME bin "Logging Service" System)
diff --git a/server/src/main.cpp b/server/src/main.cpp
old mode 100644
new mode 100755
index 3a8dc95..663700f
--- a/server/src/main.cpp
+++ b/server/src/main.cpp
@@ -6,8 +6,9 @@
* All rights reserved.
*/
+#include <Ice/Ice.h>
#include <Ice/Properties.h>
-#include <Ice/Service.h>
+#include <IceBox/IceBox.h>
#include <IceStorm/IceStorm.h>
#include "Core/Discovery/ServiceLocatorIf.h"
@@ -24,35 +25,39 @@ namespace
const std::string AdapterName = "AsteriskSCF.LoggingService";
const std::string LogFileName = "asterisk-scf.log";
-class LoggingServerDaemon : public Ice::Service
+class LoggingService : public IceBox::Service
{
protected:
- bool start(int argc, char *argv[], int &status);
- bool stop();
+ void start(std::string const &name,
+ Ice::CommunicatorPtr const &communicator,
+ Ice::StringSeq const &args);
+ void stop();
private:
Ice::ObjectAdapterPtr mAdapter;
ServiceManagementPrx mServiceManagement;
- void registerWithServiceLocator(LoggingServerPrx serverProxy);
- void setupDefaultProperties();
+ void registerWithServiceLocator(Ice::CommunicatorPtr const &communicator,
+ LoggingServerPrx serverProxy);
+ void setupDefaultProperties(Ice::CommunicatorPtr const &communicator);
void setDefaultProperty(Ice::Properties &properties, std::string const &key,
std::string const &defaultValue);
};
}
-void LoggingServerDaemon::registerWithServiceLocator(
+void LoggingService::registerWithServiceLocator(
+ Ice::CommunicatorPtr const &communicator,
LoggingServerPrx serverProxy)
{
try
{
std::string locatorManagementProxyString =
- communicator()->getProperties()->getProperty(
+ communicator->getProperties()->getProperty(
"ServiceLocatorManagement.Proxy");
if (!locatorManagementProxyString.empty())
{
ServiceLocatorManagementPrx management =
ServiceLocatorManagementPrx::checkedCast(
- communicator()->stringToProxy(locatorManagementProxyString));
+ communicator->stringToProxy(locatorManagementProxyString));
mServiceManagement = management->addService(serverProxy,
LoggingServerGuid);
ServiceLocatorParamsPtr params = new ServiceLocatorParams(
@@ -67,14 +72,14 @@ void LoggingServerDaemon::registerWithServiceLocator(
}
}
-void LoggingServerDaemon::setupDefaultProperties()
+void LoggingService::setupDefaultProperties(Ice::CommunicatorPtr const &communicator)
{
- Ice::PropertiesPtr props = communicator()->getProperties();
+ Ice::PropertiesPtr props = communicator->getProperties();
setDefaultProperty(*props, AdapterName + ".Endpoints", "default");
}
-void LoggingServerDaemon::setDefaultProperty(Ice::Properties &props,
+void LoggingService::setDefaultProperty(Ice::Properties &props,
std::string const &key, std::string const &defaultValue)
{
if (props.getProperty(key).empty())
@@ -83,11 +88,13 @@ void LoggingServerDaemon::setDefaultProperty(Ice::Properties &props,
}
}
-bool LoggingServerDaemon::start(int argc, char *argv[], int &status)
+void LoggingService::start(std::string const &name,
+ Ice::CommunicatorPtr const &communicator,
+ Ice::StringSeq const &args)
{
- setupDefaultProperties();
+ setupDefaultProperties(communicator);
- mAdapter = communicator()->createObjectAdapter(AdapterName);
+ mAdapter = communicator->createObjectAdapter(AdapterName);
ServerConfigurationListenerPrx configurationListener;
@@ -95,7 +102,7 @@ bool LoggingServerDaemon::start(int argc, char *argv[], int &status)
{
IceStorm::TopicManagerPrx topicManager =
IceStorm::TopicManagerPrx::checkedCast(
- communicator()->propertyToProxy("TopicManager.Proxy"));
+ communicator->propertyToProxy("TopicManager.Proxy"));
if (topicManager)
{
@@ -142,30 +149,25 @@ bool LoggingServerDaemon::start(int argc, char *argv[], int &status)
}
IceUtil::Handle<LoggingServerI> server = new LoggingServerI;
server->configure(logOut, configurationListener,
- communicator()->getProperties());
+ communicator->getProperties());
LoggingServerPrx serverProxy = LoggingServerPrx::uncheckedCast(
mAdapter->addWithUUID(server));
mAdapter->activate();
std::cout << serverProxy->ice_toString() << '\n';
- registerWithServiceLocator(serverProxy);
-
- status = EXIT_SUCCESS;
- return true;
+ registerWithServiceLocator(communicator, serverProxy);
}
-bool LoggingServerDaemon::stop()
+void LoggingService::stop()
{
if (mServiceManagement)
{
mServiceManagement->unregister();
}
- return true;
}
-int main(int argc, char *argv[])
+extern "C" IceBox::Service* createLoggingService(Ice::CommunicatorPtr communicator)
{
- LoggingServerDaemon daemon;
- return daemon.main(argc, argv);
+ return new LoggingService;
}
diff --git a/server/test/CMakeLists.txt b/server/test/CMakeLists.txt
old mode 100644
new mode 100755
index d221669..4fe7102
--- a/server/test/CMakeLists.txt
+++ b/server/test/CMakeLists.txt
@@ -13,16 +13,6 @@ include_directories(../../common)
hydra_component_add_slice(logging-service-test LoggerIf)
-hydra_component_add_file(logging-service-test ../src/ChainedLogOut.cpp)
-hydra_component_add_file(logging-service-test ../src/FileChainedLogOut.cpp)
-hydra_component_add_file(logging-service-test ../src/OstreamChainedLogOut.cpp)
-hydra_component_add_file(logging-service-test ../src/LoggingServer.cpp)
-
-hydra_component_add_file(logging-service-test ../src/ChainedLogOut.h)
-hydra_component_add_file(logging-service-test ../src/FileChainedLogOut.h)
-hydra_component_add_file(logging-service-test ../src/OstreamChainedLogOut.h)
-hydra_component_add_file(logging-service-test ../src/LoggingServer.h)
-
hydra_component_add_file(logging-service-test LoggingServer-test.cpp)
hydra_component_add_file(logging-service-test server-test.cpp)
@@ -30,4 +20,6 @@ hydra_component_add_boost_libraries(logging-service-test unit_test_framework)
hydra_component_build_standalone(logging-service-test)
+target_link_libraries(logging-service-test logging-service)
+
boost_add_test(logging-service-test)
-----------------------------------------------------------------------
--
asterisk-scf/integration/logger.git
More information about the asterisk-scf-commits
mailing list