Can you suggest the best way to setup newFixedThreadPool in struts2 webapp please?

. By springframe work setup ThreadPool
. In action class, use fixedPool
Future<String> f1 = fixedPool.submit(() -> { ...actions such as send email, etc });

  So,  there will be NO shutdown in action class
         fixedPool.shutdown();  will be maintained by spring config?

. Each user login session create one fixedPool
. When user logout, fixedPool.shutdown()

What about if users do not call logout action. Where and how the fixedPool to be shutdown?
  Is there a way to auto shutdown after period of time?

. In each action method
  Create fixedPool
  submit/future run...

This way, the benefit is that fixedPool is shutdown for sure after thread completes.
  But each action is going to create one threadpool.

Any suggestions about the best way to use "FixedThreadPool" in struts2 web framework please?

Thanks a lot!

Reply via email to