continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r771177 [1/2] - in /continuum/branches/continuum-1.3.x/continuum-core/src: main/java/org/apache/maven/continuum/ main/java/org/apache/maven/continuum/buildcontroller/ main/java/org/apache/maven/continuum/core/action/ main/java/org/apache/ma...
Date Mon, 04 May 2009 05:02:39 GMT
Author: evenisse
Date: Mon May  4 05:02:26 2009
New Revision: 771177

URL: http://svn.apache.org/viewvc?rev=771177&view=rev
Log:
Remove actions  public constants in favor of typed method

Modified:
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Mon May  4 05:02:26 2009
@@ -66,7 +66,9 @@
 import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
 import org.apache.maven.continuum.core.action.CreateProjectsFromMetadataAction;
+import org.apache.maven.continuum.core.action.StoreProjectAction;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.initialization.ContinuumInitializationException;
@@ -413,7 +415,7 @@
             log.info( "Remove project group " + projectGroup.getName() + "(" + projectGroup.getId() + ")" );
 
             Map<String, Object> context = new HashMap<String, Object>();
-            context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+            AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
             executeAction( "remove-assignable-roles", context );
 
             projectGroupDao.removeProjectGroup( projectGroup );
@@ -451,7 +453,7 @@
                                                                                  buildDefinitionService.getDefaultMavenTwoBuildDefinitionTemplate() );
 
                 Map<String, Object> context = new HashMap<String, Object>();
-                context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, new_pg.getId() );
+                AbstractContinuumAction.setProjectGroupId( context, new_pg.getId() );
                 executeAction( "add-assignable-roles", context );
 
                 log.info( "Added new project group: " + new_pg.getName() );
@@ -691,12 +693,12 @@
     {
         Map<String, Object> context = new HashMap<String, Object>();
 
-        context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+        AbstractContinuumAction.setProjectId( context, projectId );
 
         try
         {
             BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition( projectId );
-            context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+            AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
 
             executeAction( "add-project-to-checkout-queue", context );
         }
@@ -1347,13 +1349,13 @@
         //
         // ----------------------------------------------------------------------
 
-        context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+        AbstractContinuumAction.setWorkingDirectory( context, getWorkingDirectory() );
 
-        context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
+        AbstractContinuumAction.setUnvalidatedProject( context, project );
 
-        context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
+        AbstractContinuumAction.setUnvalidatedProjectGroup( context, projectGroup );
 
-        context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+        AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
 
         executeAction( "validate-project", context );
 
@@ -1388,7 +1390,7 @@
             }
 
             buildDefinitionService.addTemplateInProject( bdt.getId(), getProject(
-                (Integer) context.get( AbstractContinuumAction.KEY_PROJECT_ID ) ) );
+                AbstractContinuumAction.getProjectId( context ) ) );
         }
         catch ( BuildDefinitionServiceException e )
         {
@@ -1398,15 +1400,16 @@
         if ( !configurationService.isDistributedBuildEnabled() )
         {
             // used by BuildManager to determine on which build queue will the project be put
-            context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, getProjectWithBuildDetails(
-                (Integer) context.get( AbstractContinuumAction.KEY_PROJECT_ID ) ).getBuildDefinitions().get( 0 ) );
+            BuildDefinition bd = (BuildDefinition) getProjectWithBuildDetails(
+                AbstractContinuumAction.getProjectId( context ) ).getBuildDefinitions().get( 0 );
+            AbstractContinuumAction.setBuildDefinition( context, bd );
 
             executeAction( "add-project-to-checkout-queue", context );
         }
 
         executeAction( "add-assignable-roles", context );
 
-        return (Integer) context.get( AbstractContinuumAction.KEY_PROJECT_ID );
+        return AbstractContinuumAction.getProjectId( context );
     }
 
     private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
@@ -1443,23 +1446,24 @@
 
         Map<String, Object> context = new HashMap<String, Object>();
 
-        context.put( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, projectBuilderId );
+        CreateProjectsFromMetadataAction.setProjectBuilderId( context, projectBuilderId );
 
-        context.put( CreateProjectsFromMetadataAction.KEY_URL, metadataUrl );
+        CreateProjectsFromMetadataAction.setUrl( context, metadataUrl );
 
-        context.put( CreateProjectsFromMetadataAction.KEY_LOAD_RECURSIVE_PROJECTS, loadRecursiveProjects );
+        CreateProjectsFromMetadataAction.setLoadRecursiveProject( context, loadRecursiveProjects );
 
-        context.put( CreateProjectsFromMetadataAction.KEY_SCM_USE_CREDENTIALS_CACHE, useCredentialsCache );
+        StoreProjectAction.setUseScmCredentialsCache( context, useCredentialsCache );
 
-        context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+        AbstractContinuumAction.setWorkingDirectory( context, getWorkingDirectory() );
 
         // CreateProjectsFromMetadataAction will check null and use default
         if ( buildDefinitionTemplateId > 0 )
         {
             try
             {
-                context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_TEMPLATE,
-                             buildDefinitionService.getBuildDefinitionTemplate( buildDefinitionTemplateId ) );
+                AbstractContinuumAction.setBuildDefinitionTemplate( context,
+                                                                    buildDefinitionService.getBuildDefinitionTemplate(
+                                                                        buildDefinitionTemplateId ) );
             }
             catch ( BuildDefinitionServiceException e )
             {
@@ -1472,9 +1476,7 @@
 
         executeAction( "create-projects-from-metadata", context );
 
-        ContinuumProjectBuildingResult result =
-            (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT )
-            ;
+        ContinuumProjectBuildingResult result = CreateProjectsFromMetadataAction.getProjectBuildingResult( context );
 
         if ( log.isInfoEnabled() )
         {
@@ -1534,9 +1536,9 @@
 
                     Map<String, Object> pgContext = new HashMap<String, Object>();
 
-                    pgContext.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, getWorkingDirectory() );
+                    AbstractContinuumAction.setWorkingDirectory( pgContext, getWorkingDirectory() );
 
-                    pgContext.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT_GROUP, projectGroup );
+                    AbstractContinuumAction.setUnvalidatedProjectGroup( pgContext, projectGroup );
 
                     executeAction( "validate-project-group", pgContext );
 
@@ -1550,7 +1552,7 @@
 
             projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
 
-            String url = (String) context.get( CreateProjectsFromMetadataAction.KEY_URL );
+            String url = CreateProjectsFromMetadataAction.getUrl( context );
 
             projectScmRoot = getProjectScmRootByProjectGroupAndScmRootAddress( projectGroup.getId(), url );
 
@@ -1611,28 +1613,28 @@
                                                                  projectDao.getProject( project.getId() ) );
                 }
 
-                context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
+                AbstractContinuumAction.setUnvalidatedProject( context, project );
                 //
                 //            executeAction( "validate-project", context );
                 //
                 //            executeAction( "store-project", context );
                 //
