[asterisk-scf-commits] asterisk-scf/integration/routing.git branch "refactor_startup" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu May 19 14:22:07 CDT 2011


branch "refactor_startup" has been updated
       via  7044f8c24025b5790f48704f4c54988e6f86f68e (commit)
      from  b2ea2b4cbed1a1a4f86d59aadf1dddd7ef269bf8 (commit)

Summary of changes:
 config/routingtest-integ.config        |    6 +-
 src/BasicRoutingServiceApp.cpp         |   70 ++++++++++++++++----------------
 src/BasicRoutingStateReplicatorApp.cpp |    2 +-
 3 files changed, 39 insertions(+), 39 deletions(-)


- Log -----------------------------------------------------------------
commit 7044f8c24025b5790f48704f4c54988e6f86f68e
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Thu May 19 14:20:55 2011 -0500

    Renamed the adapters per the wiki updates.

diff --git a/config/routingtest-integ.config b/config/routingtest-integ.config
index 0ca6d18..b7488c0 100644
--- a/config/routingtest-integ.config
+++ b/config/routingtest-integ.config
@@ -39,7 +39,7 @@ BridgeManager.ServiceLocatorId=BridgeService
 # Routing Service properties
 
 RoutingService.Endpoints=tcp -h 127.0.0.1 -p 10050
-RoutingService.Management.Endpoints=tcp -h 127.0.0.1 -p 10051
+RoutingService.Backplane.Endpoints=tcp -h 127.0.0.1 -p 10051
 RoutingService.ThreadPool.Size=8
 RoutingService.ThreadPool.SizeMax=14
 RoutingService.ThreadPool.SizeWarn=9
@@ -49,7 +49,7 @@ RoutingService.StateReplicatorName=Replicator
 RoutingService.ComponentTest=yes
 
 RoutingService2.Endpoints=tcp -h 127.0.0.1 -p 10052
-RoutingService2.Management.Endpoints=tcp -h 127.0.0.1 -p 10053
+RoutingService2.Backplane.Endpoints=tcp -h 127.0.0.1 -p 10053
 RoutingService2.ThreadPool.Size=8
 RoutingService2.ThreadPool.SizeMax=14
 RoutingService2.ThreadPool.SizeWarn=9
@@ -58,7 +58,7 @@ RoutingService2.StateReplicatorName=Replicator
 
 Replicator.InstanceName=Replicator
 Replicator.Endpoints=tcp -h 127.0.0.1 -p 10054
-Replicator.Management.Endpoints=tcp -h 127.0.0.1 -p 10055
+Replicator.Backplane.Endpoints=tcp -h 127.0.0.1 -p 10055
 Replicator.ThreadPool.Size=8
 Replicator.ThreadPool.SizeMax=14
 Replicator.ThreadPool.SizeWarn=9
diff --git a/src/BasicRoutingServiceApp.cpp b/src/BasicRoutingServiceApp.cpp
index 9e34cea..024d163 100644
--- a/src/BasicRoutingServiceApp.cpp
+++ b/src/BasicRoutingServiceApp.cpp
@@ -153,8 +153,8 @@ private:
     bool mListeningToReplicator;
 
     // Implementation
-    ::Ice::ObjectAdapterPtr mPrimaryAdapter;
-    ::Ice::ObjectAdapterPtr mManagementAdapter;
+    ::Ice::ObjectAdapterPtr mServiceAdapter;
+    ::Ice::ObjectAdapterPtr mBackplaneAdapter;
 
     ::Ice::CommunicatorPtr mCommunicator;
 
@@ -254,7 +254,7 @@ public:
      *  @param app 
      *  @param adapter The adapter is assumed to have been activated. 
      */
-    ReplicaManagement(BasicRoutingServiceApp* app, ::Ice::ObjectAdapterPtr adapter) : mApp(app), mManagementAdapter(adapter)
+    ReplicaManagement(BasicRoutingServiceApp* app, ::Ice::ObjectAdapterPtr adapter) : mApp(app), mAdapter(adapter)
     { 
     }
 
@@ -269,7 +269,7 @@ public:
 
         for (vector<AsteriskSCF::System::Component::V1::ReplicaListenerPrx>::const_iterator listener = mListeners.begin(); listener != mListeners.end(); ++listener)
         {
-            (*listener)->activated(ReplicaPrx::uncheckedCast(mManagementAdapter->createDirectProxy(mManagementAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
+            (*listener)->activated(ReplicaPrx::uncheckedCast(mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
         }
 
         return true;
@@ -282,7 +282,7 @@ public:
         for (vector<AsteriskSCF::System::Component::V1::ReplicaListenerPrx>::const_iterator listener = mListeners.begin(); 
              listener != mListeners.end(); ++listener)
         {
-            (*listener)->onStandby(ReplicaPrx::uncheckedCast(mManagementAdapter->createDirectProxy(mManagementAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
+            (*listener)->onStandby(ReplicaPrx::uncheckedCast(mAdapter->createDirectProxy(mAdapter->getCommunicator()->stringToIdentity(ReplicaServiceId))));
         }
     }
 
@@ -302,7 +302,7 @@ private:
     /**
      * Pointer to the object adapter we exist on.
      */
-    ::Ice::ObjectAdapterPtr mManagementAdapter;
+    ::Ice::ObjectAdapterPtr mAdapter;
 
     /**
      * Listeners that we need to push state change notifications out to.
@@ -415,7 +415,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator(bool includeManagementSe
     try
     {
         // Register our RoutingAdmin interface with the Service Locator.
-        ::Ice::ObjectPrx adminObjectPrx = mPrimaryAdapter->createDirectProxy(mCommunicator->stringToIdentity(RoutingAdminObjectId));
+        ::Ice::ObjectPrx adminObjectPrx = mServiceAdapter->createDirectProxy(mCommunicator->stringToIdentity(RoutingAdminObjectId));
         RoutingServiceAdminPrx adminPrx = RoutingServiceAdminPrx::checkedCast(adminObjectPrx);
         string adminServiceGuid(mImplementationId + "." + Routing::V1::RoutingServiceAdminDiscoveryCategory); // Should be unique for reporting.
         mAdminManagement = ServiceManagementPrx::uncheckedCast(mServiceLocatorManagement->addService(adminPrx, adminServiceGuid));
@@ -423,7 +423,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator(bool includeManagementSe
         setCategory(mAdminManagement, Routing::V1::RoutingServiceAdminDiscoveryCategory);
 
         // Register our RegistryLocator interface with the Service Locator.
-        ::Ice::ObjectPrx locatorObjectPrx = mPrimaryAdapter->createDirectProxy(mCommunicator->stringToIdentity(RegistryLocatorObjectId));
+        ::Ice::ObjectPrx locatorObjectPrx = mServiceAdapter->createDirectProxy(mCommunicator->stringToIdentity(RegistryLocatorObjectId));
         LocatorRegistryPrx locatorRegistryPrx = LocatorRegistryPrx::checkedCast(locatorObjectPrx);
         string locatorServiceGuid(mImplementationId + "." + Routing::V1::RoutingServiceLocatorRegistryDiscoveryCategory);  // Should be unique for reporting.
         mRegistryLocatorManagement = ServiceManagementPrx::uncheckedCast(mServiceLocatorManagement->addService(locatorRegistryPrx, locatorServiceGuid));
@@ -431,7 +431,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator(bool includeManagementSe
         setCategory(mRegistryLocatorManagement, Routing::V1::RoutingServiceLocatorRegistryDiscoveryCategory);
 
         // Register the SessionRouter interface with the Service Locator.
-        ::Ice::ObjectPrx sessionRouterObjectPrx = mPrimaryAdapter->createDirectProxy(mCommunicator->stringToIdentity(SessionRouterObjectId));
+        ::Ice::ObjectPrx sessionRouterObjectPrx = mServiceAdapter->createDirectProxy(mCommunicator->stringToIdentity(SessionRouterObjectId));
         AsteriskSCF::SessionCommunications::V1::SessionRouterPrx sessionRouterPrx = 
             AsteriskSCF::SessionCommunications::V1::SessionRouterPrx::checkedCast(sessionRouterObjectPrx);
         string sessionRouterGuid(mImplementationId + "." + Routing::V1::SessionRouterDiscoveryCategory);   // Should be unique
@@ -443,7 +443,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator(bool includeManagementSe
         {
             // Register the ComponentService interface with the Service Locator.
             // Note that this interface goes on the management adapter.
-            ::Ice::ObjectPrx componentServiceObjectPrx = mManagementAdapter->createDirectProxy(mCommunicator->stringToIdentity(ComponentServiceId));
+            ::Ice::ObjectPrx componentServiceObjectPrx = mBackplaneAdapter->createDirectProxy(mCommunicator->stringToIdentity(ComponentServiceId));
             ComponentServicePrx componentServicePrx = ComponentServicePrx::checkedCast(componentServiceObjectPrx);
             string componentServiceGuid(mImplementationId + "." + Routing::V1::ComponentServiceDiscoveryCategory);   // Should be unique for reporting.
             mComponentServiceManagement = ServiceManagementPrx::uncheckedCast(mServiceLocatorManagement->addService(componentServicePrx, componentServiceGuid));
@@ -453,7 +453,7 @@ void BasicRoutingServiceApp::registerWithServiceLocator(bool includeManagementSe
             if (mPublishTestInterface)
             {
                 // Register our test servant as a facet of the ComponentService interface.
-                mManagementAdapter->addFacet(mComponentTest, componentServicePrx->ice_getIdentity(), AsteriskSCF::System::Component::V1::ComponentTestFacet);
+                mBackplaneAdapter->addFacet(mComponentTest, componentServicePrx->ice_getIdentity(), AsteriskSCF::System::Component::V1::ComponentTestFacet);
             }
         }
     }
@@ -582,11 +582,11 @@ void BasicRoutingServiceApp::initialize()
 {
     try
     {
-        // Create the primary adapter.
-        mPrimaryAdapter = mCommunicator->createObjectAdapter(mAppName);
+        // Create the adapter that our functional services are published on.
+        mServiceAdapter = mCommunicator->createObjectAdapter(mAppName);
 
         // Create an adapter that is bound to the dedicated (non-movable) address of this component. 
-        mManagementAdapter = mCommunicator->createObjectAdapter(mAppName + ".Management");
+        mBackplaneAdapter = mCommunicator->createObjectAdapter(mAppName + ".Backplane");
 
         // Standalone instances are the only instances that default to being active. 
         // Non-standalone instances must be made active via the Replica interface. 
@@ -595,17 +595,17 @@ void BasicRoutingServiceApp::initialize()
         // Create the replication context.
         mReplicationContext = ReplicationContextPtr(new ReplicationContext(active));
 
-        mEventPublisher = new RoutingServiceEventPublisher(mPrimaryAdapter);
+        mEventPublisher = new RoutingServiceEventPublisher(mServiceAdapter);
 
         // setup the logger
-        ConfiguredIceLoggerPtr mIceLogger = createIceLogger(mPrimaryAdapter);
+        ConfiguredIceLoggerPtr mIceLogger = createIceLogger(mServiceAdapter);
         getLoggerFactory().setLogOutput(mIceLogger->getLogger());
 
         // Create and configure the EndpointRegistry.
          mEndpointRegistry = new EndpointRegistry(ScriptProcessorPtr(new LuaScriptProcessor()), mEventPublisher, mReplicationContext);
 
         // Publish the LocatorRegistry interface.
-        mPrimaryAdapter->add(mEndpointRegistry, mCommunicator->stringToIdentity(RegistryLocatorObjectId));
+        mServiceAdapter->add(mEndpointRegistry, mCommunicator->stringToIdentity(RegistryLocatorObjectId));
 
         // Check to see if we're configured to publish a test interface.
         mPublishTestInterface = (mCommunicator->getProperties()->getPropertyWithDefault(mAppName + ".ComponentTest", "no") == "yes");
@@ -618,7 +618,7 @@ void BasicRoutingServiceApp::initialize()
         }
 
         // Create the session context needed to construct operations.
-        mSessionContext = SessionContextPtr(new SessionContext(mPrimaryAdapter, 
+        mSessionContext = SessionContextPtr(new SessionContext(mServiceAdapter, 
                                                              mEndpointRegistry, 
                                                              mEventPublisher, 
                                                              mWorkQueue,
@@ -629,24 +629,24 @@ void BasicRoutingServiceApp::initialize()
 
         // Create publish the SessionRouter interface.
         mSessionRouter = new SessionRouter(mSessionContext, mOperationReplicaCache);
-        mPrimaryAdapter->add(mSessionRouter, mCommunicator->stringToIdentity(SessionRouterObjectId));
+        mServiceAdapter->add(mSessionRouter, mCommunicator->stringToIdentity(SessionRouterObjectId));
 
         // Create and publish the Admin interface support.
         mAdminInteface = new RoutingAdmin(mEndpointRegistry);
-        mPrimaryAdapter->add(mAdminInteface, mCommunicator->stringToIdentity(RoutingAdminObjectId));
+        mServiceAdapter->add(mAdminInteface, mCommunicator->stringToIdentity(RoutingAdminObjectId));
 
-        // Create and publish the ComponentService interface on the management adapter. 
+        // Create and publish the ComponentService interface on the backplane adapter. 
         mComponentService = new ComponentServiceImpl(this);
-        mManagementAdapter->add(mComponentService, mCommunicator->stringToIdentity(ComponentServiceId));
+        mBackplaneAdapter->add(mComponentService, mCommunicator->stringToIdentity(ComponentServiceId));
 
         // Create and publish our Replica interface on the management adapter. This interface allows this component
         // to be activated or placed in standby mode. 
-        mReplicaManagement = new ReplicaManagement(this, mManagementAdapter);
-        mManagementAdapter->add(mReplicaManagement, mCommunicator->stringToIdentity(ReplicaServiceId));
+        mReplicaManagement = new ReplicaManagement(this, mBackplaneAdapter);
+        mBackplaneAdapter->add(mReplicaManagement, mCommunicator->stringToIdentity(ReplicaServiceId));
 
-        // Create and publish our state replicator listener interface on the management adapter. 
+        // Create and publish our state replicator listener interface on the backplane adapter. 
         mReplicatorListener = new RoutingStateReplicatorListenerImpl(mEndpointRegistry, mOperationReplicaCache);
-        RoutingStateReplicatorListenerPrx replicatorListener = RoutingStateReplicatorListenerPrx::uncheckedCast(mManagementAdapter->addWithUUID(mReplicatorListener));
+        RoutingStateReplicatorListenerPrx replicatorListener = RoutingStateReplicatorListenerPrx::uncheckedCast(mBackplaneAdapter->addWithUUID(mReplicatorListener));
         mReplicatorListenerProxy = RoutingStateReplicatorListenerPrx::uncheckedCast(replicatorListener->ice_oneway());
 
         if (active)
@@ -658,8 +658,8 @@ void BasicRoutingServiceApp::initialize()
             onStandby();
         }
 
-        mPrimaryAdapter->activate();
-        mManagementAdapter->activate();
+        mServiceAdapter->activate();
+        mBackplaneAdapter->activate();
 
         // Get a proxy to the management interface for the Service Locator manager.
         // This isso we can add ourselves into the system discovery mechanisms.
@@ -698,8 +698,8 @@ void BasicRoutingServiceApp::start(const string& name, const ::Ice::Communicator
     }
     else
     {
-        mPrimaryAdapter->activate();
-        mManagementAdapter->activate();
+        mServiceAdapter->activate();
+        mBackplaneAdapter->activate();
     }
 
     // Plug into the Asterisk SCF discovery system so that the interfaces we provide
@@ -723,8 +723,8 @@ void BasicRoutingServiceApp::resume()
         // If we're in standby by mode, listen for state replication.
        listenToStateReplicator();
 
-        // Reactivate the primary adapter. 
-        mPrimaryAdapter->activate();
+        // Reactivate the service adapter. 
+        mServiceAdapter->activate();
 
         // Re-enable lookups of our interfaces in the ServiceLocator. 
         manageRegisteredServants(RESUME_SERVICE, false);
@@ -751,9 +751,9 @@ void BasicRoutingServiceApp::suspendService(bool shuttingDown)
         // Remove our interfaces from the state replicator.
         stopListeningToStateReplicator();
 
-        // Deactive the primary adapter. 
+        // Deactive the service adapter. 
         // The adapter that services the ComponentService stays active. 
-        mPrimaryAdapter->deactivate();
+        mServiceAdapter->deactivate();
     }
 
     mRunning = false;
@@ -784,7 +784,7 @@ void BasicRoutingServiceApp::stop()
 
     // Turn off our management interface. 
     // Only a start() directly from IceBox can restart us now. 
-    mManagementAdapter->deactivate();
+    mBackplaneAdapter->deactivate();
 
     lg(Info) << "Stopped.";
 }
diff --git a/src/BasicRoutingStateReplicatorApp.cpp b/src/BasicRoutingStateReplicatorApp.cpp
index 31bdcc9..091f9fc 100644
--- a/src/BasicRoutingStateReplicatorApp.cpp
+++ b/src/BasicRoutingStateReplicatorApp.cpp
@@ -231,7 +231,7 @@ void BasicRoutingStateReplicatorService::initialize(const std::string& appName)
     // Create a separate adapter just for the component service. This is 
     // to make it easy to deactivate all of our interfaces other than the
     // component service to support suspend()/resume().
-    mComponentServiceAdapter = mCommunicator->createObjectAdapter(mAppName + ".ComponentService");
+    mComponentServiceAdapter = mCommunicator->createObjectAdapter(mAppName + ".Backplane");
 
     // setup logging client
     mIceLogger = createIceLogger(mAdapter);

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


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list