/** * Given source and name will compile and store the filter if it detects that the filter code has changed or * the filter doesn't exist. Otherwise it will return an instance of the requested ZuulFilter * * @param sCode source code * @param sName name of the filter * @return the IZuulFilter * @throws IllegalAccessException * @throws InstantiationException */ public ZuulFilter getFilter(String sCode, String sName) throws Exception { if (filterCheck.get(sName) == null) { filterCheck.putIfAbsent(sName, sName); if (!sCode.equals(filterClassCode.get(sName))) { LOG.info("reloading code " + sName); filterRegistry.remove(sName); } } ZuulFilter filter = filterRegistry.get(sName); if (filter == null) { Class clazz = compiler.compile(sCode, sName); if (!Modifier.isAbstract(clazz.getModifiers())) { filter = filterFactory.newInstance(clazz); } } return filter; }
filterRegistry.remove(sName); ZuulFilter filter = filterRegistry.get(sName); if (filter == null) { Class clazz = compiler.compile(file);
/** * Given source and name will compile and store the filter if it detects that the filter code has changed or * the filter doesn't exist. Otherwise it will return an instance of the requested ZuulFilter * * @param sCode source code * @param sName name of the filter * @return the IZuulFilter * @throws IllegalAccessException * @throws InstantiationException */ public ZuulFilter getFilter(String sCode, String sName) throws Exception { if (filterCheck.get(sName) == null) { filterCheck.putIfAbsent(sName, sName); if (!sCode.equals(filterClassCode.get(sName))) { LOG.info("reloading code " + sName); filterRegistry.remove(sName); } } ZuulFilter filter = filterRegistry.get(sName); if (filter == null) { Class clazz = compiler.compile(sCode, sName); if (!Modifier.isAbstract(clazz.getModifiers())) { filter = filterFactory.newInstance(clazz); } } return filter; }
filterRegistry.remove(sName); ZuulFilter filter = filterRegistry.get(sName); if (filter == null) { Class clazz = compiler.compile(file);
/** * Given source and name will compile and store the filter if it detects that the filter code has changed or * the filter doesn't exist. Otherwise it will return an instance of the requested ZuulFilter * * @param sCode source code * @param sName name of the filter * @return the IZuulFilter * @throws IllegalAccessException * @throws InstantiationException */ public ZuulFilter getFilter(String sCode, String sName) throws Exception { if (filterCheck.get(sName) == null) { filterCheck.putIfAbsent(sName, sName); if (!sCode.equals(filterClassCode.get(sName))) { LOG.info("reloading code " + sName); filterRegistry.remove(sName); } } ZuulFilter filter = filterRegistry.get(sName); if (filter == null) { Class clazz = compiler.compile(sCode, sName); if (!Modifier.isAbstract(clazz.getModifiers())) { filter = filterFactory.newInstance(clazz); } } return filter; }
filterRegistry.remove(sName); ZuulFilter filter = filterRegistry.get(sName); if (filter == null) { Class clazz = compiler.compile(file);