-                context.put( AbstractContinuumAction.KEY_PROJECT_ID, project.getId() );
+                AbstractContinuumAction.setProjectId( context, project.getId() );
 
                 if ( !StringUtils.isEmpty( scmUserName ) )
                 {
                     project.setScmUsername( scmUserName );
-                    context.put( AbstractContinuumAction.KEY_SCM_USERNAME, scmUserName );
+                    CheckoutProjectContinuumAction.setScmUsername( context, scmUserName );
                 }
                 if ( !StringUtils.isEmpty( scmPassword ) )
                 {
                     project.setScmPassword( scmPassword );
-                    context.put( AbstractContinuumAction.KEY_SCM_PASSWORD, scmPassword );
+                    CheckoutProjectContinuumAction.setScmPassword( context, scmPassword );
                 }
                 // FIXME
                 // olamy  : read again the project to have values because store.updateProjectGroup( projectGroup );
                 // remove object data -> we don't display the project name in the build queue
-                context.put( AbstractContinuumAction.KEY_PROJECT, projectDao.getProject( project.getId() ) );
+                AbstractContinuumAction.setProject( context, projectDao.getProject( project.getId() ) );
 
                 BuildDefinition defaultBuildDefinition = null;
                 if ( projectBuilderId.equals( MavenTwoContinuumProjectBuilder.ID ) )
@@ -1649,7 +1651,7 @@
                 }
 
                 // used by BuildManager to determine on which build queue will the project be put
-                context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, defaultBuildDefinition );
+                AbstractContinuumAction.setBuildDefinition( context, defaultBuildDefinition );
 
                 if ( !configurationService.isDistributedBuildEnabled() )
                 {
@@ -1667,7 +1669,7 @@
             throw new ContinuumException( "Error adding projects from modules", e );
         }
 
-        context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+        AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
         // add the relevent security administration roles for this project
         if ( addAssignableRoles )
         {
@@ -2006,12 +2008,12 @@
     {
         HashMap<String, Object> context = new HashMap<String, Object>();
 
-        context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
-        context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+        AbstractContinuumAction.setProjectId( context, projectId );
 
         executeAction( "add-build-definition-to-project", context );
 
-        return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION );
+        return AbstractContinuumAction.getBuildDefinition( context );
     }
 
     public void removeBuildDefinitionFromProject( int projectId, int buildDefinitionId )
@@ -2019,8 +2021,8 @@
     {
         HashMap<String, Object> context = new HashMap<String, Object>();
 
-        context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, getBuildDefinition( buildDefinitionId ) );
-        context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+        AbstractContinuumAction.setBuildDefinition( context, getBuildDefinition( buildDefinitionId ) );
+        AbstractContinuumAction.setProjectId( context, projectId );
 
         executeAction( "remove-build-definition-from-project", context );
     }
@@ -2030,12 +2032,12 @@
     {
         HashMap<String, Object> context = new HashMap<String, Object>();
 
-        context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
-        context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+        AbstractContinuumAction.setProjectId( context, projectId );
 
         executeAction( "update-build-definition-from-project", context );
 
-        return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION );
+        return AbstractContinuumAction.getBuildDefinition( context );
     }
 
     public BuildDefinition addBuildDefinitionToProjectGroup( int projectGroupId, BuildDefinition buildDefinition )
@@ -2043,12 +2045,12 @@
     {
         HashMap<String, Object> context = new HashMap<String, Object>();
 
-        context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
-        context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroupId );
+        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+        AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
 
         executeAction( "add-build-definition-to-project-group", context );
 
-        return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION );
+        return AbstractContinuumAction.getBuildDefinition( context );
     }
 
     public void removeBuildDefinitionFromProjectGroup( int projectGroupId, int buildDefinitionId )
@@ -2056,8 +2058,8 @@
     {
         HashMap<String, Object> context = new HashMap<String, Object>();
 
-        context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, getBuildDefinition( buildDefinitionId ) );
-        context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroupId );
+        AbstractContinuumAction.setBuildDefinition( context, getBuildDefinition( buildDefinitionId ) );
+        AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
 
         executeAction( "remove-build-definition-from-project-group", context );
     }
@@ -2067,12 +2069,12 @@
     {
         HashMap<String, Object> context = new HashMap<String, Object>();
 
-        context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
-        context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, projectGroupId );
+        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
+        AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
 
         executeAction( "update-build-definition-from-project-group", context );
 
-        return (BuildDefinition) context.get( AbstractContinuumAction.KEY_BUILD_DEFINITION );
+        return AbstractContinuumAction.getBuildDefinition( context );
     }
 
     public void removeBuildDefinition( int projectId, int buildDefinitionId )

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java Mon May  4 05:02:26 2009
@@ -32,6 +32,7 @@
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.utils.ContinuumUtils;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.ExecuteBuilderContinuumAction;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
@@ -163,7 +164,7 @@
 
             performAction( "deploy-artifact", context );
 
-            context.setCancelled( (Boolean) actionContext.get( AbstractContinuumAction.KEY_CANCELLED ) );
+            context.setCancelled( ExecuteBuilderContinuumAction.isCancelled( actionContext ) );
 
             String s = AbstractContinuumAction.getBuildId( actionContext, null );
 
@@ -366,23 +367,21 @@
 
         Map<String, Object> actionContext = context.getActionContext();
 
-        actionContext.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+        AbstractContinuumAction.setProjectId( actionContext, projectId );
 
-        actionContext.put( AbstractContinuumAction.KEY_PROJECT, context.getProject() );
+        AbstractContinuumAction.setProject( actionContext, context.getProject() );
 
-        actionContext.put( AbstractContinuumAction.KEY_BUILD_DEFINITION_ID, buildDefinitionId );
+        AbstractContinuumAction.setBuildDefinitionId( actionContext, buildDefinitionId );
 
-        actionContext.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, context.getBuildDefinition() );
+        AbstractContinuumAction.setBuildDefinition( actionContext, context.getBuildDefinition() );
 
-        actionContext.put( AbstractContinuumAction.KEY_TRIGGER, trigger );
+        AbstractContinuumAction.setTrigger( actionContext, trigger );
 
-        actionContext.put( AbstractContinuumAction.KEY_FIRST_RUN, context.getOldBuildResult() == null );
-
-        actionContext.put( AbstractContinuumAction.KEY_SCM_RESULT, context.getScmResult() );
+        AbstractContinuumAction.setScmResult( actionContext, context.getScmResult() );
 
         if ( context.getOldBuildResult() != null )
         {
-            actionContext.put( AbstractContinuumAction.KEY_OLD_BUILD_ID, context.getOldBuildResult().getId() );
+            AbstractContinuumAction.setOldBuildId( actionContext, context.getOldBuildResult().getId() );
         }
 
         return context;
@@ -653,7 +652,7 @@
             }
 
             context.setModifiedDependencies( modifiedDependencies );
-            context.getActionContext().put( AbstractContinuumAction.KEY_UPDATE_DEPENDENCIES, modifiedDependencies );
+            AbstractContinuumAction.setUpdatedDependencies( context.getActionContext(), modifiedDependencies );
         }
         catch ( ContinuumStoreException e )
         {

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java Mon May  4 05:02:26 2009
@@ -43,61 +43,43 @@
     // Keys for the values that can be in the context
     // ----------------------------------------------------------------------
 
-    public static final String KEY_PROJECT_ID = "project-id";
+    private static final String KEY_PROJECT_ID = "project-id";
 
-    public static final String KEY_PROJECT = "project";
+    private static final String KEY_PROJECT = "project";
 
-    public static final String KEY_PROJECTS = "projects";
+    private static final String KEY_PROJECTS = "projects";
 
-    public static final String KEY_PROJECTS_BUILD_DEFINITIONS_MAP = "projects-build-definitions";
+    private static final String KEY_PROJECTS_BUILD_DEFINITIONS_MAP = "projects-build-definitions";
 
-    public static final String KEY_BUILD_DEFINITION_TEMPLATE = "build-definition-template";
+    private static final String KEY_BUILD_DEFINITION_TEMPLATE = "build-definition-template";
 
-    public static final String KEY_BUILD_DEFINITION = "build-definition";
+    private static final String KEY_BUILD_DEFINITION = "build-definition";
 
-    public static final String KEY_BUILD_DEFINITION_ID = "build-definition-id";
+    private static final String KEY_BUILD_DEFINITION_ID = "build-definition-id";
 
-    public static final String KEY_UNVALIDATED_PROJECT = "unvalidated-project";
+    private static final String KEY_UNVALIDATED_PROJECT = "unvalidated-project";
 
-    public static final String KEY_PROJECT_GROUP_ID = "project-group-id";
+    private static final String KEY_PROJECT_GROUP_ID = "project-group-id";
 
-    public static final String KEY_UNVALIDATED_PROJECT_GROUP = "unvalidated-project-group";
+    private static final String KEY_UNVALIDATED_PROJECT_GROUP = "unvalidated-project-group";
 
-    public static final String KEY_BUILD_ID = "build-id";
+    private static final String KEY_BUILD_ID = "build-id";
 
-    public static final String KEY_WORKING_DIRECTORY = "working-directory";
+    private static final String KEY_WORKING_DIRECTORY = "working-directory";
 
-    public static final String KEY_WORKING_DIRECTORY_EXISTS = "working-directory-exists";
+    private static final String KEY_UPDATE_DEPENDENCIES = "update-dependencies";
 
-    public static final String KEY_CHECKOUT_SCM_RESULT = "checkout-result";
+    private static final String KEY_TRIGGER = "trigger";
 
-    public static final String KEY_UPDATE_SCM_RESULT = "update-result";
+    private static final String KEY_SCM_RESULT = "scmResult";
 
-    public static final String KEY_UPDATE_DEPENDENCIES = "update-dependencies";
+    private static final String KEY_OLD_SCM_RESULT = "old-scmResult";
 
-    public static final String KEY_TRIGGER = "trigger";
+    private static final String KEY_PROJECT_SCM_ROOT = "projectScmRoot";
 
-    public static final String KEY_FIRST_RUN = "first-run";
+    private static final String KEY_OLD_BUILD_ID = "old-buildResult-id";
 
-    public static final String KEY_PROJECT_RELATIVE_PATH = "project-relative-path";
-
-    public static final String KEY_SCM_USE_CREDENTIALS_CACHE = "useCredentialsCache";
-
-    public static final String KEY_SCM_USERNAME = "scmUserName";
-
-    public static final String KEY_SCM_PASSWORD = "scmUserPassword";
-
-    public static final String KEY_SCM_RESULT = "scmResult";
-
-    public static final String KEY_OLD_SCM_RESULT = "old-scmResult";
-
-    public static final String KEY_PROJECT_SCM_ROOT = "projectScmRoot";
-
-    public static final String KEY_OLD_BUILD_ID = "old-buildResult-id";
-
-    public static final String KEY_CANCELLED = "cancelled";
-
-    public static final String KEY_SCM_RESULT_MAP = "scm-result-map";
+    private static final String KEY_SCM_RESULT_MAP = "scm-result-map";
 
     // ----------------------------------------------------------------------
     //
@@ -108,31 +90,66 @@
         return getInteger( context, KEY_PROJECT_ID );
     }
 
+    public static void setProjectId( Map<String, Object> context, int projectId )
+    {
+        context.put( KEY_PROJECT_ID, projectId );
+    }
+
     public static Project getProject( Map<String, Object> context )
     {
         return (Project) getObject( context, KEY_PROJECT );
     }
 
+    public static Project getProject( Map<String, Object> context, Project defaultValue )
+    {
+        return (Project) getObject( context, KEY_PROJECT, defaultValue );
+    }
+
+    public static void setProject( Map<String, Object> context, Project p )
+    {
+        context.put( KEY_PROJECT, p );
+    }
+
     public static int getProjectGroupId( Map<String, Object> context )
     {
         return getInteger( context, KEY_PROJECT_GROUP_ID );
     }
 
+    public static void setProjectGroupId( Map<String, Object> context, int projectGroupId )
+    {
+        context.put( KEY_PROJECT_GROUP_ID, projectGroupId );
+    }
+
     public static BuildDefinitionTemplate getBuildDefinitionTemplate( Map<String, Object> context )
     {
         return (BuildDefinitionTemplate) getObject( context, KEY_BUILD_DEFINITION_TEMPLATE, null );
     }
 
+    public static void setBuildDefinitionTemplate( Map<String, Object> context, BuildDefinitionTemplate bdt )
+    {
+        context.put( KEY_BUILD_DEFINITION_TEMPLATE, bdt );
+    }
+
     public static BuildDefinition getBuildDefinition( Map<String, Object> context )
     {
         return (BuildDefinition) getObject( context, KEY_BUILD_DEFINITION, null );
     }
 
+    public static void setBuildDefinition( Map<String, Object> context, BuildDefinition bd )
+    {
+        context.put( KEY_BUILD_DEFINITION, bd );
+    }
+
     public static int getBuildDefinitionId( Map<String, Object> context )
     {
         return getInteger( context, KEY_BUILD_DEFINITION_ID );
     }
 
+    public static void setBuildDefinitionId( Map<String, Object> context, int buildDefintionId )
+    {
+        context.put( KEY_BUILD_DEFINITION_ID, buildDefintionId );
+    }
+
     public static String getBuildId( Map<String, Object> context )
     {
         return getString( context, KEY_BUILD_ID );
@@ -143,39 +160,49 @@
         return getString( context, KEY_BUILD_ID, defaultValue );
     }
 
