public class BlockingOverseer extends SimpleOverseer
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOGGER |
private Semaphore |
semaphore |
currentWorkers, observers, taskWorkerMapping, workersSetMutex
Constructor and Description |
---|
BlockingOverseer(int numberOfConcurrentTasks) |
Modifier and Type | Method and Description |
---|---|
void |
reportTaskFinished(Worker worker) |
void |
reportTaskThrowedException(Worker worker,
Throwable t) |
void |
startTask(Task task)
Starts the given
Task . |
createWorker, startWorker
addObserver, getTaskState, getTaskStates, getWorker, removeObserver
private static final org.slf4j.Logger LOGGER
private Semaphore semaphore
public void startTask(Task task)
Overseer
Task
.startTask
in interface Overseer
startTask
in class AbstractOverseer
task
- the Task
that should be executedpublic void reportTaskFinished(Worker worker)
reportTaskFinished
in interface WorkerObserver
reportTaskFinished
in class AbstractOverseer
public void reportTaskThrowedException(Worker worker, Throwable t)
reportTaskThrowedException
in interface WorkerObserver
reportTaskThrowedException
in class AbstractOverseer
Copyright © 2015. All rights reserved.