Package org.codehaus.plexus.taskqueue.execution

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


            {
                projectScmRootDao.updateProjectScmRoot( projectScmRoot );
            }
            catch ( ContinuumStoreException e )
            {
                throw new TaskExecutionException( "Error persisting projectScmRoot", e );
            }
        }

        notifierDispatcher.prepareBuildComplete( projectScmRoot );
    }
View Full Code Here


    }

    private void performAction( String actionName, Map<String, Object> context )
        throws TaskExecutionException
    {
        TaskExecutionException exception;

        try
        {
            log.info( "Performing action " + actionName );
            actionManager.lookup( actionName ).execute( context );
            return;
        }
        catch ( ActionNotFoundException e )
        {
            exception = new TaskExecutionException( "Error looking up action '" + actionName + "'", e );
        }
        catch ( Exception e )
        {
            exception = new TaskExecutionException( "Error executing action '" + actionName + "'", e );
        }

        ScmResult result = new ScmResult();

        result.setSuccess( false );
View Full Code Here

            AbstractContinuumAction.setProjectScmRoot( context, 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 );
                }
            }
        }

        try
        {
            Map<String, Object> context = new HashMap<String, Object>();
            AbstractContinuumAction.setListOfProjects( context, projectsToBeBuilt );
            AbstractContinuumAction.setProjectsBuildDefinitionsMap( context, projectsBuildDefinitionsMap );
            AbstractContinuumAction.setBuildTrigger( context, buildTrigger );
            AbstractContinuumAction.setScmResultMap( context, scmResultMap );
            AbstractContinuumAction.setProjectGroupId( context, projectGroupId );

            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

            actionManager.lookup( "store-checkout-scm-result" ).execute( context );
        }
        catch ( Exception e )
        {
            throw new TaskExecutionException( "Error checking out project.", 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." );
        }

        ManagedRepositoryConfiguration arepo =
            archivaConfiguration.getConfiguration().findManagedRepositoryById( repoTask.getRepositoryId() );

        // execute consumers on resource file if set
        if ( repoTask.getResourceFile() != null )
        {
            log.debug( "Executing task from queue with job name: " + repoTask );
            consumers.executeConsumers( arepo, repoTask.getResourceFile(), repoTask.isUpdateRelatedArtifacts() );
        }
        else
        {
            log.info( "Executing task from queue with job name: " + repoTask );

            // otherwise, execute consumers on whole repository
            try
            {
                if ( arepo == null )
                {
                    throw new TaskExecutionException(
                        "Unable to execute RepositoryTask with invalid repository id: " + repoTask.getRepositoryId() );
                }

                long sinceWhen = RepositoryScanner.FRESH_SCAN;

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

                if ( CollectionUtils.isNotEmpty( results ) )
                {
                    RepositoryContentStatistics lastStats = results.get( 0 );
                    if ( !repoTask.isScanAll() )
                    {
                        sinceWhen = lastStats.getWhenGathered().getTime() - lastStats.getDuration();
                    }
                }

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

                log.info( "Finished repository task: " + stats.toDump( arepo ) );

                RepositoryContentStatistics dbstats = constructRepositoryStatistics( arepo, stats );

                dao.getRepositoryContentStatisticsDAO().saveRepositoryContentStatistics( dbstats );

                this.task = null;
            }
            catch ( RepositoryException e )
            {
                throw new TaskExecutionException( "Repository error when executing repository job.", e );
            }
        }
    }
View Full Code Here

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

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

        time = System.currentTimeMillis() - time;

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

                    log.debug( "Index file packaged at '" + indexLocation.getPath() + "'." );
                }
                catch ( IOException e )
                {
                    log.error( "Error occurred while executing indexing task '" + indexingTask + "': " + e.getMessage() );
                    throw new TaskExecutionException( "Error occurred while executing indexing task '" + indexingTask
                        + "'", e );
                }
                finally
                {
                    if ( context != null )
                    {
                        try
                        {
                            context.close( false );
                        }
                        catch ( IOException e )
                        {
                            log.error( "Error occurred while closing context: " + e.getMessage() );
                            throw new TaskExecutionException( "Error occurred while closing context: " + e.getMessage() );
                        }
                    }
                }
            }
            else
            {
                if ( context.getIndexDirectory() == null )
                {
                    throw new TaskExecutionException( "Trying to index an artifact but the context is already closed" );
                }
               
                try
                {
                    File artifactFile = indexingTask.getResourceFile();
                    ArtifactContext ac = artifactContextProducer.getArtifactContext( context, artifactFile );

                    if ( ac != null )
                    {
                        if ( indexingTask.getAction().equals( ArtifactIndexingTask.Action.ADD ) )
                        {
                            boolean add = true;
                            IndexReader r = context.getIndexReader();
                            for ( int i = 0; i < r.numDocs(); i++ )
                            {
                                if ( !r.isDeleted( i ) )
                                {
                                    Document d = r.document( i );
                                    String uinfo = d.get( ArtifactInfo.UINFO );
                                    if ( ac.getArtifactInfo().getUinfo().equals( uinfo ) )
                                    {
                                        add = false;
                                        break;
                                    }
                                }
                            }

                            if ( add )
                            {
                                log.debug( "Adding artifact '" + ac.getArtifactInfo() + "' to index.." );
                                indexerEngine.index( context, ac );
                                context.getIndexWriter().commit();
                            }
                            else
                            {
                                log.debug( "Updating artifact '" + ac.getArtifactInfo() + "' in index.." );
                                indexerEngine.update( context, ac );
                                context.getIndexWriter().commit();
                            }
                        }
                        else
                        {
                            log.debug( "Removing artifact '" + ac.getArtifactInfo() + "' from index.." );
                            indexerEngine.remove( context, ac );
                            context.getIndexWriter().commit();
                        }
                    }
                }
                catch ( IOException e )
                {
                    log.error( "Error occurred while executing indexing task '" + indexingTask + "': " + e.getMessage() );
                    throw new TaskExecutionException( "Error occurred while executing indexing task '" + indexingTask
                        + "'", e );
                }
            }
        }
    }
View Full Code Here

                {
                    context.setBuildResult( buildResultDao.getBuildResult( Integer.valueOf( s ) ) );
                }
                catch ( NumberFormatException e )
                {
                    throw new TaskExecutionException( "Internal error: build id not an integer", e );
                }
                catch ( ContinuumObjectNotFoundException e )
                {
                    throw new TaskExecutionException( "Internal error: Cannot find build result", e );
                }
                catch ( ContinuumStoreException e )
                {
                    throw new TaskExecutionException( "Error loading build result", e );
                }
            }
        }
        finally
        {
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.