org.apache.shiro.config
Class IniFactorySupport<T>
java.lang.Object
org.apache.shiro.util.AbstractFactory<T>
org.apache.shiro.config.IniFactorySupport<T>
- All Implemented Interfaces:
- Factory<T>
- Direct Known Subclasses:
- IniSecurityManagerFactory
public abstract class IniFactorySupport<T>
- extends AbstractFactory<T>
Base support class for Factory
implementations that generate their instance(s) based on
Ini
configuration.
- Since:
- 1.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_INI_RESOURCE_PATH
public static final String DEFAULT_INI_RESOURCE_PATH
- See Also:
- Constant Field Values
IniFactorySupport
protected IniFactorySupport()
IniFactorySupport
protected IniFactorySupport(Ini ini)
getIni
public Ini getIni()
setIni
public void setIni(Ini ini)
loadDefaultClassPathIni
public static Ini loadDefaultClassPathIni()
- Returns a new Ini instance created from the default
classpath:shiro.ini
file, or null
if
the file does not exist.
- Returns:
- a new Ini instance created from the default
classpath:shiro.ini
file, or null
if
the file does not exist.
resolveIni
protected Ini resolveIni()
- Tries to resolve the Ini instance to use for configuration. This implementation functions as follows:
- The
Ini
instance returned from getIni()
will be returned if it is not null or empty.
- If
getIni()
is null
or empty, this implementation will attempt to find and load the
default class path Ini
.
- If neither of the two attempts above returns an instance,
null
is returned
- Returns:
- the Ini instance to use for configuration.
createInstance
public T createInstance()
- Creates a new object instance by using a configured INI source. This implementation functions as follows:
Resolve
the Ini
source to use for configuration.
- If there was no resolved Ini source, create and return a simple default instance via the
createDefaultInstance()
method.
- Specified by:
createInstance
in class AbstractFactory<T>
- Returns:
- a new
SecurityManager
instance by using a configured INI source.
createInstance
protected abstract T createInstance(Ini ini)
createDefaultInstance
protected abstract T createDefaultInstance()
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.