use of io.datarouter.inject.DatarouterInjector in project datarouter by hotpads.
the class BaseDatarouterServletContextListener method buildExecuteOnActionsLists.
private void buildExecuteOnActionsLists(ServletContextEvent event) {
DatarouterInjector injector = getInjector(event.getServletContext());
Scanner.of(listenerClasses).map(injector::getInstance).forEach(allListeners::add);
Scanner.of(webListenerClasses).map(injector::getInstance).each(listener -> listener.setServletContext(event.getServletContext())).forEach(allListeners::add);
Scanner.of(allListeners).splitBy(DatarouterAppListener::safeToExecuteInParallel).map(Scanner::list).map(listeners -> new Pair<>(listeners.get(0).safeToExecuteInParallel() ? ExecutionMode.PARALLEL : ExecutionMode.SYNCHRONOUS, listeners)).forEach(listenersByExecutionMods::add);
}
use of io.datarouter.inject.DatarouterInjector in project datarouter by hotpads.
the class RequestCachingFilter method init.
@Override
public void init(FilterConfig filterConfig) {
DatarouterInjector injector = getInjector(filterConfig.getServletContext());
webSettingRoot = injector.getInstance(DatarouterWebSettingRoot.class);
}
use of io.datarouter.inject.DatarouterInjector in project datarouter by hotpads.
the class TraceFilter method init.
@Override
public void init(FilterConfig filterConfig) {
DatarouterInjector injector = getInjector(filterConfig.getServletContext());
serverName = injector.getInstance(ServerName.class);
trace2BufferForLocal = injector.getInstance(Trace2ForLocalFilterToMemoryBuffer.class);
trace2BufferForPublisher = injector.getInstance(Trace2ForPublisherFilterToMemoryBuffer.class);
traceSettings = injector.getInstance(DatarouterTraceFilterSettingRoot.class);
urlBuilder = injector.getInstance(TraceUrlBuilder.class);
currentSessionInfo = injector.getInstance(CurrentSessionInfo.class);
handlerMetrics = injector.getInstance(HandlerMetrics.class);
serviceName = injector.getInstance(ServiceName.class);
}
use of io.datarouter.inject.DatarouterInjector in project datarouter by hotpads.
the class StaticFileFilter method init.
@Override
public void init(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
this.requestDispatcher = filterConfig.getServletContext().getNamedDispatcher("default");
DatarouterInjector injector = getInjector(filterConfig.getServletContext());
staticFileFilterConfig = injector.getInstance(StaticFileFilterConfig.class);
}
Aggregations