org.apache.shiro.config
Class IniSecurityManagerFactory

java.lang.Object
  extended by org.apache.shiro.util.AbstractFactory<T>
      extended by org.apache.shiro.config.IniFactorySupport<SecurityManager>
          extended by org.apache.shiro.config.IniSecurityManagerFactory
All Implemented Interfaces:
Factory<SecurityManager>
Direct Known Subclasses:
WebIniSecurityManagerFactory

public class IniSecurityManagerFactory
extends IniFactorySupport<SecurityManager>

A Factory that creates SecurityManager instances based on Ini configuration.

Since:
1.0

Field Summary
static String INI_REALM_NAME
           
static String MAIN_SECTION_NAME
           
static String SECURITY_MANAGER_NAME
           
 
Fields inherited from class org.apache.shiro.config.IniFactorySupport
DEFAULT_INI_RESOURCE_PATH
 
Constructor Summary
IniSecurityManagerFactory()
          Creates a new instance.
IniSecurityManagerFactory(Ini config)
           
IniSecurityManagerFactory(String iniResourcePath)
           
 
Method Summary
protected  void applyRealmsToSecurityManager(Collection<Realm> realms, SecurityManager securityManager)
           
protected  SecurityManager createDefaultInstance()
           
protected  Map<String,?> createDefaults(Ini ini, Ini.Section mainSection)
           
protected  SecurityManager createInstance(Ini ini)
           
protected  Realm createRealm(Ini ini)
          Creates a Realm from the Ini instance containing account data.
 Map<String,?> getBeans()
           
protected  boolean isAutoApplyRealms(SecurityManager securityManager)
           
protected  boolean shouldImplicitlyCreateRealm(Ini ini)
          Returns true if the Ini contains account data and a Realm should be implicitly created to reflect the account data, false if no realm should be implicitly created.
 
Methods inherited from class org.apache.shiro.config.IniFactorySupport
createInstance, getIni, loadDefaultClassPathIni, resolveIni, setIni
 
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

MAIN_SECTION_NAME

public static final String MAIN_SECTION_NAME
See Also:
Constant Field Values

SECURITY_MANAGER_NAME

public static final String SECURITY_MANAGER_NAME
See Also:
Constant Field Values

INI_REALM_NAME

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

IniSecurityManagerFactory

public IniSecurityManagerFactory()
Creates a new instance. See the AbstractFactory.getInstance() JavaDoc for detailed explanation of how an INI source will be resolved to use to build the instance.


IniSecurityManagerFactory

public IniSecurityManagerFactory(Ini config)

IniSecurityManagerFactory

public IniSecurityManagerFactory(String iniResourcePath)
Method Detail

getBeans

public Map<String,?> getBeans()

createDefaultInstance

protected SecurityManager createDefaultInstance()
Specified by:
createDefaultInstance in class IniFactorySupport<SecurityManager>

createInstance

protected SecurityManager createInstance(Ini ini)
Specified by:
createInstance in class IniFactorySupport<SecurityManager>

isAutoApplyRealms

protected boolean isAutoApplyRealms(SecurityManager securityManager)

createDefaults

protected Map<String,?> createDefaults(Ini ini,
                                       Ini.Section mainSection)

applyRealmsToSecurityManager

protected void applyRealmsToSecurityManager(Collection<Realm> realms,
                                            SecurityManager securityManager)

shouldImplicitlyCreateRealm

protected boolean shouldImplicitlyCreateRealm(Ini ini)
Returns true if the Ini contains account data and a Realm should be implicitly created to reflect the account data, false if no realm should be implicitly created.

Parameters:
ini - the Ini instance to inspect for account data resulting in an implicitly created realm.
Returns:
true if the Ini contains account data and a Realm should be implicitly created to reflect the account data, false if no realm should be implicitly created.

createRealm

protected Realm createRealm(Ini ini)
Creates a Realm from the Ini instance containing account data.

Parameters:
ini - the Ini instance from which to acquire the account data.
Returns:
a new Realm instance reflecting the account data discovered in the Ini.


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.