Package org.codehaus.plexus.taskqueue.execution

Examples of org.codehaus.plexus.taskqueue.execution.TaskExecutionException


           
            context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, projectScmRoot );
        }
        catch ( ContinuumStoreException e )
        {
            throw new TaskExecutionException( "Error storing project scm root", e );
        }
    }
View Full Code Here


                    projectsToBeBuilt.add( project );
                }
                catch( ContinuumStoreException e )
                {
                    log.error( "Error while creating build object", e );
                    throw new TaskExecutionException( "Error while creating build object", e );
                }
            }
            else if ( project.getState() == ContinuumProjectState.CHECKEDOUT || project.getState() == ContinuumProjectState.NEW ) //check if no build result yet for project
            {
                try
                {
                    //get default build definition for project
                    //buildDefinitionId = buildDefinitionDao.getDefaultBuildDefinition( project.getId() ).getId();
                    BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition( project.getId() );
                    projectsBuildDefinitionsMap.put( project.getId(), buildDefinition );
                    projectsToBeBuilt.add( project );
                }
                catch ( ContinuumStoreException e )
                {
                    log.error( "Error while creating build object", e );
                    throw new TaskExecutionException( "Error while creating build object", e );
                }
                catch ( Exception e )
                {
                    log.error( e.getMessage(), e );
                    throw new TaskExecutionException( "Error executing action 'build-project'", e );
                }
                //shouldBuild = true;
                projectsToBeBuilt.add( project );
            }
        }
       
        try
        {
            Map context = new HashMap();
            context.put( AbstractContinuumAction.KEY_PROJECTS, projectsToBeBuilt );
            context.put( AbstractContinuumAction.KEY_PROJECTS_BUILD_DEFINITIONS_MAP, projectsBuildDefinitionsMap );
            context.put( AbstractContinuumAction.KEY_TRIGGER, trigger );
           
            log.info( "Performing action create-build-project-task" );
            actionManager.lookup( "create-build-project-task" ).execute( context );
        }
        catch ( ActionNotFoundException e )
        {
           log.error( "Error looking up action 'build-project'" );
           throw new TaskExecutionException( "Error looking up action 'build-project'", e );
        }
        catch ( Exception e )
        {
            log.error( e.getMessage(), e );
            throw new TaskExecutionException( "Error executing action 'build-project'", e );
        }
    }
View Full Code Here

                LocalRepository repository = repoPurge.getRepository();

                if ( repository == null )
                {
                    throw new TaskExecutionException(
                        "Error while executing purge repository task: no repository set" );
                }

                purgeController = (PurgeController) container.lookup( PurgeController.ROLE, "purge-repository" );

                purgeController.initializeExecutors( repoPurge );

                if ( repoPurge.isDeleteAll() )
                {
                    purgeController.doPurge( repository.getLocation() );
                }
                else
                {
                    scanner.scan( repository, purgeController );
                }
            }
            else if ( purgeConfig != null && purgeConfig instanceof DirectoryPurgeConfiguration )
            {
                DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;

                purgeController = (PurgeController) container.lookup( PurgeController.ROLE, "purge-directory" );

                purgeController.initializeExecutors( dirPurge );

                purgeController.doPurge( dirPurge.getLocation() );
            }

        }
        catch ( ComponentLookupException e )
        {
            throw new TaskExecutionException( "Error while executing purge task", e );
        }
        catch ( ContinuumPurgeExecutorException e )
        {
            throw new TaskExecutionException( "Error while executing purge task", e );
        }
    }
View Full Code Here

            projectDao.updateProject( project );
        }
        catch ( ContinuumStoreException e )
        {
            throw new TaskExecutionException( "Error while storing the checkout result.", e );
        }
    }
