/** Initializes the caching HTTP Headers Filter. */
  private void initCachingHttpHeadersFilter(
      ServletContext servletContext, EnumSet<DispatcherType> disps) {
    log.debug("Registering Caching HTTP Headers Filter");
    FilterRegistration.Dynamic cachingHttpHeadersFilter =
        servletContext.addFilter("cachingHttpHeadersFilter", new CachingHttpHeadersFilter(env));

    cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/dist/assets/*");
    cachingHttpHeadersFilter.addMappingForUrlPatterns(disps, true, "/dist/scripts/*");
    cachingHttpHeadersFilter.setAsyncSupported(true);
  }
  /** Initializes the static resources production Filter. */
  private void initStaticResourcesProductionFilter(
      ServletContext servletContext, EnumSet<DispatcherType> disps) {

    log.debug("Registering static resources production Filter");
    FilterRegistration.Dynamic staticResourcesProductionFilter =
        servletContext.addFilter(
            "staticResourcesProductionFilter", new StaticResourcesProductionFilter());

    staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/");
    staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/index.html");
    staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/assets/*");
    staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/scripts/*");
    staticResourcesProductionFilter.setAsyncSupported(true);
  }
  /** Initializes Metrics. */
  private void initMetrics(ServletContext servletContext, EnumSet<DispatcherType> disps) {
    log.debug("Initializing Metrics registries");
    servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE, metricRegistry);
    servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY, metricRegistry);

    log.debug("Registering Metrics Filter");
    FilterRegistration.Dynamic metricsFilter =
        servletContext.addFilter("webappMetricsFilter", new InstrumentedFilter());

    metricsFilter.addMappingForUrlPatterns(disps, true, "/*");
    metricsFilter.setAsyncSupported(true);

    log.debug("Registering Metrics Servlet");
    ServletRegistration.Dynamic metricsAdminServlet =
        servletContext.addServlet("metricsServlet", new MetricsServlet());

    metricsAdminServlet.addMapping("/management/jhipster/metrics/*");
    metricsAdminServlet.setAsyncSupported(true);
    metricsAdminServlet.setLoadOnStartup(2);
  }
 @Override
 public FilterRegistration.Dynamic addFilter(String s, Class<? extends Filter> aClass) {
   return proxy.addFilter(s, aClass);
 }
 @Override
 public FilterRegistration.Dynamic addFilter(String s, Filter filter) {
   return proxy.addFilter(s, filter);
 }
 @Override
 public FilterRegistration.Dynamic addFilter(String s, String s1) {
   return proxy.addFilter(s, s1);
 }
 public Dynamic addFilter(String arg0, Class<? extends Filter> arg1) {
   return servletContext.addFilter(arg0, arg1);
 }
 public Dynamic addFilter(String arg0, Filter arg1) {
   return servletContext.addFilter(arg0, arg1);
 }