private void cancel( Future future ) { if ( !future.cancel( true ) ) { if ( !future.isDone() && !future.isCancelled() ) { log.warn( "Unable to cancel task" ); } else { log.warn( "Task not cancelled (Flags: done: " + future.isDone() + " cancelled: " + future.isCancelled() + ")" ); } } else { log.debug( "Task successfully cancelled" ); } }
private void cancel( Future future ) { if ( !future.cancel( true ) ) { if ( !future.isDone() && !future.isCancelled() ) { log.warn( "Unable to cancel task" ); } else { log.warn( "Task not cancelled (Flags: done: " + future.isDone() + " cancelled: " + future.isCancelled() + ")" ); } } else { log.debug( "Task successfully cancelled" ); } }
while (it.hasNext()) { Runnable r = (Runnable)it.next(); if (r instanceof Future && ((Future)r).isCancelled()) it.remove(); for (int i=0; i<arr.length; i++) { Object r = arr[i]; if (r instanceof Future && ((Future)r).isCancelled()) q.remove(r);
while (it.hasNext()) { Runnable r = (Runnable)it.next(); if (r instanceof Future && ((Future)r).isCancelled()) it.remove(); for (int i=0; i<arr.length; i++) { Object r = arr[i]; if (r instanceof Future && ((Future)r).isCancelled()) q.remove(r);
while (it.hasNext()) { Runnable r = (Runnable)it.next(); if (r instanceof Future && ((Future)r).isCancelled()) it.remove(); for (int i=0; i<arr.length; i++) { Object r = arr[i]; if (r instanceof Future && ((Future)r).isCancelled()) q.remove(r);