+    public static void setBuildId( Map<String, Object> context, String buildId )
+    {
+        context.put( KEY_BUILD_ID, buildId );
+    }
+
     public static int getTrigger( Map<String, Object> context )
     {
         return getInteger( context, KEY_TRIGGER );
     }
 
+    public static void setTrigger( Map<String, Object> context, int trigger )
+    {
+        context.put( KEY_TRIGGER, trigger );
+    }
+
     public static Project getUnvalidatedProject( Map<String, Object> context )
     {
         return (Project) getObject( context, KEY_UNVALIDATED_PROJECT );
     }
 
-    public static ProjectGroup getUnvalidatedProjectGroup( Map<String, Object> context )
+    public static void setUnvalidatedProject( Map<String, Object> context, Project p )
     {
-        return (ProjectGroup) getObject( context, KEY_UNVALIDATED_PROJECT_GROUP );
+        context.put( KEY_UNVALIDATED_PROJECT, p );
     }
 
-    public static File getWorkingDirectory( Map<String, Object> context )
+    public static ProjectGroup getUnvalidatedProjectGroup( Map<String, Object> context )
     {
-        return new File( getString( context, KEY_WORKING_DIRECTORY ) );
+        return (ProjectGroup) getObject( context, KEY_UNVALIDATED_PROJECT_GROUP );
     }
 
-    public static ScmResult getCheckoutResult( Map<String, Object> context, Object defaultValue )
+    public static void setUnvalidatedProjectGroup( Map<String, Object> context, ProjectGroup pg )
     {
-        return (ScmResult) getObject( context, KEY_CHECKOUT_SCM_RESULT, defaultValue );
+        context.put( KEY_UNVALIDATED_PROJECT_GROUP, pg );
     }
 
-    public static ScmResult getUpdateScmResult( Map<String, Object> context )
+    public static File getWorkingDirectory( Map<String, Object> context )
     {
-        return getUpdateScmResult( context, null );
+        return new File( getString( context, KEY_WORKING_DIRECTORY ) );
     }
 
-    public static ScmResult getUpdateScmResult( Map<String, Object> context, ScmResult defaultValue )
+    public static void setWorkingDirectory( Map<String, Object> context, String workingDirectory )
     {
-        return (ScmResult) getObject( context, KEY_UPDATE_SCM_RESULT, defaultValue );
+        context.put( KEY_WORKING_DIRECTORY, workingDirectory );
     }
 
     public static List<ProjectDependency> getUpdatedDependencies( Map<String, Object> context )
@@ -189,6 +216,11 @@
         return (List<ProjectDependency>) getObject( context, KEY_UPDATE_DEPENDENCIES, defaultValue );
     }
 
+    public static void setUpdatedDependencies( Map<String, Object> context, List<ProjectDependency> dependencies )
+    {
+        context.put( KEY_UPDATE_DEPENDENCIES, dependencies );
+    }
+
     public static ScmResult getScmResult( Map<String, Object> context )
     {
         return getScmResult( context, null );
@@ -199,6 +231,11 @@
         return (ScmResult) getObject( context, KEY_SCM_RESULT, defaultValue );
     }
 
+    public static void setScmResult( Map<String, Object> context, ScmResult scmResult )
+    {
+        context.put( KEY_SCM_RESULT, scmResult );
+    }
+
     public static ScmResult getOldScmResult( Map<String, Object> context )
     {
         return getOldScmResult( context, null );
@@ -209,31 +246,62 @@
         return (ScmResult) getObject( context, KEY_OLD_SCM_RESULT, defaultValue );
     }
 
+    public static void setOldScmResult( Map<String, Object> context, ScmResult oldScmResult )
+    {
+        context.put( KEY_OLD_SCM_RESULT, oldScmResult );
+    }
+
     public static ProjectScmRoot getProjectScmRoot( Map<String, Object> context )
     {
         return (ProjectScmRoot) getObject( context, KEY_PROJECT_SCM_ROOT );
     }
 
+    public static void setProjectScmRoot( Map<String, Object> context, ProjectScmRoot projectScmRoot )
+    {
+        context.put( KEY_PROJECT_SCM_ROOT, projectScmRoot );
+    }
+
     public static int getOldBuildId( Map<String, Object> context )
     {
         return getInteger( context, KEY_OLD_BUILD_ID );
     }
 
+    public static void setOldBuildId( Map<String, Object> context, int oldBuildId )
+    {
+        context.put( KEY_OLD_BUILD_ID, oldBuildId );
+    }
+
     public static List<Project> getListOfProjects( Map<String, Object> context )
     {
         return (List<Project>) getObject( context, KEY_PROJECTS );
     }
 
+    public static void setListOfProjects( Map<String, Object> context, List<Project> projects )
+    {
+        context.put( KEY_PROJECTS, projects );
+    }
+
     public static Map<Integer, BuildDefinition> getProjectsBuildDefinitionsMap( Map<String, Object> context )
     {
         return (Map<Integer, BuildDefinition>) getObject( context, KEY_PROJECTS_BUILD_DEFINITIONS_MAP );
     }
 
+    public static void setProjectsBuildDefinitionsMap( Map<String, Object> context,
+                                                       Map<Integer, BuildDefinition> projectsBuildDefinitionsMap )
+    {
+        context.put( KEY_PROJECTS_BUILD_DEFINITIONS_MAP, projectsBuildDefinitionsMap );
+    }
+
     public static Map<Integer, ScmResult> getScmResultMap( Map<String, Object> context )
     {
         return (Map<Integer, ScmResult>) getObject( context, KEY_SCM_RESULT_MAP );
     }
 
+    public static void setScmResultMap( Map<String, Object> context, Map<Integer, ScmResult> scmResultMap )
+    {
+        context.put( KEY_SCM_RESULT_MAP, scmResultMap );
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddAssignableRolesAction.java Mon May  4 05:02:26 2009
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.util.Map;
+
 import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -26,8 +28,6 @@
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
 
-import java.util.Map;
-
 /**
  * AddAssignableRolesAction:
  *

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java Mon May  4 05:02:26 2009
@@ -39,13 +39,13 @@
      */
     private ProjectDao projectDao;
 
-    public void execute( Map map )
+    public void execute( Map context )
         throws Exception
     {
-        int projectId = getProjectId( map );
+        int projectId = getProjectId( context );
         Project project = projectDao.getProjectWithAllDetails( projectId );
 
-        BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( map );
+        BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( context );
 
         if ( buildDefinitionTemplate != null )
         {
@@ -58,19 +58,19 @@
                 projectDao.updateProject( project );
                 if ( buildDefinition.isDefaultForProject() )
                 {
-                    map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+                    AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
                 }
             }
         }
         else
         {
-            BuildDefinition buildDefinition = getBuildDefinition( map );
+            BuildDefinition buildDefinition = getBuildDefinition( context );
             resolveDefaultBuildDefinitionsForProject( buildDefinition, project );
 
             project.addBuildDefinition( buildDefinition );
 
             projectDao.updateProject( project );
-            map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+            AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
         }
 
     }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java Mon May  4 05:02:26 2009
