You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2011/09/23 21:46:32 UTC
svn commit: r1174977 -
/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java
Author: hlship
Date: Fri Sep 23 19:46:32 2011
New Revision: 1174977
URL: http://svn.apache.org/viewvc?rev=1174977&view=rev
Log:
TAP5-1350: TapestryFilter should allow sub-classes to specify additional module classes, not just ModuleDefs
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java?rev=1174977&r1=1174976&r2=1174977&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/TapestryFilter.java Fri Sep 23 19:46:32 2011
@@ -43,7 +43,7 @@ import java.io.IOException;
* <dt>tapestry.app-package</dt>
* <dd>The application package (used to search for pages, components, etc.)</dd>
* </dl>
- * <p>
+ * <p/>
* In addition, a JVM system property affects configuration: <code>tapestry.execution-mode</code>
* (with default value "production"). This property is a comma-separated list of execution modes.
* For each mode, an additional init parameter is checked for:
@@ -92,7 +92,7 @@ public class TapestryFilter implements F
public String valueForSymbol(String symbolName)
{
String contextValue = contextProvider.valueForSymbol(symbolName);
- if ( contextValue != null ) return contextValue;
+ if (contextValue != null) return contextValue;
return systemProvider.valueForSymbol(symbolName);
}
@@ -104,6 +104,7 @@ public class TapestryFilter implements F
filterName, executionMode);
appInitializer.addModules(provideExtraModuleDefs(context));
+ appInitializer.addModules(provideExtraModuleClasses(context));
registry = appInitializer.createRegistry();
@@ -132,9 +133,8 @@ public class TapestryFilter implements F
* Invoked from {@link #init(FilterConfig)} after the Registry has been created, to allow any
* additional
* initialization to occur. This implementation does nothing, and my be overriden in subclasses.
- *
- * @param registry
- * from which services may be extracted
+ *
+ * @param registry from which services may be extracted
* @throws ServletException
*/
protected void init(Registry registry) throws ServletException
@@ -152,6 +152,17 @@ public class TapestryFilter implements F
return new ModuleDef[0];
}
+ /**
+ * Overriden in subclasses to provide additional module classes beyond those normally located. This implementation
+ * returns an empty array.
+ *
+ * @since 5.3
+ */
+ protected Class[] provideExtraModuleClasses(ServletContext context)
+ {
+ return new Class[0];
+ }
+
public final void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
@@ -162,8 +173,7 @@ public class TapestryFilter implements F
if (!handled)
chain.doFilter(request, response);
- }
- finally
+ } finally
{
registry.cleanupThread();
}
@@ -193,7 +203,7 @@ public class TapestryFilter implements F
* filter. The Registry
* will be shutdown after this call. This implementation does nothing, and may be overridden in
* subclasses.
- *
+ *
* @param registry
*/
protected void destroy(Registry registry)