Package org.apache.continuum.taskqueue

Examples of org.apache.continuum.taskqueue.BuildProjectTask


    {
        Map<String, BuildProjectTask> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
        Set<String> keySet = currentBuilds.keySet();
        for ( String key : keySet )
        {
            BuildProjectTask buildProjectTask = currentBuilds.get( key );
            if ( buildProjectTask != null && buildResult != null )
            {
                return !( buildResult.getState() == ContinuumProjectState.BUILDING &&
                    ( buildProjectTask.getBuildDefinitionId() == buildResult.getBuildDefinition().getId() &&
                        buildProjectTask.getProjectId() == this.getProjectId() ) );
            }
        }
        return true;
    }
View Full Code Here


        Map<String, BuildProjectTask> currentBuilds = getContinuum().getBuildsManager().getCurrentBuilds();
        Set<String> keySet = currentBuilds.keySet();

        for ( String key : keySet )
        {
            BuildProjectTask task = currentBuilds.get( key );
            if ( task != null )
            {
                return task.getProjectId();
            }
        }
        return -1;
    }
View Full Code Here

    private BuildAgentBuildExecutorManager buildAgentBuildExecutorManager;

    public void executeTask( Task task )
        throws TaskExecutionException
    {
        BuildProjectTask buildProjectTask = (BuildProjectTask) task;

        int projectId = buildProjectTask.getProjectId();

        log.info( "Initializing build (projectId=" + projectId + ")" );
        BuildContext context = buildContextManager.getBuildContext( projectId );
        initializeBuildContext( context );
View Full Code Here

    {
        try
        {
            Map<String, Object> project = new HashMap<String, Object>();

            BuildProjectTask task = buildAgentTaskQueueManager.getCurrentProjectInBuilding();

            if ( task != null )
            {
                project.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( task.getProjectId() ) );
                project.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( task.getBuildDefinitionId() ) );
                project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
                project.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
                project.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
                project.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_LABEL, task.getBuildDefinitionLabel() );
            }

            return project;
        }
        catch ( TaskQueueManagerException e )
View Full Code Here

            if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getProjectGroupId() == projectGroupId )
            {
                return true;
            }

            BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();

            if ( currentBuildTask != null && currentBuildTask.getProjectGroupId() == projectGroupId )
            {
                return true;
            }

            for ( PrepareBuildProjectsTask task : buildAgentTaskQueueManager.getProjectsInPrepareBuildQueue() )
View Full Code Here

            if ( currentPrepareBuildTask != null && currentPrepareBuildTask.getScmRootId() == projectScmRootId )
            {
                return true;
            }

            BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();
           
            if ( currentBuildTask != null )
            {
                int projectId = currentBuildTask.getProjectId();

                for ( Integer pid : projectIds )
                {
                    if ( pid == projectId )
                    {
View Full Code Here

    public boolean isProjectCurrentlyBuilding( int projectId )
    {
        try
        {
            BuildProjectTask currentBuildTask = buildAgentTaskQueueManager.getCurrentProjectInBuilding();

            if ( currentBuildTask != null && currentBuildTask.getProjectId() == projectId )
            {
                return true;
            }
        }
        catch ( TaskQueueManagerException e )
View Full Code Here

        for ( BuildContext buildContext : buildContexts )
        {
          BuildTrigger buildTrigger = new BuildTrigger( buildContext.getTrigger(), buildContext.getUsername() );
         
          BuildProjectTask buildProjectTask =
                new BuildProjectTask( buildContext.getProjectId(), buildContext.getBuildDefinitionId(),
                                  buildTrigger, buildContext.getProjectName(), buildContext.getBuildDefinitionLabel(),
                                      buildContext.getScmResult(), buildContext.getProjectGroupId() );
            buildProjectTask.setMaxExecutionTime( buildContext.getMaxExecutionTime() * 1000 );

            try
            {
                if ( !buildAgentTaskQueueManager.isProjectInBuildQueue( buildProjectTask.getProjectId() ) )
                {
                    buildAgentTaskQueueManager.getBuildQueue().put( buildProjectTask );
                }
            }
            catch ( TaskQueueException e )
View Full Code Here

        }
    }

    private BuildProjectTask createBuildProjectTask()
    {
        BuildProjectTask task =
            new BuildProjectTask( 1, 1, new BuildTrigger( 1 ), "Test Project", "Default Build Definition",
                                  new ScmResult(), 1 );
        return task;
    }
View Full Code Here

            if ( StringUtils.isEmpty( buildDefinitionLabel ) )
            {
                buildDefinitionLabel = buildDefinition.getGoals();
            }
   
            BuildProjectTask buildTask =
              new BuildProjectTask( projectId, buildDefinition.getId(), buildTrigger, projectName, buildDefinitionLabel,
                                      scmResult, projectGroupId );
            try
            {
                log.info(
                    "Project '" + projectName + "' added to overall build queue '" + overallBuildQueue.getName() + "'." );
View Full Code Here

TOP

Related Classes of org.apache.continuum.taskqueue.BuildProjectTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.