java - How to stop active threads in ThreadPoolTaskExecutor throught jmx -


in app using threadpooltaskexecutor. executor contains method return activethread getactivecount . there option how stop active threads ? dont want shutdown executor want stop infinity process

while(true){ } 

ps: have access executor because want stop thread through jmx

in app add new threads this:

                taskexecutor.execute(new runnable() {                      @override                     public void run() {                         dosomething()                     }                 }); 

you need take quick check how adding tasks.

so long using submit add tasks can use future task returned (from call) cancel specific tasks. if use execute reliquishing control on task.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -