private boolean orSubmitInternal() { if (!wasQueued()) { if (isQueuedOrSubmitted()) { log.warn("Redundant call to execute "+getTask()+"; skipping"); return false; } else { ExecutionContext ec = execContext; if (ec==null) ec = BasicExecutionContext.getCurrentExecutionContext(); if (ec==null) throw new IllegalStateException("Cannot execute "+getTask()+" without an execution context; ensure caller is in an ExecutionContext"); ec.submit(getTask()); return true; } } else { return false; } } /** causes the task to be submitted (asynchronously) if it hasn't already been,
public void orCancel() { if (!wasQueued()) { task.cancel(false); } } }