View Full Code Here

                LocalRepository repository = repoPurge.getRepository();

                if ( repository == null )
                {
                    throw new TaskExecutionException(
                        "Error while executing purge repository task: no repository set" );
                }

                PurgeController purgeController = (PurgeController) container.lookup( PurgeController.ROLE,
                                                                                      "purge-repository" );

                purgeController.initializeExecutors( repoPurge );

                if ( repoPurge.isDeleteAll() )
                {
                    purgeController.doPurge( repoPurge );
                }
                else
                {
                    scanner.scan( repository, purgeController );
                }
            }
            else if ( purgeConfig != null && purgeConfig instanceof DirectoryPurgeConfiguration )
            {
                DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;

                PurgeController purgeController = (PurgeController) container.lookup( PurgeController.ROLE,
                                                                                      "purge-directory" );

                purgeController.initializeExecutors( dirPurge );

                purgeController.doPurge( dirPurge.getLocation() );
            }
            else if ( purgeConfig instanceof DistributedDirectoryPurgeConfiguration )
            {
                DistributedDirectoryPurgeConfiguration dirPurge = (DistributedDirectoryPurgeConfiguration) purgeConfig;

                PurgeController purgeController = (PurgeController) container.lookup( PurgeController.ROLE,
                                                                                      "purge-distributed-directory" );

                purgeController.initializeExecutors( dirPurge );

                purgeController.doPurge( dirPurge );
            }

        }
        catch ( ComponentLookupException e )
        {
            throw new TaskExecutionException( "Error while executing purge task", e );
        }
        catch ( ContinuumPurgeExecutorException e )
        {
            throw new TaskExecutionException( "Error while executing purge task", e );
        }
    }
View Full Code Here

        {
            scheduleDatabaseJobs();
        }
        catch ( SchedulerException e )
        {
            throw new TaskExecutionException( "Unable to schedule repository jobs: " + e.getMessage(), e );

        }
    }
View Full Code Here

    {
        RepositoryTask repoTask = (RepositoryTask) task;
       
        if ( StringUtils.isBlank( repoTask.getRepositoryId() ) )
        {
            throw new TaskExecutionException("Unable to execute RepositoryTask with blank repository Id.");
        }

        getLogger().info( "Executing task from queue with job name: " + repoTask.getName() );
       
        try
        {
            ManagedRepositoryConfiguration arepo = archivaConfiguration.getConfiguration().findManagedRepositoryById( repoTask.getRepositoryId() );

            long sinceWhen = RepositoryScanner.FRESH_SCAN;

            List<RepositoryContentStatistics> results = dao.query( new MostRecentRepositoryScanStatistics( arepo.getId() ) );

            if ( CollectionUtils.isNotEmpty( results ) )
            {
                RepositoryContentStatistics lastStats = results.get( 0 );
                sinceWhen = lastStats.getWhenGathered().getTime() + lastStats.getDuration();
            }

            RepositoryScanStatistics stats = repoScanner.scan( arepo, sinceWhen );

            getLogger().info( "Finished repository task: " + stats.toDump( arepo ) );
           
            // I hate jpox and modello
            RepositoryContentStatistics dbstats = new RepositoryContentStatistics();
            dbstats.setDuration( stats.getDuration() );
            dbstats.setNewFileCount( stats.getNewFileCount() );
            dbstats.setRepositoryId( stats.getRepositoryId() );
            dbstats.setTotalFileCount( stats.getTotalFileCount() );
            dbstats.setWhenGathered( stats.getWhenGathered() );
           
            dao.getRepositoryContentStatisticsDAO().saveRepositoryContentStatistics( dbstats );
        }
        catch ( RepositoryException e )
        {
            throw new TaskExecutionException( "Repository error when executing repository job.", e );
        }       
    }
View Full Code Here

            getLogger().info( "Task: Updating unprocessed artifacts" );
            databaseUpdater.updateAllUnprocessed();
        }
        catch ( ArchivaDatabaseException e )
        {
            throw new TaskExecutionException( "Error running unprocessed updater", e );
        }

        try
        {
            getLogger().info( "Task: Updating processed artifacts" );
            databaseUpdater.updateAllProcessed();
        }
        catch ( ArchivaDatabaseException e )
        {
            throw new TaskExecutionException( "Error running processed updater", e );
        }

        time = System.currentTimeMillis() - time;

        getLogger().info( "Finished database task in " + time + "ms." );
View Full Code Here

                    buildProjects( buildContexts );
                }
            }
            else
            {
                throw new TaskExecutionException( "No project build context" );
            }
        }
        catch ( TaskExecutionException e )
        {
            log.error( "Error while preparing build of project: {}", e.getMessage() );
View Full Code Here

            {
                buildAgentManager.startPrepareBuild( map );
            }
            catch ( ContinuumException e )
            {
                throw new TaskExecutionException( e.getMessage(), e );
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.taskqueue.execution.TaskExecutionException

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.