Exemplo n.º 1
0
        /// <summary>
        /// Initialize a registered cache given by the ID.
        /// </summary>
        /// <param name="cacheId">A string identifier of configuration.</param>
        static public ArrayList GetCacheConfig(string cacheId, string filePath, bool inProc)
        {
            try
            {
                XmlConfigReader configReader = new XmlConfigReader(filePath, cacheId);
                ArrayList       propsList    = configReader.PropertiesList;
                ArrayList       configsList  = CacheConfig.GetConfigs(propsList, DEF_TCP_PORT);

                foreach (CacheConfig config in configsList)
                {
                    if (!inProc)
                    {
                        inProc = config.UseInProc;
                    }
                    break;
                }

                if (inProc)
                {
                    return(configsList);
                }
                return(null);
            }

            catch (ManagementException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new ManagementException(e.Message, e);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize a registered cache given by the ID.
        /// </summary>
        /// <param name="cacheId">A string identifier of configuration.</param>
        static public ArrayList GetCacheConfig(string cacheId, string userId, string password, bool inProc)
        {
            if (FileName.Length == 0)
            {
                throw new ManagementException("Can not locate cache configuration file. Installation might be corrupt");
            }
            try
            {
                XmlConfigReader configReader = new XmlConfigReader(FileName, cacheId);
                ArrayList       propsList    = configReader.PropertiesList;
                ArrayList       configsList  = CacheConfig.GetConfigs(propsList);

                foreach (CacheConfig config in configsList)
                {
                    if (!inProc)
                    {
                        inProc = config.UseInProc;
                    }
                    break;
                }

                if (inProc)
                {
                    bool      isAuthorize = false;
                    Hashtable ht          = (Hashtable)propsList[0];
                    Hashtable cache       = (Hashtable)ht["cache"];

                    return(configsList);
                }
                return(null);
            }

            catch (SecurityException)
            {
                throw;
            }

            catch (ManagementException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new ManagementException(e.Message, e);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initialize a registered cache given by the ID.
        /// </summary>
        /// <param name="cacheId">A string identifier of configuration.</param>
        static public ArrayList GetCacheConfig(string cacheId, string filePath, string userId, string password, bool inProc)
        {
            try
            {
                XmlConfigReader configReader = new XmlConfigReader(filePath, cacheId);
                ArrayList       propsList    = configReader.PropertiesList;
                ArrayList       configsList  = CacheConfig.GetConfigs(propsList, DEF_TCP_PORT);

                foreach (CacheConfig config in configsList)
                {
                    if (!inProc)
                    {
                        inProc = config.UseInProc;
                    }
                    break;
                }

                if (inProc)
                {
                    Hashtable ht    = (Hashtable)propsList[0];
                    Hashtable cache = (Hashtable)ht["cache"];

                    return(configsList);
                }
                return(null);
            }

            catch (SecurityException)
            {
                throw;
            }

            catch (ManagementException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new ManagementException(e.Message, e);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize a registered cache given by the ID.
        /// </summary>
        /// <param name="cacheId">A string identifier of configuration.</param>
        static public ArrayList GetCacheConfig(string cacheId, bool inProc)
        {
            if (FileName.Length == 0)
            {
                throw new ManagementException("Can not locate cache configuration file. Installation might be corrupt");
            }
            try
            {
                XmlConfigReader configReader = new XmlConfigReader(FileName, cacheId);
                ArrayList       propsList    = configReader.PropertiesList;
                ArrayList       configsList  = CacheConfig.GetConfigs(propsList);

                foreach (CacheConfig config in configsList)
                {
                    if (!inProc)
                    {
                        inProc = config.UseInProc;
                    }
                    break;
                }

                if (inProc)
                {
                    return(configsList);
                }
                return(null);
            }

            catch (ManagementException)
            {
                throw;
            }
            catch (Exception e)
            {
                throw new ManagementException(e.Message, e);
            }
        }