Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped.
-----Original Message----- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: [email protected] Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: > Hello, > Is there a method in Session that is called when the Session is ended? > Ended = user logs out (invalidate) or time-out (or anything else that can do > that) > > My goal is to keep some information in the session and persist it when the > session terminates. > > Is it "legal" to create a Thread (as a member in the Session / Application) > that every X minutes will get information from the Session and "do something > with it"? > > -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ______________ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _____________ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
