Warn() public static method

public static Warn ( String message ) : void
message String
return void
Esempio n. 1
0
 private void loadCacheItem <T>(DAO dao, String cacheName, String methodName, String keyName) where T : BASEBean
 {
     try
     {
         var        connectorCache = new Cache(cacheName);
         MethodInfo method         = dao.GetType().GetMethod(methodName);
         var        list           = (List <T>)method.Invoke(dao, null);
         foreach (T item in list)
         {
             connectorCache.addCacheItem(item.FieldMap[keyName].ToString(), item);
         }
         if (!cacheMap.ContainsKey(connectorCache.Name))
         {
             cacheMap.Add(connectorCache.Name, connectorCache);
         }
         else
         {
             LogManager.Warn(string.Format("Duplicate cache name: \"{0}\" found and ignored", connectorCache.Name));
         }
     }
     catch (Exception e)
     {
         LogManager.Error(e);
     }
 }
Esempio n. 2
0
        /**
         * Adds a new Cache item to the cache.
         * @param key - key value for the data provided
         * @param data - BASEBean data bean
         * @see BASEBean
         */

        public void addCacheItem(String key, BASEBean data)
        {
            if (!cacheMap.ContainsKey(key))
            {
                cacheMap.Add(key, data);
            }
            else
            {
                LogManager.Warn(string.Format("Cache \"{0}\" - Item Key \"{1}\" already exists - ignoring key", this.Name, key));
            }
        }