protected void initFilter(Filter filter) {
        FilterConfig filterConfig = getFilterConfig();
        if (filterConfig == null) {
            throw new IllegalStateException("FilterConfig attribute has not been set.  This must occur before filter "
                    + "initialization can occur.");
        }
        try {
            filter.init(filterConfig);
        } catch (ServletException e) {
            throw new ConfigurationException(e);
        }
    }
Initializes the filter by calling <code>filter.init( {@link #getFilterConfig() getFilterConfig()} );</code>.

@param filter the filter to initialize with the {@code FilterConfig}.
web/src/main/java/org/apache/shiro/web/filter/mgt/DefaultFilterChainManager.java