Search in sources :

Example 1 with FilterConfigImpl

use of org.atmosphere.util.FilterConfigImpl in project atmosphere by Atmosphere.

the class ReflectorServletProcessor method loadFilterInstances.

private void loadFilterInstances(ServletConfig sc) {
    for (Filter f : filters) {
        FilterConfigImpl fc = new FilterConfigImpl(sc);
        fc.setFilter(f);
        fc.setFilterName(f.getClass().getSimpleName());
        filterChain.addFilter(fc);
        logger.info("Installing Filter {}", f.getClass().getSimpleName());
    }
}
Also used : FilterConfigImpl(org.atmosphere.util.FilterConfigImpl) Filter(javax.servlet.Filter)

Example 2 with FilterConfigImpl

use of org.atmosphere.util.FilterConfigImpl in project atmosphere by Atmosphere.

the class ReflectorServletProcessor method loadFilterClasses.

private void loadFilterClasses(ServletConfig sc, URLClassLoader urlC) throws Exception {
    for (Map.Entry<String, String> fClassAndName : filtersClassAndNames.entrySet()) {
        String fClass = fClassAndName.getKey();
        String filterName = fClassAndName.getValue();
        Filter f = loadFilter(urlC, fClass);
        if (filterName == null) {
            if (sc.getInitParameter(APPLICATION_NAME) != null) {
                filterName = sc.getInitParameter(APPLICATION_NAME);
            } else {
                filterName = f.getClass().getSimpleName();
            }
        }
        FilterConfigImpl fc = new FilterConfigImpl(sc);
        fc.setFilter(f);
        fc.setFilterName(filterName);
        filterChain.addFilter(fc);
        logger.info("Installing Filter {}", filterName);
    }
}
Also used : FilterConfigImpl(org.atmosphere.util.FilterConfigImpl) Filter(javax.servlet.Filter) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

Filter (javax.servlet.Filter)2 FilterConfigImpl (org.atmosphere.util.FilterConfigImpl)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1