/// <summary> /// Loads the provider which is configured in applicaiton config file (app.config / web.config) /// <example> /// <![CDATA[<?xml version="1.0" encoding="utf-8" ?>]]> /// <configSections> /// <section name="indexusNetSharedCache" type="SharedCache.WinServiceCommon.Configuration.Client.IndexusProviderSection, SharedCache.WinServiceCommon" /> /// </configSections> /// /// <indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider"> /// <servers> /// <add key="Server1" ipaddress="10.0.0.3" port="48888" /> /// <add key="Server2" ipaddress="10.0.0.4" port="48888" /> /// </servers> /// <providers> /// <add /// name="IndexusSharedCacheProvider" /// type="SharedCache.WinServiceCommon.Provider.Cache.IndexusSharedCacheProvider, SharedCache.WinServiceCommon" /> /// </providers> /// </indexusNetSharedCache> /// </example> /// </summary> private static void LoadProvider() { if (providerBase == null) { lock (bulkObject) { if (providerBase == null) { // get a reference to the <cacheProvider> section providerSection = (IndexusServerProviderSection)WebConfigurationManager.GetSection("replicatedSharedCache"); // load registered provider and point provider base to the default provider providerCollection = new IndexusServerProviderCollection(); ProvidersHelper.InstantiateProviders( providerSection.Providers, providerCollection, typeof(IndexusServerProviderBase) ); providerBase = providerCollection[providerSection.DefaultProvider]; if (providerBase == null) { throw new ProviderException(@"Unable to load default replication shared Cache Provider!"); } } } } }