Esempio n. 1
0
		/// <summary>
		/// Internal method that actually creates the cache. A HashMap containing the config parameters 
		/// is passed to this method.
		/// </summary>
		/// <param name="propertyTable">contains the properties provided by the user in the for of Hashtable</param>
		/// <param name="itemAdded">item added handler</param>
		/// <param name="itemRemoved">item removed handler</param>
		/// <param name="itemUpdated">item updated handler</param>
		/// <param name="cacheMiss">cache miss handler</param>
		/// <param name="cacheCleared">cache cleared handler</param>
		/// <returns>return the Cache object</returns>
		static private Cache CreateFromProperties(IDictionary properties,
                                        CacheServerConfig config,
										CustomRemoveCallback customRemove,
										CustomUpdateCallback customUpdate,
                                        bool isStartingAsMirror,
                                        bool twoPhaseInitialization)
		{
			Cache cache = new Cache();
            cache.Configuration = config;
            if (customRemove != null)
                cache.CustomRemoveCallbackNotif += customRemove;
            if (customUpdate != null)
                cache.CustomUpdateCallbackNotif += customUpdate;

            cache.Initialize(properties, true, isStartingAsMirror,twoPhaseInitialization);
			return cache;
		}