Author: tv
Date: Wed Dec 10 13:23:08 2008
New Revision: 725441

URL: http://svn.apache.org/viewvc?rev=725441&view=rev
Log:
Remove evil "implements TurbineConstants"

Modified:
    turbine/core/trunk/src/java/org/apache/turbine/Turbine.java
    
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultACLCreationValve.java
    
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultLoginValve.java
    
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionTimeoutValve.java
    
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionValidationValve.java
    turbine/core/trunk/src/test/org/apache/turbine/test/BaseTestCase.java

Modified: turbine/core/trunk/src/java/org/apache/turbine/Turbine.java
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/Turbine.java?rev=725441&r1=725440&r2=725441&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/Turbine.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/Turbine.java Wed Dec 10 
13:23:08 2008
@@ -100,8 +100,10 @@
  */
 public class Turbine
         extends HttpServlet
-        implements TurbineConstants
 {
+    /** Serialversion */
+    private static final long serialVersionUID = -6317118078613623990L;
+
     /**
      * Name of path info parameter used to indicate the redirected stage of
      * a given user's initial Turbine request
@@ -232,14 +234,14 @@
         // to be developed from CVS. This feature will carry over
         // into 3.0.
         applicationRoot = findInitParameter(context, config,
-                APPLICATION_ROOT_KEY,
-                APPLICATION_ROOT_DEFAULT);
+                TurbineConstants.APPLICATION_ROOT_KEY,
+                TurbineConstants.APPLICATION_ROOT_DEFAULT);
 
         webappRoot = config.getServletContext().getRealPath("/");
         // log.info("Web Application root is " + webappRoot);
         // log.info("Application root is "     + applicationRoot);
 
-        if (applicationRoot == null || applicationRoot.equals(WEB_CONTEXT))
+        if (applicationRoot == null || 
applicationRoot.equals(TurbineConstants.WEB_CONTEXT))
         {
             applicationRoot = webappRoot;
             // log.info("got empty or 'webContext' Application root. 
Application root now: " + applicationRoot);
@@ -314,8 +316,8 @@
         //
         // Set up logging as soon as possible
         //
-        String log4jFile = configuration.getString(LOG4J_CONFIG_FILE,
-                                                   LOG4J_CONFIG_FILE_DEFAULT);
+        String log4jFile = 
configuration.getString(TurbineConstants.LOG4J_CONFIG_FILE,
+                                                   
TurbineConstants.LOG4J_CONFIG_FILE_DEFAULT);
 
         log4jFile = getRealPath(log4jFile);
 
@@ -327,7 +329,7 @@
         try
         {
             p.load(new FileInputStream(log4jFile));
-            p.setProperty(APPLICATION_ROOT_KEY, getApplicationRoot());
+            p.setProperty(TurbineConstants.APPLICATION_ROOT_KEY, 
getApplicationRoot());
             PropertyConfigurator.configure(p);
 
             //
@@ -357,10 +359,8 @@
         //
         // ${applicationRoot}
         // ${webappRoot}
-        configuration.setProperty(APPLICATION_ROOT_KEY, applicationRoot);
-        configuration.setProperty(WEBAPP_ROOT_KEY, webappRoot);
-
-
+        configuration.setProperty(TurbineConstants.APPLICATION_ROOT_KEY, 
applicationRoot);
+        configuration.setProperty(TurbineConstants.WEBAPP_ROOT_KEY, 
webappRoot);
 
                // Retrieve the pipeline class and then initialize it.  The 
pipeline
         // handles the processing of a webrequest/response cycle.
@@ -411,8 +411,8 @@
                                                  ServletConfig config)
     {
         String path = findInitParameter(context, config,
-                                        LOGGING_ROOT_KEY,
-                                        LOGGING_ROOT_DEFAULT);
+                                        TurbineConstants.LOGGING_ROOT_KEY,
+                                        TurbineConstants.LOGGING_ROOT_DEFAULT);
 
         File logDir = new File(getRealPath(path));
         if (!logDir.exists())
@@ -437,7 +437,7 @@
         String path = null;
 
         // Try the name as provided first.
-        boolean usingNamespace = name.startsWith(CONFIG_NAMESPACE);
+        boolean usingNamespace = 
name.startsWith(TurbineConstants.CONFIG_NAMESPACE);
         while (true)
         {
             path = config.getInitParameter(name);
@@ -454,7 +454,7 @@
                     else
                     {
                         // Try again using Turbine's namespace.
-                        name = CONFIG_NAMESPACE + '.' + name;
+                        name = TurbineConstants.CONFIG_NAMESPACE + '.' + name;
                         usingNamespace = true;
                         continue;
                     }
@@ -729,23 +729,25 @@
             data.setStackTrace(ExceptionUtils.getStackTrace(t), t);
 
             // setup the screen
-            data.setScreen(configuration.getString(SCREEN_ERROR_KEY,
-                    SCREEN_ERROR_DEFAULT));
+            data.setScreen(configuration.getString(
+                    TurbineConstants.SCREEN_ERROR_KEY,
+                    TurbineConstants.SCREEN_ERROR_DEFAULT));
 
             // do more screen setup for template execution if needed
             if (data.getTemplateInfo() != null)
             {
                 data.getTemplateInfo()
                     .setScreenTemplate(configuration.getString(
-                            TEMPLATE_ERROR_KEY, TEMPLATE_ERROR_VM));
+                            TurbineConstants.TEMPLATE_ERROR_KEY, 
+                            TurbineConstants.TEMPLATE_ERROR_VM));
             }
 
             // Make sure to not execute an action.
             data.setAction("");
 
             PageLoader.getInstance().exec(pipelineData,
-                    configuration.getString(PAGE_DEFAULT_KEY,
-                            PAGE_DEFAULT_DEFAULT));
+                    configuration.getString(TurbineConstants.PAGE_DEFAULT_KEY,
+                            TurbineConstants.PAGE_DEFAULT_DEFAULT));
 
             data.getResponse().setContentType(data.getContentType());
             data.getResponse().setStatus(data.getStatusCode());

Modified: 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultACLCreationValve.java
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultACLCreationValve.java?rev=725441&r1=725440&r2=725441&view=diff
==============================================================================
--- 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultACLCreationValve.java
 (original)
+++ 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultACLCreationValve.java
 Wed Dec 10 13:23:08 2008
@@ -40,7 +40,6 @@
  */
 public class DefaultACLCreationValve
     extends AbstractValve
-    implements TurbineConstants
 {
     protected AccessController accessController = null;
 
@@ -69,8 +68,9 @@
             // out the ACL to force it to be rebuilt based on more
             // information.
             ActionLoader.getInstance().exec(
-                    pipelineData, 
Turbine.getConfiguration().getString(ACTION_ACCESS_CONTROLLER_KEY,
-                            ACTION_ACCESS_CONTROLLER_DEFAULT));
+                    pipelineData, Turbine.getConfiguration().getString(
+                            TurbineConstants.ACTION_ACCESS_CONTROLLER_KEY,
+                            
TurbineConstants.ACTION_ACCESS_CONTROLLER_DEFAULT));
         }
         catch (Exception e)
         {

Modified: 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultLoginValve.java
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultLoginValve.java?rev=725441&r1=725440&r2=725441&view=diff
==============================================================================
--- 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultLoginValve.java 
(original)
+++ 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultLoginValve.java 
Wed Dec 10 13:23:08 2008
@@ -48,7 +48,6 @@
  */
 public class DefaultLoginValve
     extends AbstractValve
-    implements TurbineConstants
 {
     /**
      * Here we can setup objects that are thread safe and can be
@@ -97,9 +96,9 @@
         String actionName = data.getAction();
         if (data.hasAction() &&
             actionName.equalsIgnoreCase
-            (Turbine.getConfiguration().getString(ACTION_LOGIN_KEY)) ||
+            
(Turbine.getConfiguration().getString(TurbineConstants.ACTION_LOGIN_KEY)) ||
             actionName.equalsIgnoreCase
-            (Turbine.getConfiguration().getString(ACTION_LOGOUT_KEY)))
+            
(Turbine.getConfiguration().getString(TurbineConstants.ACTION_LOGOUT_KEY)))
         {
             // If a User is logging in, we should refresh the
             // session here.  Invalidating session and starting a
@@ -113,7 +112,7 @@
             // only keys stored in the session are "turbine.user"
             // and "turbine.acl".
             if (actionName.equalsIgnoreCase
-                (Turbine.getConfiguration().getString(ACTION_LOGIN_KEY)))
+                
(Turbine.getConfiguration().getString(TurbineConstants.ACTION_LOGIN_KEY)))
             {
                 Enumeration names = data.getSession().getAttributeNames();
                 if (names != null)

Modified: 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionTimeoutValve.java
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionTimeoutValve.java?rev=725441&r1=725440&r2=725441&view=diff
==============================================================================
--- 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionTimeoutValve.java
 (original)
+++ 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionTimeoutValve.java
 Wed Dec 10 13:23:08 2008
@@ -40,7 +40,6 @@
  */
 public class DefaultSessionTimeoutValve
     extends AbstractValve
-    implements TurbineConstants
 {
     protected int timeout;
 
@@ -55,8 +54,8 @@
 
         // Get the session timeout.
 
-       timeout = cfg.getInt(SESSION_TIMEOUT_KEY,
-                       SESSION_TIMEOUT_DEFAULT);
+       timeout = cfg.getInt(TurbineConstants.SESSION_TIMEOUT_KEY,
+                TurbineConstants.SESSION_TIMEOUT_DEFAULT);
 
     }
 
@@ -69,7 +68,7 @@
         RunData runData = (RunData)getRunData(pipelineData);
         // If the session is new take this opportunity to
         // set the session timeout if specified in TR.properties
-        if (runData.getSession().isNew() && timeout != SESSION_TIMEOUT_DEFAULT)
+        if (runData.getSession().isNew() && timeout != 
TurbineConstants.SESSION_TIMEOUT_DEFAULT)
         {
             runData.getSession().setMaxInactiveInterval(timeout);
         }

Modified: 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionValidationValve.java
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionValidationValve.java?rev=725441&r1=725440&r2=725441&view=diff
==============================================================================
--- 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionValidationValve.java
 (original)
+++ 
turbine/core/trunk/src/java/org/apache/turbine/pipeline/DefaultSessionValidationValve.java
 Wed Dec 10 13:23:08 2008
@@ -40,7 +40,6 @@
  */
 public class DefaultSessionValidationValve
     extends AbstractValve
-    implements TurbineConstants
 {
     protected SessionValidator sessionValidator = null;
 
@@ -68,8 +67,9 @@
             // TurbineResources.properties...screen.homepage; or, you
             // can specify your own SessionValidator action.
             ActionLoader.getInstance().exec(pipelineData,
-                    
Turbine.getConfiguration().getString(ACTION_SESSION_VALIDATOR_KEY,
-                            ACTION_SESSION_VALIDATOR_DEFAULT));
+                    Turbine.getConfiguration().getString(
+                            TurbineConstants.ACTION_SESSION_VALIDATOR_KEY,
+                            
TurbineConstants.ACTION_SESSION_VALIDATOR_DEFAULT));
         }
         catch (Exception e)
         {

Modified: turbine/core/trunk/src/test/org/apache/turbine/test/BaseTestCase.java
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/src/test/org/apache/turbine/test/BaseTestCase.java?rev=725441&r1=725440&r2=725441&view=diff
==============================================================================
--- turbine/core/trunk/src/test/org/apache/turbine/test/BaseTestCase.java 
(original)
+++ turbine/core/trunk/src/test/org/apache/turbine/test/BaseTestCase.java Wed 
Dec 10 13:23:08 2008
@@ -34,7 +34,7 @@
 import junit.framework.TestCase;
 
 import org.apache.log4j.PropertyConfigurator;
-import org.apache.turbine.Turbine;
+import org.apache.turbine.TurbineConstants;
 import org.apache.turbine.om.security.User;
 import org.apache.turbine.pipeline.PipelineData;
 import org.apache.turbine.services.TurbineServices;
@@ -66,7 +66,7 @@
         try
         {
             p.load(new FileInputStream(log4jFile));
-            p.setProperty(Turbine.APPLICATION_ROOT_KEY, new 
File(".").getAbsolutePath());
+            p.setProperty(TurbineConstants.APPLICATION_ROOT_KEY, new 
File(".").getAbsolutePath());
             PropertyConfigurator.configure(p);
 
         }


Reply via email to