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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Oct 1 16:26:31 CDT 2010


branch "master" has been updated
       via  ee31d03a0d77d6734fb510a7a66960fda87bb80f (commit)
       via  82bbf0fe2282cb8cf53eeb70ce805216e3b4dce3 (commit)
      from  d184ad63b1f9595057d238375524dea9afe87b04 (commit)

Summary of changes:
 cpp/src/IceBox/ServiceManagerI.cpp   |   35 -----------------
 cpp/src/IceBox/ServiceManagerI.h     |   18 ---------
 cs/src/IceBox/ServiceManagerI.cs     |   54 +--------------------------
 java/src/IceBox/ServiceManagerI.java |   46 ----------------------
 slice/IceBox/IceBox.ice              |   69 ----------------------------------
 5 files changed, 1 insertions(+), 221 deletions(-)


- Log -----------------------------------------------------------------
commit ee31d03a0d77d6734fb510a7a66960fda87bb80f
Merge: 82bbf0f d184ad6
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Oct 1 16:26:27 2010 -0500

    Merge branch 'master' of git.asterisk.org:asterisk-scf/release/ice


commit 82bbf0fe2282cb8cf53eeb70ce805216e3b4dce3
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Oct 1 16:25:16 2010 -0500

    Revert "import icebox local services code"...
    we've decided to delay action on this until we have a specific need for it
    
    This reverts commit d7d335cd7ea2452fd16a9ba5afb05579da54f366.

diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp
index 0262574..be713d9 100644
--- a/cpp/src/IceBox/ServiceManagerI.cpp
+++ b/cpp/src/IceBox/ServiceManagerI.cpp
@@ -134,8 +134,6 @@ IceBox::ServiceManagerI::ServiceManagerI(CommunicatorPtr communicator, int& argc
     {
         _argv.push_back(argv[i]);
     }
-
-    _localServiceManager = new LocalServiceManagerI();
 }
 
 IceBox::ServiceManagerI::~ServiceManagerI()
@@ -668,12 +666,6 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint,
             communicator = info.communicator;
         }
         
-        ServiceWithLocalServicesPtr lservice = ServiceWithLocalServicesPtr::dynamicCast(info.service);
-        if(lservice)
-        {
-            lservice->setLocalServiceManager(_localServiceManager);
-        }
-
         //
         // Start the service.
         //
@@ -977,30 +969,3 @@ IceBox::ServiceManagerI::createServiceProperties(const string& service)
     }
     return properties;
 }
-
-void ServiceManagerI::LocalServiceManagerI::addLocalService(const std::string& name, const Ice::LocalObjectPtr& service)
-{
-    IceUtil::Mutex::Lock lock(_lock);
-    _dict[name] = service;
-}
-
-void ServiceManagerI::LocalServiceManagerI::removeLocalService(const std::string& name)
-{
-    IceUtil::Mutex::Lock lock(_lock);
-    _dict.erase(name);
-}
-
-Ice::LocalObjectPtr ServiceManagerI::LocalServiceManagerI::findLocalService(const std::string& name)
-{
-    IceUtil::Mutex::Lock lock(_lock);
-    map<string, Ice::LocalObjectPtr>::const_iterator search = _dict.find(name);
-    if(search == _dict.end())
-    {
-        return 0;
-    }
-    else
-    {
-        return search->second;
-    }
-
-}
diff --git a/cpp/src/IceBox/ServiceManagerI.h b/cpp/src/IceBox/ServiceManagerI.h
index 07e8b0e..507bff8 100644
--- a/cpp/src/IceBox/ServiceManagerI.h
+++ b/cpp/src/IceBox/ServiceManagerI.h
@@ -21,22 +21,6 @@ namespace IceBox
 
 class ServiceManagerI : public ServiceManager, public IceUtil::Monitor<IceUtil::Mutex>
 {
-    class LocalServiceManagerI : public LocalServiceManager
-    {
-    public:
-
-        virtual void addLocalService(const std::string&, const Ice::LocalObjectPtr&);
-        virtual void removeLocalService(const std::string&);
-        virtual Ice::LocalObjectPtr findLocalService(const std::string&);
-
-    private:
-
-        IceUtil::Mutex _lock;
-        std::map<std::string, Ice::LocalObjectPtr> _dict;
-    };
-    
-    typedef IceUtil::Handle<LocalServiceManagerI> LocalServiceManagerIPtr;
-
 public:
 
     ServiceManagerI(Ice::CommunicatorPtr, int&, char*[]);
@@ -97,8 +81,6 @@ private:
 
     std::set<ServiceObserverPrx> _observers;
     int _traceServiceObserver;
-
-    LocalServiceManagerPtr _localServiceManager;
 };
 
 typedef IceUtil::Handle<ServiceManagerI> ServiceManagerIPtr;
