protected void checkInterruption() throws TaskInterruptedException { TaskUtil.checkInterruption(); } }
protected void checkInterruption() throws TaskInterruptedException { TaskUtil.checkInterruption(); } }
@Override public boolean isStopped() { try { TaskUtil.checkInterruption(); } catch ( TaskInterruptedException e ) { if ( stopCause == null ) { stopCause = e; } running = false; } return !running; }
public void working(final String message) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.working(message); } }
public void working( final int workDone ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.working( workDone ); } }
public void working( final String message, final int work ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.working( message, work ); } }
public void beginTask( final String name, final int toDo ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.beginTask( name, toDo ); } }
public void working( final String message ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.working( message ); } }
public void beginTask(final String name) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.beginTask(name); } }
public void working(final String message, final int work) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.working(message, work); } }
public void beginTask( final String name ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.beginTask( name ); } }
public void endTask( final String message ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.endTask( message ); } }
public void beginTask(final String name, final int toDo) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.beginTask(name, toDo); } }
public void working(final int workDone) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.working(workDone); } }
public void endTask(final String message) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.endTask(message); } }
@Override public void run(IndexingContext context) throws IOException { TaskUtil.checkInterruption(); log.debug("Optimizing index for repository {} ", repository.getId()); context.optimize(); log.debug("Optimized index for repository {} ", repository.getId()); } });
public void publishAllIndex() throws IOException { log.debug("Publishing indexes for all repositories"); final List<Repository> reposes = repositoryRegistry.getRepositories(); final ArrayList<IOException> exceptions = new ArrayList<IOException>(); // just publish all, since we use merged context, no need for double pass for (Repository repository : reposes) { TaskUtil.checkInterruption(); try { publishRepositoryIndex(repository); } catch (IOException e) { exceptions.add(e); } } if (!exceptions.isEmpty()) { throw Throwables2.composite(new IOException("Exception(s) happened during publishAllIndex()"), exceptions); } }
public List<IOException> perform() { final List<IOException> exceptions = new ArrayList<IOException>(); if (ISGROUP(repository)) { List<Repository> members = repository.adaptToFacet(GroupRepository.class).getMemberRepositories(); for (Repository member : members) { TaskUtil.checkInterruption(); try { perform(member); } catch (IOException e) { exceptions.add(e); } } } return exceptions; }
protected void reindexRepository(final String path, final Repository repository, final boolean fullReindex, final Set<String> processedRepositoryIds) throws IOException { if (!processedRepositoryIds.add(repository.getId())) { // already processed, bail out return; } final List<IOException> exceptions = new GroupOperation(repository) { @Override protected void perform(Repository member) throws IOException { reindexRepository(path, member, fullReindex, processedRepositoryIds); } }.perform(); TaskUtil.checkInterruption(); reindexRepository(repository, path, fullReindex); if (REINDEX_PUBLISHES) { publishRepositoryIndex(repository); } if (!exceptions.isEmpty()) { throw Throwables2.composite(new IOException("Exception(s) happened during reindexAllRepositories()"), exceptions); } }
@Override public void run(final IndexingContext context) throws IOException { if (ISPROXY(this.repository)) { updateRemoteIndex(this.repository.adaptToFacet(ProxyRepository.class), context, this.fullReindex); } TaskUtil.checkInterruption(); // igorf, this needs be merged back to maven indexer, see MINDEXER-65 final IndexSearcher contextIndexSearcher = context.acquireIndexSearcher(); try { final NexusScanningListener scanListener = new NexusScanningListener(context, contextIndexSearcher, this.fullReindex, ISPROXY(this.repository)); scanner.scan(new ScanningRequest(context, scanListener, this.fromPath)); } finally { context.releaseIndexSearcher(contextIndexSearcher); } } }