Author: drobiazko
Date: Sun Nov  1 19:00:09 2009
New Revision: 831728

URL: http://svn.apache.org/viewvc?rev=831728&view=rev
Log:
TAP5-247: Move all Tapestry 5 configuration keys to a constant class

Modified:
    
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
    
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java?rev=831728&r1=831727&r2=831728&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java
 Sun Nov  1 19:00:09 2009
@@ -187,4 +187,92 @@
      */
     public static final String BLACKBIRD_ENABLED = 
"tapestry.blackbird-enabled";
 
+    /**
+     * The default time interval that cookies created by Tapestry will be kept 
in the client web browser. The default is "7 d" (that is, seven days).
+     *
+     * @since 5.2.0.0
+     */
+    public static final String COOKIE_MAX_AGE = 
"tapestry.default-cookie-max-age";
+
+    /**
+     * The logical name of the start page, the page that is rendered for the 
root URL.
+     *
+     * @since 5.2.0.0
+     */
+    public static final String START_PAGE_NAME = "tapestry.start-page-name";
+    
+
+    /**
+     * The default stylesheet automatically injected into every rendered HTML 
page. 
+     *
+     * @since 5.2.0.0
+     */
+    public static final String DEFAULT_STYLESHEET = 
"tapestry.default-stylesheet";
+    
+
+    /**
+     * The number of pages in the page pool (for a given page name / locale 
combination) before which Tapestry will start to wait for existing pages to be 
made available. 
+     * Under this limit of pages, Tapestry will simply create a new page 
instance if no existing instance is readily available. 
+     * Once the soft limit is reached, Tapestry will wait a short period of 
time (the soft wait interval) to see if an existing page 
+     * instance is made available. It will then create a new page instance 
(unless the hard limit has been reached). 
+     * The default is 5 page instances. Remember that page pooling is done 
separately for each page (and localization of the page). 
+     *
+     * @since 5.2.0.0
+     */
+    public static final String PAGE_POOL_SOFT_LIMIT = 
"tapestry.page-pool.soft-limit";
+    
+
+    /**
+     * The absolute maximum number of page instances (for a particular page 
name / locale combination) that Tapestry will create at any time. 
+     * If this number is reached, then requests will fail because a page 
instance is not available ... this can happen as part of a denial of service 
attack. 
+     * For this value to have any meaning, it should be lower than the number 
of threads that the servlet container is configured to use when processing 
requests. 
+     * The default is 20 page instances. 
+     *
+     * @since 5.2.0.0
+     */
+    public static final String PAGE_POOL_HARD_LIMIT = 
"tapestry.page-pool.hard-limit";
+    
+
+    /**
+     * The time interval that Tapestry will wait for a page instance to become 
available before deciding whether to create an entirely new page instance. 
+     * The default is "10 ms".
+     *
+     * @since 5.2.0.0
+     */
+    public static final String PAGE_POOL_SOFT_WAIT = 
"tapestry.page-pool.soft-wait";
+    
+
+    /**
+     * The time interval that an instantiated page instance may be cached 
before being removed. As pages are returned to the pool, they are time stamped. 
+     * Periodically (as per the file check interval), the pool is scanned for 
page instances that have not been used recently; those that are outside the 
+     * active window are discarded. This is used to free up unnecessary page 
instances after a request surge. The default is "10 m" (10 minutes).
+     *
+     * @since 5.2.0.0
+     */
+    public static final String PAGE_POOL_ACTIVE_WINDOW  = 
"tapestry.page-pool.active-window";
+    
+
+    /**
+     * The path to the embedded copy of script.aculo.us packaged with Tapestry.
+     *
+     * @since 5.2.0.0
+     */
+    public static final String SCRIPTACULOUS  = "tapestry.scriptaculous";
+    
+
+    /**
+     * The path to the embedded datepicker.
+     *
+     * @since 5.2.0.0
+     */
+    public static final String DATEPICKER  = "tapestry.datepicker";
+    
+
+    /**
+     * The path to the embedded copy of blackbird packaged with Tapestry.
+     *
+     * @since 5.2.0.0
+     */
+    public static final String BLACKBIRD  = "tapestry.blackbird";
+
 }

Modified: 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=831728&r1=831727&r2=831728&view=diff
==============================================================================
--- 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
 (original)
+++ 
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
 Sun Nov  1 19:00:09 2009
@@ -2032,17 +2032,17 @@
                           VersionUtils.readVersionNumber(
                                   
"META-INF/maven/org.apache.tapestry/tapestry-core/pom.properties"));
 
-        configuration.add("tapestry.default-cookie-max-age", "7 d");
+        configuration.add(SymbolConstants.COOKIE_MAX_AGE, "7 d");
 
-        configuration.add("tapestry.start-page-name", "start");
+        configuration.add(SymbolConstants.START_PAGE_NAME, "start");
 
-        configuration.add("tapestry.default-stylesheet", 
"classpath:/org/apache/tapestry5/default.css");
+        configuration.add(SymbolConstants.DEFAULT_STYLESHEET, 
"classpath:/org/apache/tapestry5/default.css");
         configuration.add("tapestry.spacer-image", 
"classpath:/org/apache/tapestry5/spacer.gif");
 
-        configuration.add("tapestry.page-pool.soft-limit", "5");
-        configuration.add("tapestry.page-pool.soft-wait", "10 ms");
-        configuration.add("tapestry.page-pool.hard-limit", "20");
-        configuration.add("tapestry.page-pool.active-window", "10 m");
+        configuration.add(SymbolConstants.PAGE_POOL_SOFT_LIMIT, "5");
+        configuration.add(SymbolConstants.PAGE_POOL_SOFT_WAIT, "10 ms");
+        configuration.add(SymbolConstants.PAGE_POOL_HARD_LIMIT, "20");
+        configuration.add(SymbolConstants.PAGE_POOL_ACTIVE_WINDOW, "10 m");
 
         
configuration.add(SymbolConstants.SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS, 
"false");
 
@@ -2063,16 +2063,16 @@
         // releases to be accidentally left lying around). There's also a 
ClasspathAliasManager
         // contribution based on the path.
 
-        configuration.add("tapestry.scriptaculous", 
"classpath:${tapestry.scriptaculous.path}");
+        configuration.add(SymbolConstants.SCRIPTACULOUS, 
"classpath:${tapestry.scriptaculous.path}");
         configuration.add("tapestry.scriptaculous.path", 
"org/apache/tapestry5/scriptaculous_1_8_2");
 
         // Likewise for WebFX DatePicker, currently version 1.0.6
 
         configuration.add("tapestry.datepicker.path", 
"org/apache/tapestry5/datepicker_106");
-        configuration.add("tapestry.datepicker", 
"classpath:${tapestry.datepicker.path}");
+        configuration.add(SymbolConstants.DATEPICKER, 
"classpath:${tapestry.datepicker.path}");
 
         configuration.add("tapestry.blackbird.path", 
"org/apache/tapestry5/blackbird_1_0");
-        configuration.add("tapestry.blackbird", 
"classpath:${tapestry.blackbird.path}");
+        configuration.add(SymbolConstants.BLACKBIRD, 
"classpath:${tapestry.blackbird.path}");
 
         configuration.add(SymbolConstants.PERSISTENCE_STRATEGY, 
PersistenceConstants.SESSION);
 


Reply via email to