diff --git a/cs/src/IceBox/ServiceManagerI.cs b/cs/src/IceBox/ServiceManagerI.cs
index 828c5a6..fc29d74 100644
--- a/cs/src/IceBox/ServiceManagerI.cs
+++ b/cs/src/IceBox/ServiceManagerI.cs
@@ -22,47 +22,6 @@ namespace IceBox
 //
 class ServiceManagerI : ServiceManagerDisp_
 {
-    class LocalServiceManagerI : LocalServiceManager
-    {
-        public LocalServiceManagerI()
-        {
-            _dict = new Dictionary<string, Object>();
-        }
-        
-        public void addLocalService(string name, System.Object service)
-        {
-            lock(this)
-            {
-                _dict.Add(name, service);
-            }
-        }
-        
-        public void removeLocalService(string name)
-        {
-            lock(this)
-            {
-                _dict.Remove(name);
-            }
-        }
-        
-        public System.Object findLocalService(string name)
-        {
-            lock(this)
-            {
-                if(!_dict.ContainsKey(name))
-                {
-                    return null;
-                }
-                else
-                {
-                    return _dict[name];
-                }
-            }
-        }
-        
-        private Dictionary<string, Object> _dict;
-    }
-
     class AMIServicesStartedCallback : AMI_ServiceObserver_servicesStarted
     {
         public AMIServicesStartedCallback(ServiceManagerI serviceManager, ServiceObserverPrx observer)
@@ -122,7 +81,7 @@ class ServiceManagerI : ServiceManagerDisp_
         _logger = _communicator.getLogger();
         _argv = args;
         _traceServiceObserver = _communicator.getProperties().getPropertyAsInt("IceBox.Trace.ServiceObserver");
-        _localServiceManager = new LocalServiceManagerI();
+
     }
 
     public override Dictionary<string, string>
@@ -660,16 +619,6 @@ class ServiceManagerI : ServiceManagerDisp_
                 throw e;
             }
 
-            try
-            {
-                ServiceWithLocalServices lservice = (ServiceWithLocalServices)info.service;
-                lservice.setLocalServiceManager(_localServiceManager);
-            }
-            catch(System.InvalidCastException)
-            {
-                // Nothing to do here, object does not implement ServiceWithLocalServices
-            }
-
             //
             // Invoke Service::start().
             //
@@ -1081,7 +1030,6 @@ class ServiceManagerI : ServiceManagerDisp_
     private bool _pendingStatusChanges = false;
     private Dictionary<ServiceObserverPrx, bool> _observers = new  Dictionary<ServiceObserverPrx, bool>();
     private int _traceServiceObserver = 0;
-    private LocalServiceManager _localServiceManager;
 }
 
 }
diff --git a/java/src/IceBox/ServiceManagerI.java b/java/src/IceBox/ServiceManagerI.java
index 6230c76..72dd24f 100644
--- a/java/src/IceBox/ServiceManagerI.java
+++ b/java/src/IceBox/ServiceManagerI.java
@@ -22,7 +22,6 @@ public class ServiceManagerI extends _ServiceManagerDisp
         _logger = _communicator.getLogger();
         _argv = args;
         _traceServiceObserver = _communicator.getProperties().getPropertyAsInt("IceBox.Trace.ServiceObserver");
-        _localServiceManager = new LocalServiceManagerI();
     }
 
     public java.util.Map<String, String>
