continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcconn...@apache.org
Subject svn commit: r463421 - /maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
Date Thu, 12 Oct 2006 20:41:33 GMT
Author: jmcconnell
Date: Thu Oct 12 13:41:32 2006
New Revision: 463421

URL: http://svn.apache.org/viewvc?view=rev&rev=463421
Log:
add missing interceptor

Added:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
  (with props)

Added: 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=auto&rev=463421
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
Thu Oct 12 13:41:32 2006
@@ -0,0 +1,70 @@
+package org.apache.maven.continuum.web.interceptor;
+
+import com.opensymphony.xwork.ActionInvocation;
+import com.opensymphony.xwork.interceptor.Interceptor;
+import org.apache.maven.continuum.Continuum;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ForceContinuumConfigurationInterceptor:
+ *
+ * @author: Jesse McConnell <jmcconnell@apache.org>
+ * @version: $ID:$
+ * @plexus.component
+ *   role="com.opensymphony.xwork.interceptor.Interceptor"
+ *   role-hint="forceContinuumConfigurationInterceptor"
+ */
+public class ForceContinuumConfigurationInterceptor
+    extends AbstractLogEnabled
+    implements Interceptor
+{
+    private static boolean checked = false;
+
+    /**
+     * @plexus.requirement
+     */
+    private Continuum continuum;
+
+    public void destroy()
+    {
+        // no-op
+    }
+
+    public void init()
+    {
+
+    }
+
+    public String intercept( ActionInvocation invocation )
+        throws Exception
+    {
+        if ( checked )
+        {
+            return invocation.invoke();
+        }
+
+        if ( !continuum.getConfiguration().isInitialized() )
+        {
+            return "continuum-configuration-required";
+        }
+
+        checked = true;
+
+        return invocation.invoke();
+    }
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message