I went through many discussion, specially Removing all queued tasks of an ThreadPoolExecutor It is a good solution but in my program I can't use storing Futures because it may require to remove tasks from the queue even after an hour or two from various places, so I want some other approach to solve it.
Can I go along with getQueue() and remove() methods, is it going to work? In description it is mention that remove() method can't remove transformed task like one which is having future then how can I remove those task? (other than storing Futures and canceling)
and one more thing in documentation it is recommended that getQueue() should not be used other than Monitoring and Debugging purpose, so how it will affects in my case. Thanks a lot for above mention discussion, I hope I will get solution for my problem.