@Test(expected = WorkerspaceQueueException.class) public void whenJoinThenKO() throws WorkerspaceQueueException { HandlerIO handlerIO = mock(HandlerIOImpl.class); WorkspaceBatchRunner workspaceBatchRunner = new WorkspaceBatchRunner(handlerIO, VitamThreadPoolExecutor.getDefaultExecutor(), 10); workspaceBatchRunner.join(); }
public void join() throws WorkerspaceQueueException { if (!started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } if (stopped) { return; } stopped = true; doDequeue = false; try { waitMonitor.get(); } catch (InterruptedException | ExecutionException e) { LOGGER.error(e); throw new WorkerspaceQueueException(e); } if (null != exceptionOccurred) { throw new WorkerspaceQueueException(exceptionOccurred); } }
WorkspaceBatchRunner implements Runnable { public void join() throws WorkerspaceQueueException { if (!started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } if (stopped) { return; } stopped = true; doDequeue = false; try { waitMonitor.get(); } catch (InterruptedException | ExecutionException e) { LOGGER.error(e); throw new WorkerspaceQueueException(e); } if (null != exceptionOccurred) { throw new WorkerspaceQueueException(exceptionOccurred); } } }
WorkspaceBatchRunner implements Runnable { public void join() throws WorkerspaceQueueException { if (!started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } if (stopped) { return; } stopped = true; doDequeue = false; try { waitMonitor.get(); } catch (InterruptedException | ExecutionException e) { LOGGER.error(e); throw new WorkerspaceQueueException(e); } if (null != exceptionOccurred) { throw new WorkerspaceQueueException(exceptionOccurred); } } WorkspaceBatchRunner(HandlerIO handlerAsyncIO, Executor executor, int queueSize); }
WorkspaceBatchRunner implements Runnable { public void join() throws WorkerspaceQueueException { if (!started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } if (stopped) { return; } stopped = true; doDequeue = false; try { waitMonitor.get(); } catch (InterruptedException | ExecutionException e) { LOGGER.error(e); throw new WorkerspaceQueueException(e); } if (null != exceptionOccurred) { throw new WorkerspaceQueueException(exceptionOccurred); } } WorkspaceBatchRunner(HandlerIO handlerAsyncIO, Executor executor, int queueSize); @Override void run(); void transfer(WorkspaceQueue workspaceQueue); void start(); void join(); }
WorkspaceBatchRunner implements Runnable { public void join() throws WorkerspaceQueueException { if (!started) { throw new WorkerspaceQueueException("Workspace batch runner already started"); } if (stopped) { return; } stopped = true; doDequeue = false; try { waitMonitor.get(); } catch (InterruptedException | ExecutionException e) { LOGGER.error(e); throw new WorkerspaceQueueException(e); } if (null != exceptionOccurred) { throw new WorkerspaceQueueException(exceptionOccurred); } } WorkspaceBatchRunner(HandlerIO handlerAsyncIO, Executor executor, int queueSize); @Override void run(); void transfer(WorkspaceQueue workspaceQueue); void start(); void join();  }