@davidmason In another comment you suggest using getHandleById, and I 
think getHandleByIdAndRemoveIfFinished is starting to get a bit long for 
a method name. I agree on the getHandleById only because there might be 
confusion with a custom String-based key.

Could we agree on getHandleById with the boolean parameter? The 
parameter is very suitably named, and it only takes a short trip to the 
javadoc to get more information (which shouldn't be a problem with an IDE).

Carlos A. Munoz
Senior Software Engineer
Engineering - Internationalization
Red Hat

On 08/26/2013 11:15 AM, David Mason wrote:
> In zanata-war/src/main/java/org/zanata/service/AsyncTaskManagerService.java:
>
>> +import org.zanata.async.AsyncTaskHandle;
>> +
>> +/**
>> + * @author Carlos Munoz <a href="mailto:camunoz@redhat.com">camunoz@redhat.com</a>
>> + */
>> +public interface AsyncTaskManagerService
>> +{
>> +   <V, H extends AsyncTaskHandle<V>> String startTask(AsyncTask<V, H> task);
>> +
>> +   <V, H extends AsyncTaskHandle<V>> void startTask(AsyncTask<V, H> task, Serializable key);
>> +
>> +   AsyncTaskHandle getHandle(String taskId);
>> +
>> +   AsyncTaskHandle getHandleByKey(Serializable key);
>> +
>> +   AsyncTaskHandle getHandle(String taskId, boolean removeIfFinished);
>
> This appears to do more than just get, so the method name could reflect
> that it can remove the task/handle as well. In this case I would prefer
> not to have the boolean, and instead just make this something like
> |getHandleAndRemoveIfFinished(String taskId)| and use the plain get
> method when no removal is desired, or make a separate |remove| or
> |removeIfFinished| method.
>
> Superficially, it looks like this is only ever called with |false| at
> the moment, so maybe it isn't required at all.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/zanata/zanata-server/pull/141/files#r5970322>.
>