One correction;
I said the stuck threads can be killed from Os. This is not completely correct.
You can't kill them in thread level, but you can kill the JVM they belong to.. I mean you can kill the managed server...
Normally, you can't safely kill a thread without touching the process.. But you may find a way, test it and consider using it.
You need to find a way to attach to a running thread and stop it basically.
The code should also be compatible for that action..
I mean your code should be able to interact with the users and let thems to kill the thread they want.
I don't recommend such things but you may want to look at the following link - just to improve your general culture in java world.
->
https://web.archive.org/web/20160302023213/http://www.rhcedan.com/2010/06/22/killing-a-java-thread