Author: trygvis
Date: Sat May  7 05:05:40 2005
New Revision: 169074

URL: http://svn.apache.org/viewcvs?rev=169074&view=rev
Log:
Fixing CONTINUUM-92: 
  Remove the direct usage of ContinuumStore in the xml-rpc interface

Modified:
    
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
    
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    
maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
    
maven/continuum/trunk/continuum-xmlrpc/src/main/resources/META-INF/plexus/components.xml

Modified: 
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
URL: 
http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java?rev=169074&r1=169073&r2=169074&view=diff
==============================================================================
--- 
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
 (original)
+++ 
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/Continuum.java
 Sat May  7 05:05:40 2005
@@ -18,8 +18,8 @@
 
 import java.net.URL;
 import java.util.Iterator;
-import java.util.Properties;
 import java.util.List;
+import java.util.Properties;
 
 import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
@@ -29,6 +29,7 @@
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
 import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.apache.maven.continuum.scm.CheckOutScmResult;
 
 /**
  * This is the main entry point for Continuum. Projects are added to Continuum
@@ -74,6 +75,9 @@
         throws ContinuumException;
 
     Iterator getAllProjects( int start, int end )
+        throws ContinuumException;
+
+    CheckOutScmResult getCheckOutScmResultForProject( String projectId )
         throws ContinuumException;
 
     void buildProject( String projectId, boolean force )

Modified: 
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: 
http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=169074&r1=169073&r2=169074&view=diff
==============================================================================
--- 
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
 (original)
+++ 
maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
 Sat May  7 05:05:40 2005
@@ -40,6 +40,7 @@
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
+import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.ContinuumScm;
 import org.apache.maven.continuum.scm.ContinuumScmException;
 import org.apache.maven.continuum.scm.queue.CheckOutTask;
@@ -91,7 +92,7 @@
     /** @requirement */
     private ContinuumScm scm;
 
-    /** @configuration */
+    /** @requirement */
     private String appHome;
 
     /** @configuration */
@@ -181,7 +182,7 @@
 
         ContinuumProject project = builder.createProjectFromMetadata( url );
 
-        getLogger().info( "done creating continuum project" );
+        getLogger().info( "Done creating continuum project" );
 
         // TODO: Update from metadata in the initial checkout?
 
@@ -221,7 +222,7 @@
         // stuff out
         // 
----------------------------------------------------------------------
 
-        if( !builderManager.hasBuilder( builderType ) )
+        if ( !builderManager.hasBuilder( builderType ) )
         {
             throw new ContinuumException( "No such builder '" + builderType + 
"'." );
         }
@@ -258,7 +259,8 @@
 
                 if ( !workingDirectory.exists() )
                 {
-                    throw new ContinuumException( "Could not make missing 
working directory for project '" + project.getName() + "'." );
+                    throw new ContinuumException( "Could not make missing 
working directory for " +
+                                                  "project '" + 
project.getName() + "'." );
                 }
             }
 
@@ -339,6 +341,19 @@
         }
     }
 
