continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r640277 - in /continuum/branches/continuum-spring: ./ continuum-api/src/main/java/org/apache/maven/continuum/ continuum-commons/ continuum-core/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/test/java/org/apach...
Date Mon, 24 Mar 2008 00:19:22 GMT
Author: olamy
Date: Sun Mar 23 17:19:20 2008
New Revision: 640277

URL: http://svn.apache.org/viewvc?rev=640277&view=rev
Log:
start some job on the plexus-spring integration

Added:
    continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/
    continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/
    continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/
    continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
  (with props)
    continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
  (with props)
Modified:
    continuum/branches/continuum-spring/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/branches/continuum-spring/continuum-commons/pom.xml
    continuum/branches/continuum-spring/continuum-core/pom.xml
    continuum/branches/continuum-spring/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-spring/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    continuum/branches/continuum-spring/continuum-core/src/test/resources/log4j.properties
    continuum/branches/continuum-spring/continuum-test/pom.xml
    continuum/branches/continuum-spring/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
    continuum/branches/continuum-spring/continuum-webapp/pom.xml
    continuum/branches/continuum-spring/continuum-webapp/src/main/resources/webwork.properties
    continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/web.xml
    continuum/branches/continuum-spring/pom.xml

Modified: continuum/branches/continuum-spring/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ continuum/branches/continuum-spring/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Sun Mar 23 17:19:20 2008
@@ -624,4 +624,8 @@
     ProfileService getProfileService();
 
     BuildDefinitionService getBuildDefinitionService();
+    
+    
+    public void startup()
+        throws ContinuumException;
 }

Modified: continuum/branches/continuum-spring/continuum-commons/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-commons/pom.xml?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-commons/pom.xml (original)
+++ continuum/branches/continuum-spring/continuum-commons/pom.xml Sun Mar 23 17:19:20 2008
@@ -46,6 +46,11 @@
       <artifactId>continuum-test</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-spring</artifactId>
+      <scope>test</scope>
+    </dependency>    
   </dependencies>
   <build>
     <plugins>

Modified: continuum/branches/continuum-spring/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-core/pom.xml?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-core/pom.xml (original)
+++ continuum/branches/continuum-spring/continuum-core/pom.xml Sun Mar 23 17:19:20 2008
@@ -198,7 +198,16 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-log4j-logging</artifactId>
       <scope>test</scope>
-    </dependency>    
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-spring</artifactId>
+      <scope>test</scope>
+    </dependency>  
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>          
   </dependencies>
   <build>
     <plugins>

Modified: continuum/branches/continuum-spring/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/branches/continuum-spring/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Sun Mar 23 17:19:20 2008
@@ -102,7 +102,7 @@
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l </a>
  * @version $Id$
- * @plexus.component role="org.apache.maven.continuum.Continuum"
+ * @plexus.component role="org.apache.maven.continuum.Continuum" role-hint="default"
  */
 public class DefaultContinuum
     extends AbstractLogEnabled
@@ -2808,10 +2808,10 @@
     }
     
     public void stop()
-    throws StoppingException
-{
-    stopContinuum();
-}    
+        throws StoppingException
+    {
+        stopContinuum();
+    }
 
     private void closeStore()
     {
@@ -2822,6 +2822,19 @@
     }
 
 
+
+    public void startup()
+        throws ContinuumException
+    {
+        try
+        {
+            this.start();
+        }
+        catch ( StartingException e )
+        {
+            throw new ContinuumException( e.getMessage(), e );
+        }
+    }
 
     public void stopContinuum()
         throws StoppingException

Modified: continuum/branches/continuum-spring/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ continuum/branches/continuum-spring/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Sun Mar 23 17:19:20 2008
@@ -48,16 +48,7 @@
     public void testContinuumConfiguration()
         throws Exception
     {
-        try
-        {
-            lookup( Continuum.ROLE );
-        }
-        catch ( ComponentLookupException e )
-        {
-            e.printStackTrace();
-            throw e;
-        }
-
+        lookup( Continuum.ROLE );
     }
 
     public void testLookups()

