org.apache.struts2.config
Class StrutsXmlConfigurationProvider
java.lang.Object
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider
org.apache.struts2.config.StrutsXmlConfigurationProvider
- All Implemented Interfaces:
- ConfigurationProvider
public class StrutsXmlConfigurationProvider
- extends XmlConfigurationProvider
Override Xwork class so we can use an arbitrary config file
| Methods inherited from class com.opensymphony.xwork2.config.providers.XmlConfigurationProvider |
addAction, addPackage, addResultTypes, buildExceptionMappings, buildInterceptorList, buildPackageContext, buildResults, destroy, equals, getDtdMappings, hashCode, init, loadDefaultActionRef, loadDefaultClassRef, loadDefaultInterceptorRef, loadExtraConfiguration, loadGlobalResults, loadGobalExceptionMappings, loadInterceptors, loadInterceptorStack, loadInterceptorStacks, setDtdMappings, setObjectFactory, verifyAction, verifyResultType |
LOG
private static final Log LOG
baseDir
private File baseDir
filename
private String filename
reloadKey
private String reloadKey
servletContext
private ServletContext servletContext
StrutsXmlConfigurationProvider
public StrutsXmlConfigurationProvider(boolean errorIfMissing)
- Constructs the configuration provider
- Parameters:
errorIfMissing - If we should throw an exception if the file can't be found
StrutsXmlConfigurationProvider
public StrutsXmlConfigurationProvider(String filename,
boolean errorIfMissing,
ServletContext ctx)
- Constructs the configuration provider
- Parameters:
filename - The filename to look forerrorIfMissing - If we should throw an exception if the file can't be foundctx - Our ServletContext
register
public void register(ContainerBuilder containerBuilder,
LocatableProperties props)
throws ConfigurationException
- Specified by:
register in interface ConfigurationProvider- Overrides:
register in class XmlConfigurationProvider
- Throws:
ConfigurationException
loadPackages
public void loadPackages()
- Specified by:
loadPackages in interface ConfigurationProvider- Overrides:
loadPackages in class XmlConfigurationProvider
getConfigurationUrls
protected Iterator<URL> getConfigurationUrls(String fileName)
throws IOException
- Look for the configuration file on the classpath and in the file system
- Overrides:
getConfigurationUrls in class XmlConfigurationProvider
- Parameters:
fileName - The file name to retrieve
- Throws:
IOException- See Also:
XmlConfigurationProvider.getConfigurationUrls(java.lang.String)
findInFileSystem
protected URL findInFileSystem(String fileName)
throws IOException
- Throws:
IOException
needsReload
public boolean needsReload()
- Overrides needs reload to ensure it is only checked once per request
- Specified by:
needsReload in interface ConfigurationProvider- Overrides:
needsReload in class XmlConfigurationProvider
- Returns:
- true if the file has been changed since the last time we read it
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.