I google the solution for killing a java thread. And there exists two solutions:
But both of them ar
In java.util.concurrent.FutureTask, the mechanism of cancellation by timeout is acted as throwing java.util.concurrent.TimeoutException.
You may check out this as if there are something to be interrupted automatically by timeout.