Modified: continuum/branches/continuum-spring/continuum-core/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-core/src/test/resources/log4j.properties?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-core/src/test/resources/log4j.properties
(original)
+++ continuum/branches/continuum-spring/continuum-core/src/test/resources/log4j.properties
Sun Mar 23 17:19:20 2008
@@ -22,7 +22,7 @@
 log4j.appender.console.layout=org.apache.log4j.PatternLayout
 log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
 
-log4j.rootCategory=DEBUG, console
+log4j.rootCategory=INFO, console
 
 # JPOX Categories
 log4j.category.JPOX=WARN, console

Modified: continuum/branches/continuum-spring/continuum-test/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-test/pom.xml?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-test/pom.xml (original)
+++ continuum/branches/continuum-spring/continuum-test/pom.xml Sun Mar 23 17:19:20 2008
@@ -25,5 +25,10 @@
       <groupId>org.apache.continuum</groupId>
       <artifactId>continuum-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-spring</artifactId>
+      <scope>compile</scope>
+    </dependency>    
   </dependencies>
 </project>

Modified: continuum/branches/continuum-spring/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
(original)
+++ continuum/branches/continuum-spring/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
Sun Mar 23 17:19:20 2008
@@ -19,6 +19,16 @@
  * under the License.
  */
 
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.jdo.PersistenceManager;
+import javax.jdo.PersistenceManagerFactory;
+
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
@@ -30,26 +40,17 @@
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
 import org.codehaus.plexus.jdo.JdoFactory;
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.jpox.SchemaTool;
 
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
  */
 public abstract class AbstractContinuumTest
