* this handler. Second, this method is invoked once a
* <code>ProcessorTask</code> needs to be removed from the interrupted queue.
*/
public void handle(Task task){
AsyncTask apt = null;
if (task.getType() == Task.PROCESSOR_TASK) {
apt = getAsyncProcessorTask();
apt.setProcessorTask((ProcessorTask)task);
apt.setSelectorThread(task.getSelectorThread());
}
boolean wasInterrupted = interruptedQueue.remove(apt);
if ( !wasInterrupted && apt == null) {
// Try to remove the ProcessorTask itself
interruptedQueue.remove(task);
}
// Last chance to execute asynchronously.
if ( apt == null ){
apt = (AsyncTask)task;
}
if (apt != null){
apt.execute();
}
}