brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Tasks stop on unmanaged
Date Thu, 16 Oct 2014 22:18:48 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/252#discussion_r18990800
  
    --- Diff: core/src/main/java/brooklyn/util/task/BasicExecutionManager.java ---
    @@ -559,21 +640,49 @@ protected void beforeStart(Map<?,?> flags, Task<?> task)
{
             ExecutionUtils.invoke(flags.get("newTaskStartCallback"), task);
         }
     
    -    protected void afterEnd(Map<?,?> flags, Task<?> task) {
    -        activeTaskCount.decrementAndGet();
    -        incompleteTaskCount.decrementAndGet();
    -
    +    /** normally (if not interrupted) called once for each call to {@link #beforeSubmitScheduledTaskAllIterations(Map,
Task)} */
    +    protected void afterEndScheduledTaskAllIterations(Map<?,?> flags, Task<?>
task) {
    +        _afterEnd(flags, task, false, true);
    +    }
    +    /** called once for each call to {@link #beforeStartScheduledTaskSubmissionIteration(Map,
Task)},
    +     * with a per-iteration task generated by the surrounding scheduled task */
    +    protected void afterEndScheduledTaskSubmissionIteration(Map<?,?> flags, Task<?>
scheduledTask, Task<?> taskIteration) {
    +        _afterEnd(flags, scheduledTask, true, false);
    +    }
    +    /** called once for each task on which {@link #beforeStartAtomicTask(Map, Task)}
is invoked,
    +     * and normally (if not interrupted prior to start) 
    +     * called once for each task on which {@link #beforeSubmitAtomicTask(Map, Task)}
*/
    +    protected void afterEndAtomicTask(Map<?,?> flags, Task<?> task) {
    +        _afterEnd(flags, task, true, true);
    +    }
    +    /** normally (if not interrupted) called once for each call to {@link #beforeSubmit(Map,
Task)},
    +     * and, for atomic tasks and scheduled-task submission iterations where 
    +     * always called once if {@link #beforeStart(Map, Task)} is invoked and in the same
thread as that method */
    +    protected void _afterEnd(Map<?,?> flags, Task<?> task, boolean startedInThisThread,
boolean isEndingAllIterations) {
    --- End diff --
    
    Personal preference: not a fan of starting methods with "_". But not sure what a better
name would be.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message