@@ -44,12 +44,12 @@
     private ProjectGroupDao projectGroupDao;
 
 
-    public void execute( Map map )
+    public void execute( Map context )
         throws Exception
     {
-        int projectGroupId = getProjectGroupId( map );
+        int projectGroupId = getProjectGroupId( context );
         ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
-        BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( map );
+        BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( context );
         if ( buildDefinitionTemplate != null )
         {
             for ( BuildDefinition buildDefinition : (List<BuildDefinition>) buildDefinitionTemplate.getBuildDefinitions() )
@@ -63,7 +63,7 @@
         }
         else
         {
-            BuildDefinition buildDefinition = getBuildDefinition( map );
+            BuildDefinition buildDefinition = getBuildDefinition( context );
 
             resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup );
 

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java Mon May  4 05:02:26 2009
@@ -55,7 +55,7 @@
     public void execute( Map context )
         throws Exception
     {
-        Project project = (Project) getObject( context, KEY_PROJECT, null );
+        Project project = getProject( context, null );
         if ( project == null )
         {
             project = projectDao.getProject( getProjectId( context ) );

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java Mon May  4 05:02:26 2009
@@ -35,6 +35,8 @@
 public class CheckWorkingDirectoryAction
     extends AbstractContinuumAction
 {
+    private static final String KEY_WORKING_DIRECTORY_EXISTS = "working-directory-exists";
+
     /**
      * @plexus.requirement
      */
@@ -54,13 +56,23 @@
 
         if ( !workingDirectory.exists() )
         {
-            context.put( KEY_WORKING_DIRECTORY_EXISTS, Boolean.FALSE );
+            setWorkingDirectoryExist( context, false );
 
             return;
         }
 
         File[] files = workingDirectory.listFiles();
 
-        context.put( KEY_WORKING_DIRECTORY_EXISTS, files.length > 0 );
+        setWorkingDirectoryExist( context, files.length > 0 );
+    }
+
+    public static boolean isWorkingDirectoryExist( Map<String, Object> context )
+    {
+        return getBoolean( context, KEY_WORKING_DIRECTORY_EXISTS );
+    }
+
+    private static void setWorkingDirectoryExist( Map<String, Object> context, boolean exists )
+    {
+        context.put( KEY_WORKING_DIRECTORY_EXISTS, exists );
     }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java Mon May  4 05:02:26 2009
@@ -49,6 +49,14 @@
 public class CheckoutProjectContinuumAction
     extends AbstractContinuumAction
 {
+    private static final String KEY_SCM_USERNAME = "scmUserName";
+
+    private static final String KEY_SCM_PASSWORD = "scmUserPassword";
+
+    private static final String KEY_CHECKOUT_SCM_RESULT = "checkout-result";
+
+    private static final String KEY_PROJECT_RELATIVE_PATH = "project-relative-path";
+
     /**
      * @plexus.requirement
      */
@@ -95,8 +103,8 @@
 
         try
         {
-            String scmUserName = getString( context, KEY_SCM_USERNAME, project.getScmUsername() );
-            String scmPassword = getString( context, KEY_SCM_PASSWORD, project.getScmPassword() );
+            String scmUserName = getScmUsername( context, project.getScmUsername() );
+            String scmPassword = getScmPassword( context, project.getScmPassword() );
             ContinuumScmConfiguration config =
                 createScmConfiguration( project, workingDirectory, scmUserName, scmPassword );
 
@@ -108,8 +116,7 @@
             CheckOutScmResult checkoutResult = scm.checkout( config );
             if ( StringUtils.isNotEmpty( checkoutResult.getRelativePathProjectDirectory() ) )
             {
-                context.put( AbstractContinuumAction.KEY_PROJECT_RELATIVE_PATH,
-                             checkoutResult.getRelativePathProjectDirectory() );
+                context.put( KEY_PROJECT_RELATIVE_PATH, checkoutResult.getRelativePathProjectDirectory() );
             }
 
             if ( !checkoutResult.isSuccess() )
@@ -177,7 +184,7 @@
         }
         finally
         {
-            String relativePath = (String) getObject( context, KEY_PROJECT_RELATIVE_PATH, "" );
+            String relativePath = getString( context, KEY_PROJECT_RELATIVE_PATH, "" );
             if ( StringUtils.isNotEmpty( relativePath ) )
             {
                 project.setRelativePath( relativePath );
@@ -192,8 +199,8 @@
             notifier.checkoutComplete( project, buildDefinition );
         }
 
-        context.put( KEY_CHECKOUT_SCM_RESULT, result );
-        context.put( KEY_PROJECT, project );
+        setCheckoutResult( context, result );
+        setProject( context, project );
     }
 
     private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory,
@@ -266,4 +273,34 @@
         }
         return message.toString();
     }
+
+    public static String getScmUsername( Map<String, Object> context, String defaultValue )
+    {
+        return getString( context, KEY_SCM_USERNAME, defaultValue );
+    }
+
+    public static void setScmUsername( Map<String, Object> context, String scmUsername )
+    {
+        context.put( KEY_SCM_USERNAME, scmUsername );
+    }
+
+    public static String getScmPassword( Map<String, Object> context, String defaultValue )
+    {
+        return getString( context, KEY_SCM_PASSWORD, defaultValue );
+    }
+
+    public static void setScmPassword( Map<String, Object> context, String scmPassword )
+    {
+        context.put( KEY_SCM_PASSWORD, scmPassword );
+    }
+
+    public static ScmResult getCheckoutResult( Map<String, Object> context, Object defaultValue )
+    {
+        return (ScmResult) getObject( context, KEY_CHECKOUT_SCM_RESULT, defaultValue );
+    }
+
+    public static void setCheckoutResult( Map<String, Object> context, ScmResult checkoutResult )
+    {
+        context.put( KEY_CHECKOUT_SCM_RESULT, checkoutResult );
+    }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java Mon May  4 05:02:26 2009
@@ -50,28 +50,27 @@
      * @plexus.requirement
      */
     private ProjectDao projectDao;
-    
+
     /**
      * @plexus.requirement role-hint="parallel"
      */
     private BuildsManager parallelBuildsManager;
-    
+
     public synchronized void execute( Map context )
         throws Exception
     {
         List<Project> projects = AbstractContinuumAction.getListOfProjects( context );
         Map<Integer, BuildDefinition> projectsBuildDefinitionsMap =
             AbstractContinuumAction.getProjectsBuildDefinitionsMap( context );
-        Map<Integer, ScmResult> scmResultMap = 
-            AbstractContinuumAction.getScmResultMap( context );
+        Map<Integer, ScmResult> scmResultMap = AbstractContinuumAction.getScmResultMap( context );
         List<Project> projectsToBeBuilt = new ArrayList<Project>();
         int trigger = AbstractContinuumAction.getTrigger( context );
-        
+
         // update state of each project first
-        for( Project project : projects )
-        {   
+        for ( Project project : projects )
+        {
             BuildDefinition buildDefinition = projectsBuildDefinitionsMap.get( project.getId() );
-            
+
             if ( parallelBuildsManager.isInAnyBuildQueue( project.getId(), buildDefinition.getId() ) )
             {
                 return;
@@ -81,12 +80,13 @@
             {
                 parallelBuildsManager.removeProjectFromCheckoutQueue( project.getId() );
             }
-            
+
             try
             {
                 if ( project.getState() != ContinuumProjectState.NEW &&
                     project.getState() != ContinuumProjectState.CHECKEDOUT &&
-                    project.getState() != ContinuumProjectState.OK && project.getState() != ContinuumProjectState.FAILED &&
+                    project.getState() != ContinuumProjectState.OK &&
+                    project.getState() != ContinuumProjectState.FAILED &&
                     project.getState() != ContinuumProjectState.ERROR )
                 {
                     ContinuumBuildExecutor executor = executorManager.getBuildExecutor( project.getExecutorId() );
@@ -118,7 +118,7 @@
                     project = projectDao.getProject( project.getId() );
                 }
 
-                projectsToBeBuilt.add( project );                                
+                projectsToBeBuilt.add( project );
             }
             catch ( ContinuumStoreException e )
             {
@@ -126,7 +126,7 @@
                 //throw new ContinuumException( "Error while creating build object.", e );
             }
         }
-        
-        parallelBuildsManager.buildProjects( projectsToBeBuilt, projectsBuildDefinitionsMap, trigger, scmResultMap );      
+
+        parallelBuildsManager.buildProjects( projectsToBeBuilt, projectsBuildDefinitionsMap, trigger, scmResultMap );
     }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java Mon May  4 05:02:26 2009
@@ -61,6 +61,14 @@
 public class CreateProjectsFromMetadataAction
     extends AbstractContinuumAction
 {
+    private static final String KEY_URL = "url";
+
+    private static final String KEY_PROJECT_BUILDER_ID = "builderId";
+
+    private static final String KEY_PROJECT_BUILDING_RESULT = "projectBuildingResult";
+
+    private static final String KEY_LOAD_RECURSIVE_PROJECTS = "loadRecursiveProjects";
+
     /**
      * @plexus.requirement
      */
@@ -70,28 +78,20 @@
      * @plexus.requirement
      */
     private MavenSettingsBuilder mavenSettingsBuilder;
-    
+
     /**
      * @plexus.requirement role-hint="continuumUrl"
      */
-    private ContinuumUrlValidator urlValidator;    
-
-    public static final String KEY_URL = "url";
-
-    public static final String KEY_PROJECT_BUILDER_ID = "builderId";
-
-    public static final String KEY_PROJECT_BUILDING_RESULT = "projectBuildingResult";
-
-    public static final String KEY_LOAD_RECURSIVE_PROJECTS = "loadRecursiveProjects";
+    private ContinuumUrlValidator urlValidator;
 
     public void execute( Map context )
         throws ContinuumException, ContinuumProjectBuilderManagerException, ContinuumProjectBuilderException
     {
-        String projectBuilderId = getString( context, KEY_PROJECT_BUILDER_ID );
+        String projectBuilderId = getProjectBuilderId( context );
 
-        boolean loadRecursiveProjects = getBoolean( context, KEY_LOAD_RECURSIVE_PROJECTS );
+        boolean loadRecursiveProjects = isLoadRecursiveProject( context );
 
-        String curl = getString( context, KEY_URL );
+        String curl = getUrl( context );
 
         URL url;
 
@@ -105,7 +105,7 @@
             if ( buildDefinitionTemplate == null )
             {
                 buildDefinitionTemplate = projectBuilder.getDefaultBuildDefinitionTemplate();
-            }            
+            }
             if ( !curl.startsWith( "http" ) )
             {
                 url = new URL( curl );
@@ -160,11 +160,11 @@
                     result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
                 }
             }
-     
+
             if ( result.getProjects() != null )
             {
                 String scmRootUrl = getScmRootUrl( result.getProjects() );
-         
+
                 if ( scmRootUrl == null || scmRootUrl.equals( "" ) )
                 {
                     if ( curl.indexOf( "pom.xml" ) > 0 )
@@ -177,7 +177,7 @@
                     }
                 }
 
-                context.put( KEY_URL, scmRootUrl );
+                setUrl( context, scmRootUrl );
             }
         }
         catch ( MalformedURLException e )
@@ -193,7 +193,7 @@
             result.addError( ContinuumProjectBuildingResult.ERROR_MALFORMED_URL );
         }
 
-        context.put( KEY_PROJECT_BUILDING_RESULT, result );
+        setProjectBuildingResult( context, result );
     }
 
     private String hidePasswordInUrl( String url )
