Search in sources :

Example 1 with IniFactorySupport

use of org.apache.shiro.config.IniFactorySupport in project shiro by apache.

the class IniWebEnvironment method createFilterChainResolver.

protected FilterChainResolver createFilterChainResolver() {
    FilterChainResolver resolver = null;
    Ini ini = getIni();
    if (!CollectionUtils.isEmpty(ini)) {
        // only create a resolver if the 'filters' or 'urls' sections are defined:
        Ini.Section urls = ini.getSection(IniFilterChainResolverFactory.URLS);
        Ini.Section filters = ini.getSection(IniFilterChainResolverFactory.FILTERS);
        if (!CollectionUtils.isEmpty(urls) || !CollectionUtils.isEmpty(filters)) {
            // either the urls section or the filters section was defined.  Go ahead and create the resolver:
            Factory<FilterChainResolver> factory = (Factory<FilterChainResolver>) this.objects.get(FILTER_CHAIN_RESOLVER_NAME);
            if (factory instanceof IniFactorySupport) {
                IniFactorySupport iniFactory = (IniFactorySupport) factory;
                iniFactory.setIni(ini);
                iniFactory.setDefaults(this.objects);
            }
            resolver = factory.getInstance();
        }
    }
    return resolver;
}
Also used : FilterChainResolver(org.apache.shiro.web.filter.mgt.FilterChainResolver) Ini(org.apache.shiro.config.Ini) LoggerFactory(org.slf4j.LoggerFactory) WebIniSecurityManagerFactory(org.apache.shiro.web.config.WebIniSecurityManagerFactory) IniFilterChainResolverFactory(org.apache.shiro.web.config.IniFilterChainResolverFactory) IniFactorySupport(org.apache.shiro.config.IniFactorySupport)

Aggregations

Ini (org.apache.shiro.config.Ini)1 IniFactorySupport (org.apache.shiro.config.IniFactorySupport)1 IniFilterChainResolverFactory (org.apache.shiro.web.config.IniFilterChainResolverFactory)1 WebIniSecurityManagerFactory (org.apache.shiro.web.config.WebIniSecurityManagerFactory)1 FilterChainResolver (org.apache.shiro.web.filter.mgt.FilterChainResolver)1 LoggerFactory (org.slf4j.LoggerFactory)1