public class IniWebEnvironment extends ResourceBasedWebEnvironment implements Initializable, Destroyable
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_WEB_INI_RESOURCE_PATH |
DEFAULT_SECURITY_MANAGER_KEY, objects
Constructor and Description |
---|
IniWebEnvironment() |
Modifier and Type | Method and Description |
---|---|
protected void |
configure() |
protected FilterChainResolver |
createFilterChainResolver() |
protected Ini |
createIni(String configLocation,
boolean required)
Creates an
Ini instance reflecting the specified path, or null if the path does not exist and
is not required. |
protected WebSecurityManager |
createWebSecurityManager() |
protected String[] |
getDefaultConfigLocations()
Returns an array with two elements,
/WEB-INF/shiro.ini and classpath:shiro.ini . |
protected Ini |
getDefaultIni() |
Ini |
getIni()
Returns the
Ini instance reflecting this WebEnvironment's configuration. |
protected Ini |
getSpecifiedIni(String[] configLocations) |
void |
init()
|
void |
setIni(Ini ini)
Allows for configuration via a direct
Ini instance instead of via
config locations . |
getConfigLocations, setConfigLocations, setConfigLocations
getFilterChainResolver, getSecurityManager, getServletContext, getWebSecurityManager, setFilterChainResolver, setSecurityManager, setServletContext, setWebSecurityManager
destroy, getObject, getObjects, getSecurityManagerName, lookupSecurityManager, setObject, setSecurityManagerName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy
public static final String DEFAULT_WEB_INI_RESOURCE_PATH
public void init()
Ini
configuration and calling configure
for actual instance configuration.init
in interface Initializable
protected void configure()
protected Ini getSpecifiedIni(String[] configLocations) throws ConfigurationException
ConfigurationException
protected Ini getDefaultIni()
protected Ini createIni(String configLocation, boolean required) throws ConfigurationException
Ini
instance reflecting the specified path, or null
if the path does not exist and
is not required.
If the path is required and does not exist or is empty, a ConfigurationException
will be thrown.configLocation
- the resource path to load into an Ini
instance.required
- if the path must exist and be converted to a non-empty Ini
instance.Ini
instance reflecting the specified path, or null
if the path does not exist and
is not required.ConfigurationException
- if the path is required but results in a null or empty Ini instance.protected FilterChainResolver createFilterChainResolver()
protected WebSecurityManager createWebSecurityManager()
protected String[] getDefaultConfigLocations()
/WEB-INF/shiro.ini
and classpath:shiro.ini
./WEB-INF/shiro.ini
and classpath:shiro.ini
.public Ini getIni()
Ini
instance reflecting this WebEnvironment's configuration.Ini
instance reflecting this WebEnvironment's configuration.public void setIni(Ini ini)
Ini
instance instead of via
config locations
.
If the specified instance is null or empty, the fallback/default resource-based configuration will be used.ini
- the ini instance to use for creation.Copyright © 2004–2018 The Apache Software Foundation. All rights reserved.