Class HierarchicalConfigProvider<T>
- java.lang.Object
- 
- edu.uiuc.ncsa.security.core.configuration.provider.HierarchicalConfigProvider<T>
 
- 
- All Implemented Interfaces:
- CfgEventListener,- EventListener,- javax.inject.Provider<T>
 - Direct Known Subclasses:
- ConnectionPoolProvider,- MailUtilProvider,- TypedProvider
 
 public abstract class HierarchicalConfigProvider<T> extends Object implements javax.inject.Provider<T>, CfgEventListener 
 All configurations are interpreted locally, that is to say, it is up to something else to hand over the relevant node for this provider. Generally providers should not be aware of the complete hierarchy since that may be hard or impossible to navigate without a lot more information.
 Created by Jeff Gaynor 
 on 1/10/12 at 1:57 PM
- 
- 
Constructor SummaryConstructors Constructor Description HierarchicalConfigProvider()HierarchicalConfigProvider(CFNode cfNode)HierarchicalConfigProvider(org.apache.commons.configuration.tree.ConfigurationNode config)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddListener(CfgEventListener c)protected abstract booleancheckEvent(CfgEvent cfgEvent)Checks that the event applies to this component.protected TfireComponentFound(CfgEvent cfgEvent)StringgetAttribute(String key)Gets the attribute with the given key.protected StringgetAttribute(String key, String defaultValue)utility method to supply a default value if the given value is missing.booleangetBooleanAttribute(String key)CFNodegetCFNode()org.apache.commons.configuration.tree.ConfigurationNodegetConfig()org.apache.commons.configuration.tree.ConfigurationNodegetConfigurationAt(String name)Return the givenConfigurationNode.intgetIntAttribute(String key)intgetIntAttribute(String key, int defaultValue)LinkedList<CfgEventListener>getListeners()booleanhasA(String name)Does this have the named component? In other words, is there a configuration of this name one level down?booleanhasCFNode()booleanisA(String name)Check if the configuration is of the indicated type.voidremoveListener(CfgEventListener x)voidsetCFNode(CFNode cfNode)voidsetConfig(org.apache.commons.configuration.tree.ConfigurationNode config)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface edu.uiuc.ncsa.security.core.configuration.provider.CfgEventListenercomponentFound
 
- 
 
- 
- 
- 
Constructor Detail- 
HierarchicalConfigProviderpublic HierarchicalConfigProvider() 
 - 
HierarchicalConfigProviderpublic HierarchicalConfigProvider(org.apache.commons.configuration.tree.ConfigurationNode config) 
 - 
HierarchicalConfigProviderpublic HierarchicalConfigProvider(CFNode cfNode) 
 
- 
 - 
Method Detail- 
getListenerspublic LinkedList<CfgEventListener> getListeners() 
 - 
addListenerpublic void addListener(CfgEventListener c) 
 - 
removeListenerpublic void removeListener(CfgEventListener x) 
 - 
getCFNodepublic CFNode getCFNode() 
 - 
setCFNodepublic void setCFNode(CFNode cfNode) 
 - 
hasCFNodepublic boolean hasCFNode() 
 - 
getConfigpublic org.apache.commons.configuration.tree.ConfigurationNode getConfig() 
 - 
setConfigpublic void setConfig(org.apache.commons.configuration.tree.ConfigurationNode config) 
 - 
getAttributepublic String getAttribute(String key) Gets the attribute with the given key. This slaps "[@" and "]" around the key to conform with how Apache resolves these.- Parameters:
- key-
- Returns:
 
 - 
getAttributeprotected String getAttribute(String key, String defaultValue) utility method to supply a default value if the given value is missing.- Parameters:
- key-
- defaultValue-
- Returns:
 
 - 
getIntAttributepublic int getIntAttribute(String key, int defaultValue) 
 - 
getIntAttributepublic int getIntAttribute(String key) 
 - 
getBooleanAttributepublic boolean getBooleanAttribute(String key) 
 - 
isApublic boolean isA(String name) Check if the configuration is of the indicated type. This means that the root node has the name of the component, e.g. fileStore, mysql or whatever.- Parameters:
- name-
- Returns:
 
 - 
hasApublic boolean hasA(String name) Does this have the named component? In other words, is there a configuration of this name one level down?- Parameters:
- name-
- Returns:
 
 - 
getConfigurationAtpublic org.apache.commons.configuration.tree.ConfigurationNode getConfigurationAt(String name) Return the givenConfigurationNode. This- Parameters:
- name-
- Returns:
 
 - 
checkEventprotected abstract boolean checkEvent(CfgEvent cfgEvent) Checks that the event applies to this component. The type is the component and the target is Normally you set the component key as a static field in the class (e.g. "mysql") and pass it along in the theCfgEventListener.componentFound(CfgEvent)method. If checkEvent fails, do no more processing with the event.- Parameters:
- cfgEvent-
- Returns:
 
 
- 
 
-