@@ -516,16 +515,6 @@ public class ServiceManagerI extends _ServiceManagerDisp
             throw e;
         }
 
-        try
-        {
-            ServiceWithLocalServices lservice = (ServiceWithLocalServices)info.service;
-            lservice.setLocalServiceManager(_localServiceManager);
-        }
-        catch(ClassCastException ex)
-        {
-            // Nothing to do here, the object does not implement ServiceWithLocalServices
-        }
-
         //
         // Invoke Service::start().
         //
@@ -955,40 +944,6 @@ public class ServiceManagerI extends _ServiceManagerDisp
         String className;
     }
 
-    static class LocalServiceManagerI implements LocalServiceManager
-    {
-        public LocalServiceManagerI()
-        {
-            _dict = new java.util.HashMap<String, Object>();
-        }
-
-        public void addLocalService(String name, Object service)
-        {
-            synchronized(this)
-            {
-                _dict.put(name, service);
-            }
-        }
-
-        public void removeLocalService(String name)
-        {
-            synchronized(this)
-            {
-                _dict.remove(name);
-            }
-        }
-
-        public Object findLocalService(String name)
-        {
-            synchronized(this)
-            {
-                return _dict.get(name);
-            }
-        }
-
-        private java.util.Map<String, Object> _dict;
-    }
-
     private Ice.Properties
     createServiceProperties(String service)
     {
@@ -1022,7 +977,6 @@ public class ServiceManagerI extends _ServiceManagerDisp
     private String[] _argv; // Filtered server argument vector
     private java.util.List<ServiceInfo> _services = new java.util.LinkedList<ServiceInfo>();
     private boolean _pendingStatusChanges = false;
-    private LocalServiceManager _localServiceManager;
 
     java.util.HashSet<ServiceObserverPrx> _observers = new java.util.HashSet<ServiceObserverPrx>();
     int _traceServiceObserver = 0;
diff --git a/slice/IceBox/IceBox.ice b/slice/IceBox/IceBox.ice
index cf876aa..37d4a9f 100644
--- a/slice/IceBox/IceBox.ice
+++ b/slice/IceBox/IceBox.ice
@@ -114,75 +114,6 @@ local interface Service
     void stop();
 };
 
-/**
- *
- * IceBox can provide a 'directory' of local services, which are objects
- * provided by application services in the IceBox container that are directly
- * accessible by other application services, without the need of proxies
- * (i.e. as local Ice objects). Any application service wishing to use
- * this facility can derive its service object from [ServiceWithLocalServices]
- * and IceBox will automatically provide a reference the [LocalServiceManager].
- *
- **/
-local interface LocalServiceManager
-{
-    /**
-     *
-     * Register a local service.
-     *
-     * <p class="Note">If an existing service is in the [LocalServiceManager]
-     * with the provided name, it will be replaced.
-     *
-     * @param name The service's name.
-     *
-     * @param service A reference to the object providing the service.
-     *
-     **/
-    void addLocalService(string name, LocalObject service);
-
-    /**
-     *
-     * Unregister a local service.
-     *
-     * <p class="Note">If no existing service is in the [LocalServiceManager]
-     * with the provided name, no operation will be performed.
-     *
-     * @param name The service's name.
-     *
-     **/
-    void removeLocalService(string name);
-
-    /**
-     *
-     * Find a local service.
-     *
-     * @param name The service's name.
-     *
-     * @return A reference to the object providing the requested service,
-     * or null if no service by that name was found.
-     *
-     **/
-    LocalObject findLocalService(string name);
-};
-
-/**
- *
- * An application service managed by a [ServiceManager] that uses the [LocalServiceManager].
- *
- **/
-local interface ServiceWithLocalServices extends Service
-{
-    /**
-     *
-     * Set the service's [LocalServiceManager] reference. IceBox will
-     * call this operation before instantiating the service's object.
-     *
-     * @param manager The [LocalServiceManager] provided by the IceBox
-     * instance.
-     *
-     **/
-    void setLocalServiceManager(LocalServiceManager manager);
-};
 
 /**
  *

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


-- 
asterisk-scf/release/ice.git



More information about the asterisk-scf-commits mailing list