@Override public synchronized void start() throws IOException { // don't allow thread to be "started twice" if (thd.stopped) { thd.stopped = false; thd.start(); } }
@Override public synchronized void stop() throws IOException { thd.stopped = true; try { source.close(); } catch (InterruptedException ee) { LOG.error(ee.getMessage()); } }
@Override public boolean join(long ms) throws InterruptedException { final PumperThread t = thd; t.join(ms); return !t.isAlive(); }
/** Start the mean shutdown. */ public void cancel() { thd.interrupt(); }