Example #1
0
        private IAssetService GetConnector(string url)
        {
            IAssetService connector = null;

            lock (m_connectors)
            {
                if (m_connectors.ContainsKey(url))
                {
                    connector = m_connectors[url];
                }
                else
                {
                    // Still not as flexible as I would like this to be,
                    // but good enough for now
                    string connectorType = new HeloServicesConnector(url).Helo();
                    m_log.DebugFormat("[HG ASSET SERVICE]: HELO returned {0}", connectorType);
                    if (connectorType == "opensim-simian")
                    {
                        connector = new SimianAssetServiceConnector(url);
                    }
                    else
                    {
                        connector = new AssetServicesConnector(url);
                    }

                    m_connectors.Add(url, connector);
                }
            }
            return(connector);
        }
Example #2
0
        private IAssetService GetConnector(string url)
        {
            IAssetService connector = null;

            m_connectorsRwLock.AcquireReaderLock(-1);
            try
            {
                if (m_connectors.ContainsKey(url))
                {
                    connector = m_connectors[url];
                }
                else
                {
                    LockCookie lc = m_connectorsRwLock.UpgradeToWriterLock(-1);
                    try
                    {
                        /* recheck since other thread may have created it */
                        if (m_connectors.ContainsKey(url))
                        {
                            connector = m_connectors[url];
                        }
                        else
                        {
                            // Still not as flexible as I would like this to be,
                            // but good enough for now
                            string connectorType = new HeloServicesConnector(url).Helo();
                            m_log.DebugFormat("[HG ASSET SERVICE]: HELO returned {0}", connectorType);
                            if (connectorType == "opensim-simian")
                            {
                                connector = new SimianAssetServiceConnector(url);
                            }
                            else
                            {
                                connector = new AssetServicesConnector(url);
                            }

                            m_connectors.Add(url, connector);
                        }
                    }
                    finally
                    {
                        m_connectorsRwLock.DowngradeFromWriterLock(ref lc);
                    }
                }
            }
            finally
            {
                m_connectorsRwLock.ReleaseReaderLock();
            }
            return(connector);
        }
Example #3
0
        private IInventoryService GetConnector(string url)
        {
            IInventoryService connector = null;
            lock (m_connectors)
            {
                if (m_connectors.ContainsKey(url))
                {
                    connector = m_connectors[url];
                }
                else
                {
                    // Still not as flexible as I would like this to be,
                    // but good enough for now
                    string connectorType = new HeloServicesConnector(url).Helo();
                    m_log.DebugFormat("[HG INVENTORY SERVICE]: HELO returned {0}", connectorType);
                    if (connectorType == "opensim-simian")
                    {
                        connector = new SimianInventoryServiceConnector(url);
                    }
                    else
                    {
                        RemoteXInventoryServicesConnector rxisc = new RemoteXInventoryServicesConnector(url);
                        rxisc.Scene = m_Scenes[0];
                        connector = rxisc;
                    }

                    m_connectors.Add(url, connector);
                }
            }

            return connector;
        }
        private IAssetService GetConnector(string url)
        {
            IAssetService connector = null;
            lock (m_connectors)
            {
                if (m_connectors.ContainsKey(url))
                {
                    connector = m_connectors[url];
                }
                else
                {
                    // Still not as flexible as I would like this to be,
                    // but good enough for now
                    string connectorType = new HeloServicesConnector(url).Helo();
                    m_log.DebugFormat("[HG ASSET SERVICE]: HELO returned {0}", connectorType);
                    if (connectorType == "opensim-simian")
                    {
                        connector = new SimianAssetServiceConnector(url);
                    }
                    else
                        connector = new AssetServicesConnector(url);

                    m_connectors.Add(url, connector);
                }
            }
            return connector;
        }
        private IAssetService GetConnector(string url)
        {
            IAssetService connector = null;
            m_connectorsRwLock.AcquireReaderLock(-1);
            try
            {
                if (m_connectors.ContainsKey(url))
                {
                    connector = m_connectors[url];
                }
                else
                {
                    LockCookie lc = m_connectorsRwLock.UpgradeToWriterLock(-1);
                    try
                    {
                        /* recheck since other thread may have created it */
                        if (m_connectors.ContainsKey(url))
                        {
                            connector = m_connectors[url];
                        }
                        else
                        {
                            // Still not as flexible as I would like this to be,
                            // but good enough for now
                            string connectorType = new HeloServicesConnector(url).Helo();
                            m_log.DebugFormat("[HG ASSET SERVICE]: HELO returned {0}", connectorType);
                            if (connectorType == "opensim-simian")
                            {
                                connector = new SimianAssetServiceConnector(url);
                            }
                            else
                                connector = new AssetServicesConnector(url);

                            m_connectors.Add(url, connector);
                        }
                    }
                    finally
                    {
                        m_connectorsRwLock.DowngradeFromWriterLock(ref lc);
                    }
                }
            }
            finally
            {
                m_connectorsRwLock.ReleaseReaderLock();
            }
            return connector;
        }
 private IInventoryService GetConnector(string url)
 {
     return m_connectors.GetOrAddIfNotExists(url, delegate()
     {
         // Still not as flexible as I would like this to be,
         // but good enough for now
         string connectorType = new HeloServicesConnector(url).Helo();
         m_log.DebugFormat("[HG INVENTORY SERVICE]: HELO returned {0}", connectorType);
         if (connectorType == "opensim-simian")
         {
             return new SimianInventoryServiceConnector(url);
         }
         else
         {
             RemoteXInventoryServicesConnector rxisc = new RemoteXInventoryServicesConnector(url);
             rxisc.Scene = m_Scenes[0];
             return rxisc;
         }
     });
 }