@Override public void destroy() { Logger.info("destroyed token filter!"); } }
/** * 清空属性缓存 */ public static void clearAttributesMap() { attributesMap = null; Logger.info("clear security config attributes."); } }
@Override public void destroy() { Logger.info("destroyed spring web application filter!"); } }
/** * 清理jlfex Apiconfig 缓存 * @param code */ @Override public void clearJlfexApiCfg(String code){ if(HermesConstants.PLAT_JLFEX_CODE.equals(code.trim())){ apiCfgMap.remove(HermesConstants.PLAT_JLFEX_CODE); Logger.info("成功清理jlfex Apiconfig 缓存"); } }
@Override public Result run() { Logger.info("This is a sample job."); return new Result(true, true, "样例任务执行成功"); } }
/** * 请求流水号 * @param interfaceCode 接口方法编码 * @return * @throws Exception */ @Override public String generateSerialNo() throws Exception { String val = SerialUtil.getSerialByDate10AndRandomLen(9); Logger.info("生成开发平台:19位请求流水号="+val); return val; }
/** * 订单流水号 * @return * @throws Exception */ @Override public String generateOrderSn() throws Exception { String val = SerialUtil.getSerialByDate10AndRandomLen(8); Logger.info("生成jlfex订单编号:18位请求流水号="+val); return val; }
/** * 初始化 * * @param context */ public static void initialize(ServletContext context) { WebApp.initialize(context); applicationContext = WebApplicationContextUtils.getWebApplicationContext(context); Logger.info("initialize spring application context: %s", applicationContext); }
/** * 清除数据库加载的属性缓存 */ public static void clear() { Map<String, String> values = new HashMap<String, String>(); values.put(HermesConstants.KEY_DATABASE, ""); App.config(values); Logger.info("properties 缓存已经重新加载."); }
/** * 清除后台角色权限集合缓存 */ public static void clearBackRoleResourceMap(String roleCode) { if(Strings.notEmpty(roleCode)){ if(backRoleResourceMap.containsKey(roleCode.trim())){ backRoleResourceMap.remove(roleCode.trim()); Logger.info("后台角色权限集合缓存Filter已经清理完毕"); } } }
/** * 移除数据 * * @param key * @return */ public static void delete(String key) { Logger.info("remove %s from cache.", key); getCache().delete(key); }
/** * 清空缓存数据 */ public static void clear() { Logger.info("clear all cache."); getCache().clear(); }
/** * 更新后回调 */ @PostUpdate protected void onPostUpdate() { Logger.info("user '%s' update data '%s - %s'.", getUpdater(), this.getClass().getSimpleName(), getId()); }
/** * 构造函数 */ protected EhCacheImpl() { synchronized (DEFAULT_NAME) { cacheManager = CacheManager.create(); if (!cacheManager.cacheExists(DEFAULT_NAME)) cacheManager.addCache(DEFAULT_NAME); cache = cacheManager.getCache(DEFAULT_NAME); Logger.info("initialize ehcache '%s' completed.", DEFAULT_NAME); } }
/** * 替换数据 * * @param key * @param value * @param expiration */ public static void replace(String key, Object value, int expiration) { checkSerializable(value); Logger.info("replace %s - %s into cache for %d seconds.", key, value, expiration); getCache().replace(key, value, expiration); }
/** * 安全移除数据 * * @param key * @return */ public static boolean safeDelete(String key) { Logger.info("remove %s from cache.", key); if (getCache().safeDelete(key)) return true; Logger.warn("remove %s from cache failure!", key); return false; }
/** * 设置数据 * * @param key * @param value * @param expiration */ public static void set(String key, Object value, int expiration) { checkSerializable(value); Logger.info("set %s - %s int cache for %d seconds.", key, Strings.toString(value), expiration); getCache().set(key, value, expiration); }
@Override public void init(FilterConfig config) throws ServletException { App.config(propertiesService.loadFromDatabase()); if (App.config("app.logo") != null) { Map<String, String> tmp = new HashMap<String, String>(); tmp.put("app.logo.data", textService.loadById(App.config("app.logo")).getText()); App.config(tmp); } Logger.info("properties filter is working..."); }
/** * 添加数据 * * @param key * @param value * @param expiration */ public static void add(String key, Object value, int expiration) { checkSerializable(value); Logger.info("add %s - %s into cache for %d seconds.", key, Strings.toString(value), expiration); getCache().add(key, value, expiration); }