use of com.netflix.zuul.groovy.GroovyCompiler in project zuul by Netflix.
the class StartServer method initZuul.
void initZuul() throws Exception, IllegalAccessException, InstantiationException {
RequestContext.setContextClass(NFRequestContext.class);
CounterFactory.initialize(new Counter());
TracerFactory.initialize(new Tracer());
LOG.info("Starting Groovy Filter file manager");
final AbstractConfiguration config = ConfigurationManager.getConfigInstance();
final String preFiltersPath = config.getString(ZUUL_FILTER_PRE_PATH);
final String postFiltersPath = config.getString(ZUUL_FILTER_POST_PATH);
final String routingFiltersPath = config.getString(ZUUL_FILTER_ROUTING_PATH);
final String customPath = config.getString(ZUUL_FILTER_CUSTOM_PATH);
FilterLoader.getInstance().setCompiler(new GroovyCompiler());
FilterFileManager.setFilenameFilter(new GroovyFileFilter());
if (customPath == null) {
FilterFileManager.init(5, preFiltersPath, postFiltersPath, routingFiltersPath);
} else {
FilterFileManager.init(5, preFiltersPath, postFiltersPath, routingFiltersPath, customPath);
}
LOG.info("Groovy Filter file manager started");
}
use of com.netflix.zuul.groovy.GroovyCompiler in project zuul by Netflix.
the class StartServer method initGroovyFilterManager.
private void initGroovyFilterManager() {
FilterLoader.getInstance().setCompiler(new GroovyCompiler());
String scriptRoot = System.getProperty("zuul.filter.root", "");
if (scriptRoot.length() > 0)
scriptRoot = scriptRoot + File.separator;
try {
FilterFileManager.setFilenameFilter(new GroovyFileFilter());
FilterFileManager.init(5, scriptRoot + "pre", scriptRoot + "route", scriptRoot + "post");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations