*
**/
protected IPropertySource createPropertySource(RequestContext context)
{
DelegatingPropertySource result = new DelegatingPropertySource();
ApplicationServlet servlet = context.getServlet();
IApplicationSpecification spec = servlet.getApplicationSpecification();
result.addSource(new PropertyHolderPropertySource(spec));
result.addSource(new ServletPropertySource(servlet.getServletConfig()));
result.addSource(new ServletContextPropertySource(servlet.getServletContext()));
if (spec.checkExtension(EXTENSION_PROPERTY_SOURCE_NAME))
{
IPropertySource source =
(IPropertySource) spec.getExtension(
EXTENSION_PROPERTY_SOURCE_NAME,
IPropertySource.class);
result.addSource(source);
}
result.addSource(SystemPropertiesPropertySource.getInstance());
// Lastly, add a final source to handle "factory defaults".
ResourceBundle bundle =
ResourceBundle.getBundle("org.apache.tapestry.ConfigurationDefaults");
result.addSource(new ResourceBundlePropertySource(bundle));
return result;
}