@@ -233,14 +233,14 @@
     private String getScmRootUrl( List<Project> projects )
     {
         String scmRootUrl = "";
-        
+
         for ( Project project : projects )
         {
             String scmUrl = project.getScmUrl();
-            
+
             scmRootUrl = getCommonPath( scmUrl, scmRootUrl );
         }
-        
+
         return scmRootUrl;
     }
 
@@ -286,4 +286,44 @@
     {
         this.urlValidator = urlValidator;
     }
+
+    public static ContinuumProjectBuildingResult getProjectBuildingResult( Map<String, Object> context )
+    {
+        return (ContinuumProjectBuildingResult) getObject( context, KEY_PROJECT_BUILDING_RESULT );
+    }
+
+    private static void setProjectBuildingResult( Map<String, Object> context, ContinuumProjectBuildingResult result )
+    {
+        context.put( KEY_PROJECT_BUILDING_RESULT, result );
+    }
+
+    public static String getUrl( Map<String, Object> context )
+    {
+        return getString( context, KEY_URL );
+    }
+
+    public static void setUrl( Map<String, Object> context, String url )
+    {
+        context.put( KEY_URL, url );
+    }
+
+    public static String getProjectBuilderId( Map<String, Object> context )
+    {
+        return getString( context, KEY_PROJECT_BUILDER_ID );
+    }
+
+    public static void setProjectBuilderId( Map<String, Object> context, String projectBuilderId )
+    {
+        context.put( KEY_PROJECT_BUILDER_ID, projectBuilderId );
+    }
+
+    public static boolean isLoadRecursiveProject( Map<String, Object> context )
+    {
+        return getBoolean( context, KEY_LOAD_RECURSIVE_PROJECTS );
+    }
+
+    public static void setLoadRecursiveProject( Map<String, Object> context, boolean loadRecursiveProject )
+    {
+        context.put( KEY_LOAD_RECURSIVE_PROJECTS, loadRecursiveProject );
+    }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java Mon May  4 05:02:26 2009
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.deployer.ArtifactDeployer;
@@ -35,11 +39,6 @@
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @version $Id$
@@ -104,15 +103,15 @@
                 BuildDefinition buildDefinition = getBuildDefinition( context );
 
                 List<Artifact> artifacts = buildExecutor.getDeployableArtifacts( project,
-                                                                       workingDirectoryService.getWorkingDirectory(
-                                                                           project ), buildDefinition );
+                                                                                 workingDirectoryService.getWorkingDirectory(
+                                                                                     project ), buildDefinition );
 
                 LocalRepository repository = project.getProjectGroup().getLocalRepository();
