I'm totally blocked in this task, I have read a lot about callable, future, sockets etc. and still, I really don't know what to do... I hope someone will give me some hints please.
package com.codegym.task.task25.task2509;
import java.util.concurrent.*;
/*
It's not as easy as it seems
*/
public class Solution extends ThreadPoolExecutor {
public Solution(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) {
super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
}
protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable) {
if (callable instanceof CancellableTask) {
return ((CancellableTask<T>) callable).newTask();
} else {
return super.newTaskFor(callable);
}
}
public static void main(String[] args) {
}
}