-    extends PlexusTestCase
+    extends PlexusInSpringTestCase
 {
     private ContinuumStore store;
 

Modified: continuum/branches/continuum-spring/continuum-webapp/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-webapp/pom.xml?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-webapp/pom.xml (original)
+++ continuum/branches/continuum-spring/continuum-webapp/pom.xml Sun Mar 23 17:19:20 2008
@@ -508,7 +508,16 @@
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-spring</artifactId>
+    </dependency>    
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-mail-sender-javamail</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+      <version>2.5.1</version>
     </dependency>
     <dependency>
       <groupId>javax.mail</groupId>

Added: continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java?rev=640277&view=auto
==============================================================================
--- continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
(added)
+++ continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
Sun Mar 23 17:19:20 2008
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+package org.apache.continuum.web.startup;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.ContinuumException;
+import org.codehaus.plexus.spring.PlexusToSpringUtils;
+import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ * @since 15 mars 2008
+ * @version $Id$
+ */
+public class ContinuumStartup
+    implements ServletContextListener
+{
+
+    private Logger log = LoggerFactory.getLogger( getClass() );
+    
+    /** 
+     * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
+     */
+    public void contextDestroyed( ServletContextEvent sce )
+    {
+        // nothing to do here
+
+    }
+
+    /** 
+     * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
+     */
+    public void contextInitialized( ServletContextEvent sce )
+    {
+        WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(
sce
+            .getServletContext() );
+
+        // to simulate Plexus load on start with Spring
+        /*
+        Continuum continuum = (Continuum) wac.getBean( PlexusToSpringUtils.buildSpringId(
Continuum.class ) );
+
+        TaskQueueExecutor buildProject = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
+            .buildSpringId( TaskQueueExecutor.class, "build-project" ) );
+
+        TaskQueueExecutor checkOutProject = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
+            .buildSpringId( TaskQueueExecutor.class, "check-out-project" ) );
+
+        TaskQueueExecutor prepareRelease = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
+            .buildSpringId( TaskQueueExecutor.class, "prepare-release" ) );
+
+        TaskQueueExecutor performRelease = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
+            .buildSpringId( TaskQueueExecutor.class, "perform-release" ) );
+
+        TaskQueueExecutor rollbackRelease = (TaskQueueExecutor) wac.getBean( PlexusToSpringUtils
+            .buildSpringId( TaskQueueExecutor.class, "rollback-release" ) );        
+        */
+        /*
+        try
+        {
+            continuum.startup();
+        }
+        catch ( ContinuumException e )
+        {
+            log.error( e.getMessage(), e );
+            throw new RuntimeException( e.getMessage(), e );
+        }*/
+    }
+
+}

Propchange: continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/branches/continuum-spring/continuum-webapp/src/main/java/org/apache/continuum/web/startup/ContinuumStartup.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Mar 23 17:19:20 2008
@@ -0,0 +1 @@
+URL HeadURL Author LastChangedBy Date LastChangedDate Rev Revision LastChangedRevision Id

Modified: continuum/branches/continuum-spring/continuum-webapp/src/main/resources/webwork.properties
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-webapp/src/main/resources/webwork.properties?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-webapp/src/main/resources/webwork.properties
(original)
+++ continuum/branches/continuum-spring/continuum-webapp/src/main/resources/webwork.properties
Sun Mar 23 17:19:20 2008
@@ -17,7 +17,8 @@
 # under the License.
 #
 
-webwork.objectFactory = org.codehaus.plexus.xwork.PlexusObjectFactory
+webwork.objectFactory = org.codehaus.plexus.spring.WebWorkPlexusInSpringObjectFactory
+#org.codehaus.plexus.xwork.PlexusObjectFactory
 #webwork.tag.altSyntax = true
 
 # Theme

Added: continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml?rev=640277&view=auto
==============================================================================
--- continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
(added)
+++ continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
Sun Mar 23 17:19:20 2008
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+  <bean id="loggerManager" class="org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager"
+    init-method="initialize"/>
+
+</beans>

Propchange: continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/web.xml?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ continuum/branches/continuum-spring/continuum-webapp/src/main/webapp/WEB-INF/web.xml Sun
Mar 23 17:19:20 2008
@@ -66,8 +66,28 @@
   </filter-mapping>
 
   <listener>
-    <listener-class>org.codehaus.plexus.xwork.PlexusLifecycleListener</listener-class>
+    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
   </listener>
+  <listener>
+    <!-- TODO: some Spring technique for this? -->
+  	<listener-class>org.apache.continuum.web.startup.ContinuumStartup</listener-class>
+  </listener>
+
+  <context-param>
+    <param-name>contextClass</param-name>
+    <param-value>org.codehaus.plexus.spring.PlexusWebApplicationContext</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>contextConfigLocation</param-name>
+    <param-value>
+        classpath*:/META-INF/plexus/components.xml
+        classpath*:/META-INF/spring-context.xml
+        /WEB-INF/classes/META-INF/plexus/application.xml
+        /WEB-INF/classes/META-INF/plexus/components.xml
+        /WEB-INF/applicationContext.xml
+    </param-value>
+  </context-param>
 
   <servlet>
     <servlet-name>XmlRpcServlet</servlet-name>

Modified: continuum/branches/continuum-spring/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-spring/pom.xml?rev=640277&r1=640276&r2=640277&view=diff
==============================================================================
--- continuum/branches/continuum-spring/pom.xml (original)
+++ continuum/branches/continuum-spring/pom.xml Sun Mar 23 17:19:20 2008
@@ -147,11 +147,20 @@
       <releases>
         <enabled>false</enabled>
       </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
     </repository>
     <repository>
       <id>maven2-repository.dev.java.net</id>
       <name>Java.net Repository for Maven</name>
       <url>http://download.java.net/maven/2/</url>
+      <releases>
+        <enabled>true</enabled>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>      
     </repository>
     <!-- comment when parent is released -->
     <repository>
@@ -161,6 +170,9 @@
       <releases>
         <enabled>false</enabled>
       </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>      
     </repository>
   </repositories>
   <!--
@@ -641,7 +653,7 @@
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-taskqueue</artifactId>
-        <version>1.0-alpha-7</version>
+        <version>1.0-alpha-8-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>org.apache.derby</groupId>
@@ -746,6 +758,11 @@
         <groupId>commons-httpclient</groupId>
         <artifactId>commons-httpclient</artifactId>
         <version>3.1</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-spring</artifactId>
+        <version>1.0-SNAPSHOT</version>
       </dependency>
     </dependencies>
   </dependencyManagement>



Mime
View raw message