public void beginTask( final String name, final int toDo ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.beginTask( name, toDo ); } }
public void endTask( final String message ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.endTask( message ); } }
public boolean isCanceled() { if (wrapped != null) { return wrapped.isCanceled(); } else { return false; } }
TaskUtil.getCurrentProgressListener().beginTask( "Recreating Maven Metadata on all Maven repositories", reposes.size() ); TaskUtil.getCurrentProgressListener().working( RepositoryStringUtils.getFormattedMessage( "Recreating Maven Metadata on %s", repo ), 1 ); repo.recreateMavenMetadata( req ); TaskUtil.getCurrentProgressListener().endTask( "Done" ); TaskUtil.getCurrentProgressListener().beginTask( RepositoryStringUtils.getFormattedMessage( "Recreating Maven Metadata on %s", mavenRepository ) ); TaskUtil.getCurrentProgressListener().endTask( "Done" );
public void working(final String message) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.working(message); } }
public void cancel() { if (wrapped != null) { wrapped.cancel(); } } }
public void working( final int workDone ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.working( workDone ); } }
public void cancel() { if ( wrapped != null ) { wrapped.cancel(); } } }
public void working( final String message, final int work ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.working( message, work ); } }
public boolean isCanceled() { if ( wrapped != null ) { return wrapped.isCanceled(); } else { return false; } }
public void beginTask(final String name) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.beginTask(name); } }
public void reset() { final ProgressListener progressListener = getProgressListener(); if (progressListener != null) { progressListener.cancel(); } // to prevent starting it if not yet started if (getFuture() != null) { getFuture().cancel(false); } setTaskState(TaskState.SUBMITTED); reschedule(true); }
public void endTask(final String message) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.endTask(message); } }
public void working( final String message ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.working( message ); } }
/** * Checks for user cancellation or thread interruption. In any of those both cases, {@link TaskInterruptedException} * is thrown that might be caught and handled by caller. If not handled, thread will die-off. If handled, caller * must ensure and handle interrupt flag of current thread. */ public static void checkInterruption() throws TaskInterruptedException { Thread.yield(); if ( getCurrentProgressListener().isCanceled() ) { throw new TaskInterruptedException( "Thread \"" + Thread.currentThread().getName() + "\" is canceled!", true ); } if ( Thread.interrupted() ) { throw new TaskInterruptedException( "Thread \"" + Thread.currentThread().getName() + "\" is interrupted!", false ); } } }
public void beginTask( final String name ) { TaskUtil.checkInterruption(); if ( wrapped != null ) { wrapped.beginTask( name ); } }
public void reset() { final ProgressListener progressListener = getProgressListener(); if ( progressListener != null ) { progressListener.cancel(); } // to prevent starting it if not yet started if ( getFuture() != null ) { getFuture().cancel( false ); } setTaskState( TaskState.SUBMITTED ); reschedule( true ); }
public void working(final String message, final int work) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.working(message, work); } }
/** * Checks for user cancellation or thread interruption. In any of those both cases, {@link * TaskInterruptedException} * is thrown that might be caught and handled by caller. If not handled, thread will die-off. If handled, caller * must ensure and handle interrupt flag of current thread. */ public static void checkInterruption() throws TaskInterruptedException { Thread.yield(); if (getCurrentProgressListener().isCanceled()) { throw new TaskInterruptedException("Thread \"" + Thread.currentThread().getName() + "\" is canceled!", true); } if (Thread.interrupted()) { throw new TaskInterruptedException("Thread \"" + Thread.currentThread().getName() + "\" is interrupted!", false); } } }
public void beginTask(final String name, final int toDo) { TaskUtil.checkInterruption(); if (wrapped != null) { wrapped.beginTask(name, toDo); } }