[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "configuration-replication" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue May 17 08:23:13 CDT 2011


branch "configuration-replication" has been updated
       via  70dab79e95c3da49b6a1ea7ed8564530fd57a389 (commit)
      from  a9f2d2c2f87162aaeec2d1080b860e059fe31cbd (commit)

Summary of changes:
 src/CMakeLists.txt            |    3 +-
 src/CollocatedIceStorm.cpp    |   87 -----------------------------------------
 src/CollocatedIceStorm.h      |   60 ----------------------------
 src/RtpStateReplicatorApp.cpp |    3 +-
 4 files changed, 3 insertions(+), 150 deletions(-)
 delete mode 100644 src/CollocatedIceStorm.cpp
 delete mode 100644 src/CollocatedIceStorm.h


- Log -----------------------------------------------------------------
commit 70dab79e95c3da49b6a1ea7ed8564530fd57a389
Author: Joshua Colp <jcolp at digium.com>
Date:   Tue May 17 10:24:33 2011 -0300

    Use the collocated icestorm stuff from ice-util-cpp.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 15c7630..90b667d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -34,8 +34,6 @@ asterisk_scf_component_install(media_rtp_pjmedia)
 asterisk_scf_component_init(RtpStateReplicator)
 asterisk_scf_component_add_file(RtpStateReplicator RtpStateReplicatorApp.cpp)
 asterisk_scf_component_add_file(RtpStateReplicator RtpStateReplicator.h)
-asterisk_scf_component_add_file(RtpStateReplicator CollocatedIceStorm.cpp)
-asterisk_scf_component_add_file(RtpStateReplicator CollocatedIceStorm.h)
 asterisk_scf_component_add_slice(RtpStateReplicator ../local-slice/RtpStateReplicationIf.ice)
 asterisk_scf_component_add_slice(RtpStateReplicator ../local-slice/RtpConfigurationIf.ice)
 asterisk_scf_component_add_ice_libraries(RtpStateReplicator IceStorm)
@@ -43,4 +41,5 @@ asterisk_scf_component_add_boost_libraries(RtpStateReplicator thread date_time)
 asterisk_scf_component_build_icebox(RtpStateReplicator)
 target_link_libraries(RtpStateReplicator asterisk-scf-api)
 target_link_libraries(RtpStateReplicator logging-client)
+target_link_libraries(RtpStateReplicator ice-util-cpp)
 asterisk_scf_component_install(RtpStateReplicator)
diff --git a/src/CollocatedIceStorm.cpp b/src/CollocatedIceStorm.cpp
deleted file mode 100644
index 84dbe37..0000000
--- a/src/CollocatedIceStorm.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-#include <Ice/Ice.h>
-#include <IceStorm/IceStorm.h>
-#include <assert.h>
-#include <algorithm>
-#include "CollocatedIceStorm.h"
-
-using namespace AsteriskSCF::Media::RTP;
-
-//
-// The idea behind this class is that it needs to access the entry point that IceBox would
-// have used and then invoke the methods that are needed to start and stop the IceStorm
-// service.
-//
-typedef IceBox::Service* (*FACTORY)(Ice::CommunicatorPtr);
-
-CollocatedIceStorm::CollocatedIceStorm(const std::string& namePrefix, const Ice::PropertiesPtr& properties) :
-    mStopped(false)
-{
-    //
-    // We create our own communicator to avoid issues with call order on shutdown.
-    //
-    Ice::InitializationData initData;
-    initData.properties = properties;
-    mCommunicator = Ice::initialize(initData);
-
-    std::string loadString = mCommunicator->getProperties()->getPropertyWithDefault("IceStorm.EntryPoint", "IceStormService:createIceStorm");
-
-    mLibrary = new IceUtilInternal::DynamicLibrary;
-    IceUtilInternal::DynamicLibrary::symbol_type entry = mLibrary->loadEntryPoint(loadString);
-    if(entry == 0)
-    {
-        throw mLibrary->getErrorMessage();
-    }
-    FACTORY factory = (FACTORY)entry;
-    mService = factory(mCommunicator);
-    assert(mService != 0);
-    Ice::StringSeq options;
-    mService->start(namePrefix, mCommunicator, options);
-}
-
-CollocatedIceStorm::~CollocatedIceStorm()
-{
-    if(!mStopped)
-    {
-        try
-        {
-            stop();
-            mCommunicator->destroy();
-        }
-        catch(...)
-        {
-        }
-    }
-}
-
-void CollocatedIceStorm::stop()
-{
-    //
-    // NOTE: there isn't any mutex protection here. It can be added later if needed, but at the moment multiple threads
-    // do not have access to this object instance.
-    //
-    if(!mStopped)
-    {
-        if(mService)
-        {
-            mService->stop();
-        }
-        mCommunicator->shutdown();
-        mCommunicator->waitForShutdown();
-        mStopped = true;
-    }
-}
diff --git a/src/CollocatedIceStorm.h b/src/CollocatedIceStorm.h
deleted file mode 100644
index 7481fa5..0000000
--- a/src/CollocatedIceStorm.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-#pragma once
-
-#include <IceUtil/DynamicLibrary.h>
-#include <Ice/Service.h>
-#include <IceBox/IceBox.h>
-#include <Ice/Ice.h>
-#include <IceStorm/IceStorm.h>
-#include <string>
-
-namespace AsteriskSCF
-{
-namespace Media
-{
-namespace RTP
-{
-
-/**
- * A helper class that instantiates IceStorm in-process, removing the need to launch
- * a separate process to access IceStorm services.
- */
-
-class CollocatedIceStorm : public IceUtil::Shared
-{
-public:
-    CollocatedIceStorm(const std::string&, const Ice::PropertiesPtr&);
-    ~CollocatedIceStorm();
-
-    /**
-     * "nice" applications should explictly call stop !
-     */
-    void stop();
-
-private:
-    IceUtilInternal::DynamicLibraryPtr mLibrary;
-    IceBox::ServicePtr mService;
-    Ice::CommunicatorPtr mCommunicator;
-    bool mStopped;
-};
-
-typedef IceUtil::Handle<CollocatedIceStorm> CollocatedIceStormPtr;
-
-} /* end of RTP */
-} /* end of Media */
-} /* end of AsteriskSCF */
-
diff --git a/src/RtpStateReplicatorApp.cpp b/src/RtpStateReplicatorApp.cpp
index 123b368..a65f52b 100644
--- a/src/RtpStateReplicatorApp.cpp
+++ b/src/RtpStateReplicatorApp.cpp
@@ -25,10 +25,10 @@
 #include <AsteriskSCF/System/Component/ComponentServiceIf.h>
 #include <AsteriskSCF/Logger/IceLogger.h>
 #include <AsteriskSCF/logger.h>
+#include <AsteriskSCF/CollocatedIceStorm/CollocatedIceStorm.h>
 
 #include "RtpConfigurationIf.h"
 #include "RtpStateReplicator.h"
-#include "CollocatedIceStorm.h"
 
 using namespace std;
 using namespace AsteriskSCF::Core;
@@ -37,6 +37,7 @@ using namespace AsteriskSCF::System::Component::V1;
 using namespace AsteriskSCF::System::Logging;
 using namespace AsteriskSCF::Media::RTP::V1;
 using namespace AsteriskSCF::Media::RTP;
+using namespace AsteriskSCF::CollocatedIceStorm;
 
 namespace
 {

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


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list