public void run() { drain(); } };
public void run() { drain(); } };
/** * Executes the runnable. This method blocks until it has been * executed. * @param runnable */ public void executeAndDrain(Runnable runnable) { if (runnable == null) throw new NullPointerException("runnable cannot be null"); if (shutdown.get()) throw new RejectedExecutionException("shutdown"); if (isDraining()) { runnable.run(); } else { externalQueue.add(runnable); drain(); } }
/** * Executes the runnable. This method blocks until it has been * executed. * @param runnable */ public void executeAndDrain(Runnable runnable) { if (runnable == null) throw new NullPointerException("runnable cannot be null"); if (shutdown.get()) throw new RejectedExecutionException("shutdown"); if (isDraining()) { runnable.run(); } else { externalQueue.add(runnable); drain(); } }