org.gradle.api.execution.TaskExecutionListener Java Examples

The following examples show how to use org.gradle.api.execution.TaskExecutionListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ParallelTaskPlanExecutor.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void process(final TaskExecutionPlan taskExecutionPlan, final TaskExecutionListener taskListener) {
    StoppableExecutor executor = executorFactory.create("Task worker");
    try {
        startAdditionalWorkers(taskExecutionPlan, taskListener, executor);
        taskWorker(taskExecutionPlan, taskListener).run();
        taskExecutionPlan.awaitCompletion();
    } finally {
        executor.stop();
    }
}
 
Example #2
Source File: ParallelTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void process(final TaskExecutionPlan taskExecutionPlan, final TaskExecutionListener taskListener) {
    StoppableExecutor executor = executorFactory.create("Task worker");
    try {
        startAdditionalWorkers(taskExecutionPlan, taskListener, executor);
        taskWorker(taskExecutionPlan, taskListener).run();
        taskExecutionPlan.awaitCompletion();
    } finally {
        executor.stop();
    }
}
 
Example #3
Source File: ParallelTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void startAdditionalWorkers(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener, Executor executor) {
    List<Project> projects = getAllProjects(taskExecutionPlan);
    int numExecutors = Math.min(executorCount, projects.size());

    LOGGER.info("Using {} parallel executor threads", numExecutors);

    for (int i = 1; i < numExecutors; i++) {
        Runnable worker = taskWorker(taskExecutionPlan, taskListener);
        executor.execute(worker);
    }
}
 
Example #4
Source File: ParallelTaskPlanExecutor.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void startAdditionalWorkers(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener, Executor executor) {
    List<Project> projects = getAllProjects(taskExecutionPlan);
    int numExecutors = Math.min(executorCount, projects.size());

    LOGGER.info("Using {} parallel executor threads", numExecutors);

    for (int i = 1; i < numExecutors; i++) {
        Runnable worker = taskWorker(taskExecutionPlan, taskListener);
        executor.execute(worker);
    }
}
 
Example #5
Source File: ParallelTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void process(final TaskExecutionPlan taskExecutionPlan, final TaskExecutionListener taskListener) {
    StoppableExecutor executor = executorFactory.create("Task worker");
    try {
        startAdditionalWorkers(taskExecutionPlan, taskListener, executor);
        taskWorker(taskExecutionPlan, taskListener).run();
        taskExecutionPlan.awaitCompletion();
    } finally {
        executor.stop();
    }
}
 
Example #6
Source File: ParallelTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void startAdditionalWorkers(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener, Executor executor) {
    List<Project> projects = getAllProjects(taskExecutionPlan);
    int numExecutors = Math.min(executorCount, projects.size());

    LOGGER.info("Using {} parallel executor threads", numExecutors);

    for (int i = 1; i < numExecutors; i++) {
        Runnable worker = taskWorker(taskExecutionPlan, taskListener);
        executor.execute(worker);
    }
}
 
Example #7
Source File: ParallelTaskPlanExecutor.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void startAdditionalWorkers(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener, Executor executor) {
    List<Project> projects = getAllProjects(taskExecutionPlan);
    int numExecutors = Math.min(executorCount, projects.size());

    LOGGER.info("Using {} parallel executor threads", numExecutors);

    for (int i = 1; i < numExecutors; i++) {
        Runnable worker = taskWorker(taskExecutionPlan, taskListener);
        executor.execute(worker);
    }
}
 
Example #8
Source File: ParallelTaskPlanExecutor.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void process(final TaskExecutionPlan taskExecutionPlan, final TaskExecutionListener taskListener) {
    StoppableExecutor executor = executorFactory.create("Task worker");
    try {
        startAdditionalWorkers(taskExecutionPlan, taskListener, executor);
        taskWorker(taskExecutionPlan, taskListener).run();
        taskExecutionPlan.awaitCompletion();
    } finally {
        executor.stop();
    }
}
 
Example #9
Source File: AbstractTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private TaskExecutorWorker(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener) {
    this.taskExecutionPlan = taskExecutionPlan;
    this.taskListener = taskListener;
}
 
Example #10
Source File: AbstractTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected Runnable taskWorker(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener) {
    return new TaskExecutorWorker(taskExecutionPlan, taskListener);
}
 
Example #11
Source File: DefaultTaskGraphExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultTaskGraphExecuter(ListenerManager listenerManager, TaskPlanExecutor taskPlanExecutor) {
    this.taskPlanExecutor = taskPlanExecutor;
    graphListeners = listenerManager.createAnonymousBroadcaster(TaskExecutionGraphListener.class);
    taskListeners = listenerManager.createAnonymousBroadcaster(TaskExecutionListener.class);
}
 
