Re: newFixedThreadPool in struts2

2018-02-12 Thread Emi
[Try2] . 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? You can write your own listener by implementing

Re: newFixedThreadPool in struts2

2018-02-12 Thread Emi
It's still accessible: public void sessionCreated(HttpSessionEvent hse) { final HttpSession session = hse.getSession(); logger.debug("session created"); session.setAttribute(KEY, new Clickstream()); } public void sessionDestroyed(HttpSessionEvent hse)

Re: newFixedThreadPool in struts2

2018-02-10 Thread Yasser Zamani
On 2/10/2018 12:32 AM, Emi wrote: > Hello Yasser, >> You can write your own listener by implementing HttpSessionListener >> and call shutdown in it's `sessionDestroyed` method. Please see [1]. >> [1] http://www.myjavarecipes.com/tag/session-timeout-handling-in-java/ > In HttpSessionListener, it

Re: newFixedThreadPool in struts2

2018-02-10 Thread Yasser Zamani
On 2/9/2018 10:20 PM, Emi wrote: > [Try2] . 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

Re: newFixedThreadPool in struts2

2018-02-09 Thread Martin Gainty
From: Emi <em...@encs.concordia.ca> Sent: Friday, February 9, 2018 4:02 PM To: Struts Users Mailing List Subject: Re: newFixedThreadPool in struts2 Hello Yasser, > You can write your own listener by implementing HttpSessionListener > and call shutdown in it's `sessionDes

Re: newFixedThreadPool in struts2

2018-02-09 Thread Dave Weis
It's still accessible: public void sessionCreated(HttpSessionEvent hse) { final HttpSession session = hse.getSession(); logger.debug("session created"); session.setAttribute(KEY, new Clickstream()); } public void sessionDestroyed(HttpSessionEvent hse) {

Re: newFixedThreadPool in struts2

2018-02-09 Thread Emi
Hello Yasser, You can write your own listener by implementing HttpSessionListener and call shutdown in it's `sessionDestroyed` method. Please see [1]. [1] http://www.myjavarecipes.com/tag/session-timeout-handling-in-java/ In HttpSessionListener, it seems that there are no session attributes

Re: newFixedThreadPool in struts2

2018-02-09 Thread Emi
Firstly you should decide what do you like about life-time of that thread pool without being worry about calling shutdown. All your examples have solutions to call shutdown which I described below... Please read below [Try1] . By springframe work setup ThreadPool . In action class, use

Re: newFixedThreadPool in struts2

2018-02-09 Thread Yasser Zamani
On 2/8/2018 8:51 PM, Emi wrote: >> Firstly you should decide what do you like about life-time of that >> thread pool without being worry about calling shutdown. All your >> examples have solutions to call shutdown which I described below... >> Please read below >>> [Try1] . By springframe

Re: newFixedThreadPool in struts2

2018-02-08 Thread Emi
Firstly you should decide what do you like about life-time of that thread pool without being worry about calling shutdown. All your examples have solutions to call shutdown which I described below... Please read below [Try1] . By springframe work setup ThreadPool . In action class, use

Re: newFixedThreadPool in struts2

2018-02-08 Thread Yasser Zamani
u suggest the best way to setup newFixedThreadPool in struts2 > webapp please? > > [Try1] > . By springframe work setup ThreadPool > . In action class, use fixedPool >   Future f1 = fixedPool.submit(() -> { ...actions such as send > email, etc }); > >   So,  th

newFixedThreadPool in struts2

2018-02-08 Thread Emi
Hello, Can you suggest the best way to setup newFixedThreadPool in struts2 webapp please? [Try1] . By springframe work setup ThreadPool . In action class, use fixedPool Future f1 = fixedPool.submit(() -> { ...actions such as send email, etc }); So, there will be NO shutdown in act