Exemplo n.º 1
0
			private DataCacheFactory GetDistributeDataCacheFactory(IConfigService configService)
			{
				if (this.dataCacheFactory == null)
				{
					lock (this.syncObject)
					{
						if (this.dataCacheFactory == null)
						{
							string physicalPath = configService.GetConfigurationFile(ConfigFileType.Cache);

							DataCacheFactoryConfiguration cacheConfig = (DataCacheFactoryConfiguration)Activator.CreateInstance(typeof(DataCacheFactoryConfiguration)
								, BindingFlags.CreateInstance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null,
								new object[] { physicalPath }, null);

							if (cacheConfig.LocalCacheProperties.IsEnabled)
							{
								cacheConfig.LocalCacheProperties = new DataCacheLocalCacheProperties();
							}

							this.dataCacheFactory = new DataCacheFactory(cacheConfig);
						}
					}
				}
				return this.dataCacheFactory;
			}