+    public CheckOutScmResult getCheckOutScmResultForProject( String projectId )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getCheckOutScmResultForProject( projectId );
+        }
+        catch ( ContinuumStoreException ex )
+        {
+            throw logAndCreateException( "Exception while getting check out 
scm result for project.", ex );
+        }
+    }
+
     public void buildProject( String projectId, boolean force )
         throws ContinuumException
     {
@@ -671,12 +686,12 @@
             // Set the working directory
             // 
----------------------------------------------------------------------
 
-
             projectWorkingDirectory = new File( workingDirectory, projectId );
 
             if ( !projectWorkingDirectory.exists() && 
!projectWorkingDirectory.mkdirs() )
             {
-                throw new ContinuumException( "Could not make the working 
directory for the project (" + projectWorkingDirectory.getAbsolutePath() + ")." 
);
+                throw new ContinuumException( "Could not make the working 
directory for the project " +
+                                              "'" + 
projectWorkingDirectory.getAbsolutePath() + "'." );
             }
 
             project.setWorkingDirectory( 
projectWorkingDirectory.getAbsolutePath() );
@@ -726,7 +741,8 @@
         {
             if ( !checkoutDirectory.mkdirs() )
             {
-                throw logAndCreateException( "Could not make the check out 
directory (" + checkoutDirectory.getAbsolutePath() + ")." );
+                throw logAndCreateException( "Could not make the check out 
directory " +
+                                             "'" + 
checkoutDirectory.getAbsolutePath() + "'." );
             }
         }
 
@@ -735,7 +751,7 @@
 
         try
         {
-            scm.checkOut( project, checkoutDirectory);
+            scm.checkOut( project, checkoutDirectory );
         }
         catch ( ContinuumScmException e )
         {
@@ -793,14 +809,16 @@
         {
             if ( !wdFile.isDirectory() )
             {
-                throw logAndCreateException( "The specified working directory 
isn't a directory: " + wdFile.getAbsolutePath() );
+                throw logAndCreateException( "The specified working directory 
isn't a directory: " +
+                                             "'" + wdFile.getAbsolutePath() + 
"'." );
             }
         }
         else
         {
             if ( !wdFile.mkdirs() )
             {
-                throw logAndCreateException( "Could not making the working 
directory: " + wdFile.getAbsolutePath() );
+                throw logAndCreateException( "Could not making the working 
directory: " +
+                                             "'" + wdFile.getAbsolutePath() + 
"'." );
             }
         }
 

Modified: 
maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
URL: 
http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java?rev=169074&r1=169073&r2=169074&view=diff
==============================================================================
--- 
maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
 (original)
+++ 
maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
 Sat May  7 05:05:40 2005
@@ -35,7 +35,6 @@
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.UpdateScmResult;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.utils.ContinuumUtils;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -52,9 +51,6 @@
     private Continuum continuum;
 
     /** @requirement */
-    private ContinuumStore store;
-
-    /** @requirement */
     private XmlRpcHelper xmlRpcHelper;
 
     // ----------------------------------------------------------------------
@@ -178,7 +174,7 @@
 
             excludedProperties.add( "configuration" );
 
-            ContinuumProject project = store.getProject( projectId );
+            ContinuumProject project = continuum.getProject( projectId );
 
             Hashtable hashtable = xmlRpcHelper.objectToHashtable( project, 
excludedProperties );
 
@@ -195,7 +191,7 @@
 
             hashtable.put( "configuration", configurationHashtable );
 
-            CheckOutScmResult result = store.getCheckOutScmResultForProject( 
projectId );
+            CheckOutScmResult result = 
continuum.getCheckOutScmResultForProject( projectId );
 
             if ( result != null )
             {
@@ -253,7 +249,7 @@
         {
             Vector projects = new Vector();
 
-            for ( Iterator it = store.getAllProjects(); it.hasNext(); )
+            for ( Iterator it = continuum.getAllProjects( 0, 0 ); 
it.hasNext(); )
             {
                 ContinuumProject project = (ContinuumProject) it.next();
 
@@ -272,7 +268,7 @@
     {
         try
         {
-            store.removeProject( projectId );
+            continuum.removeProject( projectId );
 
             return makeHashtable();
         }
@@ -304,7 +300,8 @@
     {
         try
         {
-            Iterator it = store.getBuildsForProject( projectId, start, end );
+            // TODO: use start and end
+            Iterator it = continuum.getBuildsForProject( projectId );
 
             Vector builds = new Vector();
 
@@ -340,7 +337,7 @@
     {
         try
         {
-            ContinuumBuild continuumBuild = store.getBuild( buildId );
+            ContinuumBuild continuumBuild = continuum.getBuild( buildId );
 
             Set excludedProperties = new HashSet();
 
@@ -368,7 +365,7 @@
     {
         try
         {
-            ContinuumBuildResult result = store.getBuildResultForBuild( 
buildId );
+            ContinuumBuildResult result = continuum.getBuildResultForBuild( 
buildId );
 
             Set excludedProperties = new HashSet();
 
@@ -406,8 +403,6 @@
 
     private Hashtable handleException( String method, Throwable throwable )
     {
-//        getLogger().error( "Error while executing '" + method + "'.", 
throwable );
-
         Hashtable hashtable = new Hashtable();
 
         hashtable.put( "result", "failure" );

Modified: 
maven/continuum/trunk/continuum-xmlrpc/src/main/resources/META-INF/plexus/components.xml
URL: 
http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/resources/META-INF/plexus/components.xml?rev=169074&r1=169073&r2=169074&view=diff
==============================================================================
--- 
maven/continuum/trunk/continuum-xmlrpc/src/main/resources/META-INF/plexus/components.xml
 (original)
+++ 
maven/continuum/trunk/continuum-xmlrpc/src/main/resources/META-INF/plexus/components.xml
 Sat May  7 05:05:40 2005
@@ -9,9 +9,6 @@
           <role>org.apache.maven.continuum.Continuum</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
-        </requirement>
-        <requirement>
           <role>org.apache.maven.continuum.xmlrpc.XmlRpcHelper</role>
         </requirement>
       </requirements>


Reply via email to