public boolean cancel(Item item) { LOGGER.log(Level.FINE, "Cancelling {0} item#{1}", new Object[] {item.task, item.id}); lock.lock(); try { try { return item.cancel(this); } finally { updateSnapshot(); } } finally { lock.unlock(); } }
@SuppressFBWarnings(value = "IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD", justification = "It will invoke the inherited clear() method according to Java semantics. " + "FindBugs recommends suppressing warnings in such case") public void cancelAll() { for (T t : new ArrayList<T>(this)) t.cancel(Queue.this); clear(); } }
public boolean cancel(Item item) { LOGGER.log(Level.FINE, "Cancelling {0} item#{1}", new Object[] {item.task, item.id}); lock.lock(); try { try { return item.cancel(this); } finally { updateSnapshot(); } } finally { lock.unlock(); } }
/** * Works like {@link #remove(Task)} but also marks the {@link Item} as cancelled. */ public T cancel(Task p) { T x = get(p); if(x!=null) x.cancel(Queue.this); return x; }
@SuppressFBWarnings(value = "IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD", justification = "It will invoke the inherited clear() method according to Java semantics. " + "FindBugs recommends suppressing warnings in such case") public void cancelAll() { for (T t : new ArrayList<T>(this)) t.cancel(Queue.this); clear(); } }
/** * Works like {@link #remove(Task)} but also marks the {@link Item} as cancelled. */ public T cancel(Task p) { T x = get(p); if(x!=null) x.cancel(Queue.this); return x; }