Example #12
Source File: DefaultTaskGraphExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void addTaskExecutionListener(TaskExecutionListener listener) {
    taskListeners.add(listener);
}
 
Example #13
Source File: DefaultTaskGraphExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void removeTaskExecutionListener(TaskExecutionListener listener) {
    taskListeners.remove(listener);
}
 
Example #14
Source File: DefaultTaskPlanExecutor.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void process(final TaskExecutionPlan taskExecutionPlan, final TaskExecutionListener taskListener) {
    taskWorker(taskExecutionPlan, taskListener).run();
    taskExecutionPlan.awaitCompletion();
}
 
Example #15
Source File: DefaultTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void process(final TaskExecutionPlan taskExecutionPlan, final TaskExecutionListener taskListener) {
    taskWorker(taskExecutionPlan, taskListener).run();
    taskExecutionPlan.awaitCompletion();
}
 
Example #16
Source File: DefaultTaskGraphExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void removeTaskExecutionListener(TaskExecutionListener listener) {
    taskListeners.remove(listener);
}
 
Example #17
Source File: DefaultTaskGraphExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void addTaskExecutionListener(TaskExecutionListener listener) {
    taskListeners.add(listener);
}
 
Example #18
Source File: DefaultTaskGraphExecuter.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultTaskGraphExecuter(ListenerManager listenerManager, TaskPlanExecutor taskPlanExecutor, BuildCancellationToken cancellationToken) {
    this.taskPlanExecutor = taskPlanExecutor;
    graphListeners = listenerManager.createAnonymousBroadcaster(TaskExecutionGraphListener.class);
    taskListeners = listenerManager.createAnonymousBroadcaster(TaskExecutionListener.class);
    taskExecutionPlan = new DefaultTaskExecutionPlan(cancellationToken);
}
 
Example #19
Source File: AbstractTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private TaskExecutorWorker(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener) {
    this.taskExecutionPlan = taskExecutionPlan;
    this.taskListener = taskListener;
}
 
Example #20
Source File: AbstractTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected Runnable taskWorker(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener) {
    return new TaskExecutorWorker(taskExecutionPlan, taskListener);
}
 
Example #21
Source File: DefaultTaskPlanExecutor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void process(final TaskExecutionPlan taskExecutionPlan, final TaskExecutionListener taskListener) {
    taskWorker(taskExecutionPlan, taskListener).run();
    taskExecutionPlan.awaitCompletion();
}
 
Example #22
Source File: DefaultTaskGraphExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void removeTaskExecutionListener(TaskExecutionListener listener) {
    taskListeners.remove(listener);
}
 
Example #23
Source File: DefaultTaskGraphExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void addTaskExecutionListener(TaskExecutionListener listener) {
    taskListeners.add(listener);
}
 
Example #24
Source File: DefaultTaskGraphExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultTaskGraphExecuter(ListenerManager listenerManager, TaskPlanExecutor taskPlanExecutor) {
    this.taskPlanExecutor = taskPlanExecutor;
    graphListeners = listenerManager.createAnonymousBroadcaster(TaskExecutionGraphListener.class);
    taskListeners = listenerManager.createAnonymousBroadcaster(TaskExecutionListener.class);
}
 
Example #25
Source File: AbstractTaskPlanExecutor.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private TaskExecutorWorker(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener) {
    this.taskExecutionPlan = taskExecutionPlan;
    this.taskListener = taskListener;
}
 
Example #26
Source File: AbstractTaskPlanExecutor.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
protected Runnable taskWorker(TaskExecutionPlan taskExecutionPlan, TaskExecutionListener taskListener) {
    return new TaskExecutorWorker(taskExecutionPlan, taskListener);
}
 
Example #27
Source File: DefaultTaskPlanExecutor.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void process(final TaskExecutionPlan taskExecutionPlan, final TaskExecutionListener taskListener) {
    taskWorker(taskExecutionPlan, taskListener).run();
    taskExecutionPlan.awaitCompletion();
}
 
Example #28
Source File: DefaultTaskGraphExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void removeTaskExecutionListener(TaskExecutionListener listener) {
    taskListeners.remove(listener);
}
 
Example #29
Source File: DefaultTaskGraphExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void addTaskExecutionListener(TaskExecutionListener listener) {
    taskListeners.add(listener);
}
 
Example #30
Source File: DefaultTaskGraphExecuter.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultTaskGraphExecuter(ListenerManager listenerManager, TaskPlanExecutor taskPlanExecutor, BuildCancellationToken cancellationToken) {
    this.taskPlanExecutor = taskPlanExecutor;
    graphListeners = listenerManager.createAnonymousBroadcaster(TaskExecutionGraphListener.class);
    taskListeners = listenerManager.createAnonymousBroadcaster(TaskExecutionListener.class);
    taskExecutionPlan = new DefaultTaskExecutionPlan(cancellationToken);
}