コード例 #1
0
        /// <summary>
        /// Overriden constructor
        /// </summary>
        /// <param name="cacheName"></param>
        public CacheDAO(string cacheName)
        {
            if (string.IsNullOrEmpty(cacheName)) //generate random name
            {
                this.cacheName = string.Concat(Constants.DEFAULT_CACHE_NAME, Utils.Utils.generateUniqueID());
            }
            else
            {
                this.cacheName = string.Concat(Constants.DEFAULT_CACHE_NAME, Utils.Utils.generateUniqueID());
            }

            cacheHelper = MemcachedCacheHelper.getInstance(this.cacheName);
        }
コード例 #2
0
 /// <summary>
 /// Singleton instance
 /// </summary>
 /// <param name="cacheName"></param>
 /// <returns></returns>
 public static MemcachedCacheHelper getInstance(string cacheName)
 {
     if (instance == null)
     {
         lock (syncRoot)
         {
             if (instance == null)
             {
                 instance = new MemcachedCacheHelper(cacheName);
             }
         }
     }
     return(instance);
 }
コード例 #3
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public CacheDAO()
 {
     this.cacheName = string.Concat(Constants.DEFAULT_CACHE_NAME, Utils.Utils.generateUniqueID());
     cacheHelper    = MemcachedCacheHelper.getInstance(cacheName);
 }