-                
+
                 builderHelper.setLocalRepository( repository );
-                
+
                 ArtifactRepository localRepository = builderHelper.getLocalRepository();
-                
+
                 for ( Artifact artifact : artifacts )
                 {
                     ArtifactRepositoryLayout repositoryLayout = new DefaultRepositoryLayout();

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java Mon May  4 05:02:26 2009
@@ -49,6 +49,8 @@
 public class ExecuteBuilderContinuumAction
     extends AbstractContinuumAction
 {
+    private static final String KEY_CANCELLED = "cancelled";
+
     /**
      * @plexus.requirement
      */
@@ -113,9 +115,9 @@
 
         buildResultDao.addBuildResult( project, buildResult );
 
-        context.put( KEY_BUILD_ID, Integer.toString( buildResult.getId() ) );
+        AbstractContinuumAction.setBuildId( context, Integer.toString( buildResult.getId() ) );
 
-        context.put( KEY_CANCELLED, false );
+        setCancelled( context, false );
 
         buildResult = buildResultDao.getBuildResult( buildResult.getId() );
 
@@ -137,7 +139,7 @@
 
             buildResult.setState( ContinuumProjectState.CANCELLED );
 
-            context.put( KEY_CANCELLED, true );
+            setCancelled( context, true );
         }
         catch ( Throwable e )
         {
@@ -196,7 +198,7 @@
                 notifier.goalsCompleted( project, buildDefinition, buildResult );
             }
 
-            context.put( KEY_PROJECT, project );
+            AbstractContinuumAction.setProject( context, project );
 
             projectDao.updateProject( project );
 
@@ -207,4 +209,14 @@
             buildExecutor.backupTestFiles( project, buildResult.getId() );
         }
     }
+
+    public static boolean isCancelled( Map<String, Object> context )
+    {
+        return getBoolean( context, KEY_CANCELLED );
+    }
+
+    private static void setCancelled( Map<String, Object> context, boolean cancelled )
+    {
+        context.put( KEY_CANCELLED, cancelled );
+    }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveAssignableRolesAction.java Mon May  4 05:02:26 2009
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.util.Map;
+
 import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -26,8 +28,6 @@
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
 
-import java.util.Map;
-
 /**
  * AddAssignableRolesAction:
  *

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectAction.java Mon May  4 05:02:26 2009
@@ -19,12 +19,12 @@
  * under the License.
  */
 
+import java.util.Map;
+
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 
-import java.util.Map;
-
 /**
  * AddBuildDefinitionToProjectAction:
  *
@@ -41,11 +41,11 @@
      */
     private ProjectDao projectDao;
 
