예제 #1
0
        protected override void DoConfigure(IConfigSectionNode node)
        {
            try
            {
                base.DoConfigure(node);

                var sguid = node.AttrByName(CONFIG_GUID_ATTR).ValueAsString();
                if (!string.IsNullOrEmpty(sguid))
                {
                    StoreGUID = new Guid(sguid);
                }


                m_Provider = FactoryUtils.MakeAndConfigure <ObjectStoreProvider>(node[CONFIG_PROVIDER_SECT],
                                                                                 typeof(FileObjectStoreProvider),
                                                                                 new [] { this });

                if (m_Provider == null)
                {
                    throw new AzosException("Provider is null");
                }

                ObjectLifeSpanMS = node.AttrByName(CONFIG_OBJECT_LIFE_SPAN_MS_ATTR).ValueAsInt(DEFAULT_OBJECT_LEFESPAN_MS);

                BucketCount = node.AttrByName(CONFIG_BUCKET_COUNT_ATTR).ValueAsInt(DEFAULT_BUCKET_COUNT);
            }
            catch (Exception error)
            {
                throw new AzosException(StringConsts.OBJSTORESVC_PROVIDER_CONFIG_ERROR + error.Message, error);
            }
        }