continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcconn...@apache.org
Subject svn commit: r505536 - /maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
Date Fri, 09 Feb 2007 22:35:51 GMT
Author: jmcconnell
Date: Fri Feb  9 14:35:50 2007
New Revision: 505536

URL: http://svn.apache.org/viewvc?view=rev&rev=505536
Log:
changed the flow of the initialization of the system configuration to make sure that it tries
to load the system config from the database if it is not initialized, this should cover instances
where the back end database has been restored.

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java?view=diff&rev=505536&r1=505535&r2=505536
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
Fri Feb  9 14:35:50 2007
@@ -22,6 +22,7 @@
 import com.opensymphony.xwork.ActionInvocation;
 import com.opensymphony.xwork.interceptor.Interceptor;
 import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
@@ -54,6 +55,16 @@
 
     }
 
+    /**
+     * 1) check to see if this interceptor has been successfully executed
+     * 2) check if the configuration service is initialized
+     * 3) load the configuration and see if that is initialized (addresses restore on empty
db)
+     * 4) force the configuration screen
+     *
+     * @param invocation
+     * @return
+     * @throws Exception
+     */
     public String intercept( ActionInvocation invocation )
         throws Exception
     {
@@ -62,13 +73,25 @@
             return invocation.invoke();
         }
 
-        if ( !continuum.getConfiguration().isInitialized() )
+        ConfigurationService configuration = continuum.getConfiguration();
+
+        if ( configuration.isInitialized() )
         {
-            return "continuum-configuration-required";
+            checked = true;
+            return invocation.invoke();
         }
 
-        checked = true;
+        configuration.load();
+
+        if ( configuration.isInitialized() )
+        {
+            checked = true;
+            return invocation.invoke();
+        }
+        else
+        {
+            return "continuum-configuration-required";
+        }
 
-        return invocation.invoke();
     }
 }



Mime
View raw message