-    public void execute( Map map )
+    public void execute( Map context )
         throws Exception
     {
-        BuildDefinition buildDefinition = getBuildDefinition( map );
-        int projectId = getProjectId( map );
+        BuildDefinition buildDefinition = getBuildDefinition( context );
+        int projectId = getProjectId( context );
 
         Project project = projectDao.getProjectWithAllDetails( projectId );
 

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/RemoveBuildDefinitionFromProjectGroupAction.java Mon May  4 05:02:26 2009
@@ -19,13 +19,13 @@
  * under the License.
  */
 
+import java.util.Map;
+
 import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 
-import java.util.Map;
-
 /**
  * AddBuildDefinitionToProjectAction:
  *
@@ -43,11 +43,11 @@
     private ProjectGroupDao projectGroupDao;
 
 
-    public void execute( Map map )
+    public void execute( Map context )
         throws Exception
     {
-        BuildDefinition buildDefinition = getBuildDefinition( map );
-        int projectGroupId = getProjectGroupId( map );
+        BuildDefinition buildDefinition = getBuildDefinition( context );
+        int projectGroupId = getProjectGroupId( context );
 
         ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
 

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreCheckOutScmResultAction.java Mon May  4 05:02:26 2009
@@ -19,14 +19,14 @@
  * under the License.
  */
 
+import java.util.Map;
+
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 
-import java.util.Map;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -50,7 +50,7 @@
             //
             // ----------------------------------------------------------------------
 
-            ScmResult scmResult = AbstractContinuumAction.getCheckoutResult( context, null );
+            ScmResult scmResult = CheckoutProjectContinuumAction.getCheckoutResult( context, null );
 
             Project project = projectDao.getProject( getProjectId( context ) );
 

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java Mon May  4 05:02:26 2009
@@ -36,6 +36,8 @@
 public class StoreProjectAction
     extends AbstractContinuumAction
 {
+    private static final String KEY_SCM_USE_CREDENTIALS_CACHE = "useCredentialsCache";
+
     /**
      * @plexus.requirement
      */
@@ -52,7 +54,7 @@
         //
         // ----------------------------------------------------------------------
 
-        boolean useCredentialsCache = getBoolean( context, KEY_SCM_USE_CREDENTIALS_CACHE, false );
+        boolean useCredentialsCache = isUseScmCredentialsCache( context, false );
         // CONTINUUM-1605 don't store username/password
         if ( !useCredentialsCache )
         {
@@ -65,7 +67,7 @@
 
         projectGroupDao.updateProjectGroup( projectGroup );
 
-        context.put( KEY_PROJECT_ID, project.getId() );
+        setProjectId( context, project.getId() );
 
         // ----------------------------------------------------------------------
         // Set the working directory
@@ -86,4 +88,14 @@
 */
 //        store.updateProject( project );
     }
+
+    public static boolean isUseScmCredentialsCache( Map<String, Object> context, boolean defaultValue )
+    {
+        return getBoolean( context, KEY_SCM_USE_CREDENTIALS_CACHE, defaultValue );
+    }
+
+    public static void setUseScmCredentialsCache( Map<String, Object> context, boolean useScmCredentialsCache )
+    {
+        context.put( KEY_SCM_USE_CREDENTIALS_CACHE, useScmCredentialsCache );
+    }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java Mon May  4 05:02:26 2009
@@ -51,6 +51,6 @@
 
         projectGroup = projectGroupDao.addProjectGroup( projectGroup );
 
-        context.put( KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+        AbstractContinuumAction.setProjectGroupId( context, projectGroup.getId() );
     }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectAction.java Mon May  4 05:02:26 2009
@@ -19,12 +19,12 @@
  * under the License.
  */
 
+import java.util.Map;
+
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 
-import java.util.Map;
-
 /**
  * AddBuildDefinitionToProjectAction:
  *
@@ -41,11 +41,11 @@
      */
     private ProjectDao projectDao;
 
-    public void execute( Map map )
+    public void execute( Map context )
         throws Exception
     {
-        BuildDefinition buildDefinition = getBuildDefinition( map );
-        int projectId = getProjectId( map );
+        BuildDefinition buildDefinition = getBuildDefinition( context );
+        int projectId = getProjectId( context );
 
         Project project = projectDao.getProjectWithAllDetails( projectId );
 
@@ -53,7 +53,7 @@
 
         updateBuildDefinitionInList( project.getBuildDefinitions(), buildDefinition );
 
-        map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
     }
 
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateBuildDefinitionFromProjectGroupAction.java Mon May  4 05:02:26 2009
@@ -19,12 +19,12 @@
  * under the License.
  */
 
+import java.util.Map;
+
 import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 
-import java.util.Map;
-
 /**
  * AddBuildDefinitionToProjectAction:
  *
@@ -41,11 +41,11 @@
      */
     private ProjectGroupDao projectGroupDao;
 
-    public void execute( Map map )
+    public void execute( Map context )
         throws Exception
     {
-        BuildDefinition buildDefinition = getBuildDefinition( map );
-        int projectGroupId = getProjectGroupId( map );
+        BuildDefinition buildDefinition = getBuildDefinition( context );
+        int projectGroupId = getProjectGroupId( context );
 
         ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
 
@@ -53,6 +53,6 @@
 
         updateBuildDefinitionInList( projectGroup.getBuildDefinitions(), buildDefinition );
 
-        map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
+        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
     }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromWorkingDirectoryContinuumAction.java Mon May  4 05:02:26 2009
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.util.Map;
+
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.ContinuumException;
@@ -30,8 +32,6 @@
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 
-import java.util.Map;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java Mon May  4 05:02:26 2009
@@ -19,6 +19,12 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.scm.ContinuumScm;
@@ -40,12 +46,6 @@
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
 import org.apache.maven.scm.repository.ScmRepositoryException;
 
-import java.io.File;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -54,6 +54,8 @@
 public class UpdateWorkingDirectoryFromScmContinuumAction
     extends AbstractContinuumAction
 {
+    private static final String KEY_UPDATE_SCM_RESULT = "update-result";
+
     /**
      * @plexus.requirement
      */
@@ -112,8 +114,9 @@
             ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory );
             config.setLatestUpdateDate( latestUpdateDate );
             String tag = config.getTag();
-            String msg = project.getName() + "', id: '" + project.getId() + "' to '" +
-                workingDirectory.getAbsolutePath() + "'" + ( tag != null ? " with branch/tag " + tag + "." : "." );
+            String msg =
+                project.getName() + "', id: '" + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'" +
+                    ( tag != null ? " with branch/tag " + tag + "." : "." );
             getLogger().info( "Updating project: " + msg );
             scmResult = scm.update( config );
 
@@ -140,8 +143,8 @@
             result.setSuccess( false );
 
             result.setProviderMessage( e.getMessage() + ": " + getValidationMessages( e ) );
-            
-            getLogger().error( e.getMessage(), e);
+
+            getLogger().error( e.getMessage(), e );
         }
         catch ( NoSuchScmProviderException e )
         {
@@ -151,8 +154,8 @@
             result.setSuccess( false );
 
             result.setProviderMessage( e.getMessage() );
-            
-            getLogger().error( e.getMessage(), e);
+
+            getLogger().error( e.getMessage(), e );
         }
         catch ( ScmException e )
         {
@@ -161,8 +164,8 @@
             result.setSuccess( false );
 
             result.setException( ContinuumUtils.throwableMessagesToString( e ) );
-            
-            getLogger().error( e.getMessage(), e);
+
+            getLogger().error( e.getMessage(), e );
         }
         finally
         {
@@ -178,15 +181,15 @@
             //}
             //catch ( Exception e )
             //{
-                // nasty nasty, but we're in finally, so just sacrifice the state to keep the original exception
+            // nasty nasty, but we're in finally, so just sacrifice the state to keep the original exception
             //    getLogger().error( e.getMessage(), e );
             //}
 
             notifier.checkoutComplete( project, buildDefinition );
         }
-        
+
         context.put( KEY_UPDATE_SCM_RESULT, result );
-        context.put( KEY_PROJECT, project );
+        AbstractContinuumAction.setProject( context, project );
     }
 
     private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory )
@@ -307,7 +310,7 @@
 
         return cmd;
     }
-    
+
     private String getValidationMessages( ScmRepositoryException ex )
     {
         List<String> messages = ex.getValidationMessages();
@@ -328,4 +331,14 @@
         }
         return message.toString();
     }
+
+    public static ScmResult getUpdateScmResult( Map<String, Object> context )
+    {
+        return getUpdateScmResult( context, null );
+    }
+
+    public static ScmResult getUpdateScmResult( Map<String, Object> context, ScmResult defaultValue )
+    {
+        return (ScmResult) getObject( context, KEY_UPDATE_SCM_RESULT, defaultValue );
+    }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java Mon May  4 05:02:26 2009
@@ -19,15 +19,15 @@
  * under the License.
  */
 
+import java.util.List;
+import java.util.Map;
+
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.model.project.Project;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java Mon May  4 05:02:26 2009
@@ -19,10 +19,10 @@
  * under the License.
  */
 
-import org.apache.maven.continuum.model.project.ProjectGroup;
-
 import java.util.Map;
 
+import org.apache.maven.continuum.model.project.ProjectGroup;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=771177&r1=771176&r2=771177&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java Mon May  4 05:02:26 2009
@@ -25,6 +25,7 @@
 import org.apache.continuum.dao.ProjectDao;
 import org.apache.continuum.taskqueue.CheckOutTask;
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.action.ActionManager;
@@ -85,15 +86,15 @@
 
         Map<String, Object> context = new HashMap<String, Object>();
 
-        context.put( AbstractContinuumAction.KEY_PROJECT_ID, projectId );
+        AbstractContinuumAction.setProjectId( context, projectId );
 
-        context.put( AbstractContinuumAction.KEY_PROJECT, project );
+        AbstractContinuumAction.setProject( context, project );
 
-        context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY, workingDirectory );
+        AbstractContinuumAction.setWorkingDirectory( context, workingDirectory );
 
-        context.put( AbstractContinuumAction.KEY_SCM_USERNAME, task.getScmUserName() );
+        CheckoutProjectContinuumAction.setScmUsername( context, task.getScmUserName() );
 
-        context.put( AbstractContinuumAction.KEY_SCM_PASSWORD, task.getScmPassword() );
+        CheckoutProjectContinuumAction.setScmPassword( context, task.getScmPassword() );
 
         try
         {



Mime
View raw message