org.apache.shiro.config
Class IniFactorySupport<T>

java.lang.Object
  extended by org.apache.shiro.util.AbstractFactory<T>
      extended by org.apache.shiro.config.IniFactorySupport<T>
All Implemented Interfaces:
Factory<T>
Direct Known Subclasses:
IniFilterChainResolverFactory, 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

Field Summary
static String DEFAULT_INI_RESOURCE_PATH
           
 
Constructor Summary
protected IniFactorySupport()
           
protected IniFactorySupport(Ini ini)
           
 
Method Summary
protected abstract  T createDefaultInstance()
           
 T createInstance()
          Creates a new object instance by using a configured INI source.
protected abstract  T createInstance(Ini ini)
           
 Ini getIni()
           
static Ini loadDefaultClassPathIni()
          Returns a new Ini instance created from the default classpath:shiro.ini file, or null if the file does not exist.
protected  Ini resolveIni()
          Tries to resolve the Ini instance to use for configuration.
 void setIni(Ini ini)
           
 
Methods inherited from class org.apache.shiro.util.AbstractFactory
getInstance, isSingleton, setSingleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INI_RESOURCE_PATH

public static final String DEFAULT_INI_RESOURCE_PATH
See Also:
Constant Field Values
Constructor Detail

IniFactorySupport

protected IniFactorySupport()

IniFactorySupport

protected IniFactorySupport(Ini ini)
Method Detail

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:
  1. The Ini instance returned from getIni() will be returned if it is not null or empty.
  2. If getIni() is null or empty, this implementation will attempt to find and load the default class path Ini.
  3. 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:
  1. Resolve the Ini source to use for configuration.
  2. 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-2014 The Apache Software Foundation. All Rights Reserved.