get callable from ThreadPoolTaskExecutor or cast Runnable to Callable

后端 未结 2 899
北海茫月
北海茫月 2021-01-27 01:53

I\'m using ThreadPoolTaskExecutor for executing my tasks which are implemantations of Callable interface. I just want to check in time if task is still in pool (monitoring). How

2条回答
  •  迷失自我
    2021-01-27 01:55

    Since it looks like you want to monitor the ExecutorService, look into overriding decorateTask(). You can then decorate the future to monitor its state.

提交回复
热议问题