Author: almaw
Date: Tue Jun  5 03:09:18 2007
New Revision: 544437

URL: http://svn.apache.org/viewvc?view=rev&rev=544437
Log:
Larger warnings on DEVELOPMENT mode start-up, with better documentation.

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java
    
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebApplication.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java?view=diff&rev=544437&r1=544436&r2=544437
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Application.java
 Tue Jun  5 03:09:18 2007
@@ -370,8 +370,7 @@
        /**
         * Gets the configuration mode to use for configuring the app, either
         * [EMAIL PROTECTED] #DEVELOPMENT} or [EMAIL PROTECTED] #DEPLOYMENT}.
-        * 
-        * 
+        * <p>
         * The configuration type. Must currently be either DEVELOPMENT or
         * DEPLOYMENT. Currently, if the configuration type is DEVELOPMENT,
         * resources are polled for changes, component usage is checked, wicket 
tags
@@ -379,6 +378,10 @@
         * type is DEPLOYMENT, component usage is not checked, wicket tags are
         * stripped from output and a non-detailed exception page is used to 
display
         * errors.
+        * <p>
+        * Note that you should not run Wicket in DEVELOPMENT mode on production
+        * servers - the various debugging checks and resource polling is
+        * inefficient and may leak resources, particularly on webapp redeploy.
         * 
         * @return configuration
         * @since 1.2.3 (function existed as a property getter)

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebApplication.java?view=diff&rev=544437&r1=544436&r2=544437
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WebApplication.java
 Tue Jun  5 03:09:18 2007
@@ -675,6 +675,28 @@
                }
                b.append("in ").append(getConfigurationType()).append(" mode");
                log.info(b.toString());
+               if (DEVELOPMENT.equalsIgnoreCase(getConfigurationType()))
+               {
+                       outputDevelopmentModeWarning();
+               }
+       }
+       
+       /**
+        * This method prints a warning to stderr that we are starting in
+        * development mode.
+        * <p>
+        * If you really need to test Wicket in development mode on a staging 
server
+        * somewhere and are annoying the sysadmin for it with stderr messages, 
you
+        * can override this to make it do something else.
+        */
+       protected void outputDevelopmentModeWarning()
+       {
+               
System.err.print("********************************************************************\n"
+                               + "*** WARNING: Wicket is running in 
DEVELOPMENT mode.              ***\n"
+                               + "***                               
^^^^^^^^^^^                    ***\n"
+                               + "*** Do NOT deploy to your live server(s) 
without changing this.  ***\n"
+                               + "*** See Application#getConfigurationType() 
for more information. ***\n"
+                               + 
"********************************************************************\n");
        }
 
        /**


Reply via email to