On 28 July 2011 20:30, Chris Bartlett <cbartlet...@gmail.com> wrote:
> If changes will be made as a result of this thread, then I think Task
> should have a setExecutorService(ExecutorService) method too, or its
> 'executorService' field made final if it is not supposed to be
> changed.  My preference would be the former.

Actually, I'm not sure about this.  If Tasks are intended to be
reused, then it seems reasonable to allow the ExecutorService to be
changed after the Task has been instantiated.  If so, add the setter,
if not, just make the field final.

It would be fine for a TaskGroup to use a different ExecutorService to
execute a Task (if that were possible), but you wouldn't want it to
change the actual ExecutorService that the Task references.

So Task would need additional execute methods which take an
ExecutorService to use for the execution. (As you suggested earlier).

Reply via email to