Package javax.cache

Examples of javax.cache.Cache.clear()


        req.getRequestDispatcher("/admin/form_system.jsp").forward(req,
            resp);
      } else if (obj != null && obj.equals("cache")) {
        Cache cache = CacheManager.getInstance().getCacheFactory()
            .createCache(Collections.emptyMap());
        cache.clear();
        session.setAttribute("success", "Action success !");
        req.getRequestDispatcher("/admin/form_cache.jsp").forward(req,
            resp);
      } else {
        resp.sendError(4004, "Invalid parameter !");
View Full Code Here


  public static void flush() {
    try {
      Cache cache = CacheManager.getInstance().getCacheFactory()
          .createCache(Collections.emptyMap());
      cache.clear();
    } catch (CacheException ex) {
      Logger.get().log(Level.SEVERE, null, ex);
    }
  }
View Full Code Here

            else if (mode == CacheMode.REMOVE)
                cache.remove(key);
            else if (mode == CacheMode.EVICT)
                cache.evict();
            else if (mode == CacheMode.CLEAR)
                cache.clear();

            return value;
        } catch (Throwable e) {
            return exceptionHandler.handleException(cache, ctx, key, value, e);
        }
View Full Code Here

    }

    public boolean clearCache(String name) {
        Cache cache = manager.getCache(name);
        if (cache != null) {
            cache.clear();
            return true;
        }
        return false;
    }
View Full Code Here

      JSONObject search = new JSONObject();
      search.put("leaving", (String)cache.get("leavingFrom"));
      search.put("going", (String)cache.get("goingTo"));
      search.put("time", new SimpleDateFormat("HH:mm").format((Date)cache.get("departure")));
      search.put("date", new SimpleDateFormat("yyyy-MM-dd").format((Date)cache.get("departure")));
      cache.clear();
      JSONArray volHistoricList = new JSONArray();
      volHistoricList.put(search);
      for(Entity result : preparedHistoricQuery.asIterable())
      {       
        JSONObject vol = new JSONObject();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.