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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Feb 6 11:39:12 CST 2012


branch "master" has been updated
       via  dc372a69a62dc2cff4be7fccd5f34e7d4e40b1f7 (commit)
      from  aeeaed86fcbc97a9492a60242870eef57a149f0e (commit)

Summary of changes:
 src/BridgeReplicatorService.cpp |  210 ---------------------------------------
 1 files changed, 0 insertions(+), 210 deletions(-)
 delete mode 100644 src/BridgeReplicatorService.cpp


- Log -----------------------------------------------------------------
commit dc372a69a62dc2cff4be7fccd5f34e7d4e40b1f7
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Mon Feb 6 11:38:49 2012 -0600

    Removed old replicator main.

diff --git a/src/BridgeReplicatorService.cpp b/src/BridgeReplicatorService.cpp
deleted file mode 100644
index baf9f3f..0000000
--- a/src/BridgeReplicatorService.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010-2011, 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 <IceBox/IceBox.h>
-
-#include <AsteriskSCF/Logger/IceLogger.h>
-#include <AsteriskSCF/Logger.h>
-#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
-#include "ServiceUtil.h"
-#include "BridgeReplicatorIf.h"
-#include <AsteriskSCF/Replication/StateReplicator.h>
-
-using namespace AsteriskSCF::System::Logging;
-using namespace AsteriskSCF::SessionCommunications::V1;
-using namespace AsteriskSCF::Core::Discovery::V1;
-using namespace AsteriskSCF::Replication::BridgeService::V1;
-using namespace AsteriskSCF;
-using namespace std;
-
-typedef AsteriskSCF::Replication::StateReplicator<
-    AsteriskSCF::Replication::BridgeService::V1::Replicator,
-    AsteriskSCF::Replication::BridgeService::V1::ReplicatedStateItemPtr,
-    string,
-    AsteriskSCF::Replication::BridgeService::V1::ReplicatorListenerPrx> ReplicatorI;
-
-typedef IceUtil::Handle<ReplicatorI> ReplicatorIPtr;
-
-namespace
-{
-Logger lg = getLoggerFactory().getLogger("AsteriskSCF.BridgeService");
-}
-
-namespace
-{
-
-class BridgeReplicatorApp : public IceBox::Service
-{
-public:
-    BridgeReplicatorApp();
-
-protected:
-    void start(const string& name, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq& args);
-    void stop();
-
-private:
-    /**
-     * A proxy to the service locator manager for the bridge replicator service.
-     */
-    IceUtil::Handle<LocatorRegistrationWrapper<ReplicatorPrx> > mLocator;
-    Ice::ObjectAdapterPtr mAdapter;
-    IceUtil::Handle<RegisterThread<ReplicatorPrx> > mRegisterThread; 
-    ReplicatorIPtr mReplicator;
-};
-
-BridgeReplicatorApp::BridgeReplicatorApp()
-{
-}
-
-void BridgeReplicatorApp::start(const string& name, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq&)
-{
-    Logger logger = getLoggerFactory().getLogger("AsteriskSCF.BridgeReplicator");
-    logger(Debug) << "Launching AsteriskSCF Bridge Replicator Service." ;
-
-    //
-    // It is standard practice to base the adapter name on the configured
-    // service instance name.
-    //
-    string adapterName;
-    if(name.size() == 0)
-    {
-        adapterName = "Adapter";
-    }
-    else
-    {
-        adapterName = name + ".Adapter";
-    }
-
-    //
-    // Check on the threadpool properties, make sure that they are compatible with the requirements of this 
-    // service. This could be moved into a helper method, but it is somehow more clear for seeing what
-    // is going on during initialization to leave it here.
-    //
-    // TODO: Are there any other properties that need to be double-checked before proceeding?
-    //
-    Ice::Int defaultPoolSize = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.ThreadPool.Server.Size", 0);
-    if (communicator->getProperties()->getPropertyAsIntWithDefault(adapterName + ".ThreadPool.Size", 0) < 4)
-    {
-        if (defaultPoolSize < 4)
-        {
-            logger(Info) << "Configured thread pool size for " << adapterName + " is too small, defaulting to 4";
-            communicator->getProperties()->setProperty(adapterName + ".ThreadPool.Size", "4");
-        }
-    }
-
-    //
-    // TODO: All adapter ids should be globally unique. This would allow replicas to be identified.
-    // How this might be useful is that it might be used as a replicated state item to identify
-    // which adapter is currently the primary in a group of replicas.
-    //
-    mAdapter = communicator->createObjectAdapterWithEndpoints(adapterName,
-        communicator->getProperties()->getPropertyWithDefault(adapterName + ".Endpoints", "default"));
-
-    //
-    // Configure the AsteriskSCF logger.
-    // TODO: check whether this works right if we've already created the logger object.
-    //
-    ConfiguredIceLoggerPtr iceLogger = createIceLogger(mAdapter);
-    getLoggerFactory().setLogOutput(iceLogger->getLogger());
-
-
-    string property = communicator->getProperties()->getProperty("LocatorServiceManagement.Proxy");
-    if(property.size() == 0)
-    {
-        throw IceBox::FailureException(__FILE__, __LINE__,
-                "Configuration error: Unable to locate property `LocatorServiceManagement.Proxy'");
-    }
-    
-    //
-    // TODO: The bridge manager's identity should come from a central configuration and/or a replicator
-    // service.
-    //
-    string managerName = "BridgeReplicator";
-    mReplicator = new ReplicatorI;
-    ReplicatorPrx replicatorPrx = ReplicatorPrx::uncheckedCast(mAdapter->add(mReplicator, communicator->stringToIdentity(managerName)));
-
-    assert(replicatorPrx != 0);
-    if(replicatorPrx == 0)
-    {
-        throw IceBox::FailureException(__FILE__, __LINE__, "Unable to instantiate bridge replicator object");
-    }
-
-    bool registered = false;
-    try
-    {
-        std::string serviceName = communicator->getProperties()->getPropertyWithDefault(
-          name + ".ServiceName", "default");
-
-        ServiceLocatorParamsPtr locatorParameters = new ServiceLocatorParams;
-        locatorParameters->category = StateReplicatorDiscoveryCategory;
-        locatorParameters->service = serviceName;
-        locatorParameters->id = communicator->getProperties()->getPropertyWithDefault(name + ".StateReplicatorId",
-                "default");
-        mLocator = new LocatorRegistrationWrapper<ReplicatorPrx>(communicator, property, replicatorPrx, adapterName, 
-          locatorParameters);
-        registered = mLocator->registerService();
-    }
-    catch(const Ice::Exception& e)
-    {
-        lg(Error) << "Exception starting bridge replicator: " << e.what();
-        throw;
-    }
-
-    if(!registered)
-    {
-        mRegisterThread = new RegisterThread<ReplicatorPrx>(mLocator);
-        mRegisterThread->start();
-    }
-    //
-    // TODO: We need to know whether or not to activate!
-    //
-    mAdapter->activate();
-}
-
-void BridgeReplicatorApp::stop()
-{
-    if(mRegisterThread)
-    {
-        mRegisterThread->stop();
-    }
-    try
-    {
-        mLocator->unregister();
-    }
-    catch(const Ice::Exception&)
-    {
-    }
-    try
-    {
-        Ice::CommunicatorPtr comm = mAdapter->getCommunicator();
-        comm->shutdown();
-        mAdapter->waitForDeactivate();
-        comm->destroy();
-    }
-    catch(...)
-    {
-        // TODO: log
-    }
-}
-}
-
-extern "C" {
-ASTSCF_DLL_EXPORT ::IceBox::Service* create(Ice::CommunicatorPtr)
-{
-    return new BridgeReplicatorApp;
-}
-}

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


-- 
asterisk-scf/release/bridging.git



More information about the asterisk-scf-commits mailing list