private void clearApplicationCategoryViewerCache(IWContext iwc) {
   IWCacheManager2 cacheManager = IWCacheManager2.getInstance(iwc.getIWMainApplication());
   Map<Serializable, ?> cache = cacheManager.getCache(ApplicationCategoryViewer.CACHE_KEY);
   if (cache != null) {
     cache.clear();
   }
   BuilderLogic.getInstance().clearAllCaches();
   IWCacheManager.getInstance(iwc.getIWMainApplication()).clearAllCaches();
 }
 protected <K extends Serializable, V> Map<K, V> getCache(
     String cacheName, long timeToIdle, long timeToLive, int size, boolean resetable) {
   try {
     return IWCacheManager2.getInstance(getApplication())
         .getCache(
             cacheName,
             size,
             IWCacheManager2.DEFAULT_OVERFLOW_TO_DISK,
             IWCacheManager2.DEFAULT_ETERNAL,
             timeToIdle,
             timeToLive,
             resetable);
   } catch (Exception e) {
     LOGGER.log(Level.WARNING, "Error getting cache!", e);
   }
   return null;
 }