Thanks Eelco, but...

The trouble is that the lifecycle of a Wicket WebSession object is not the same 
as the HTTPSession. When a session is temporary only, you never get a 
valueUnbound() callback. I'll have to move the resource manager initialization 
into the valueBound() method; inconvenient but not a problem per se.
My second objection is that this works, as you said, with the default 
implmentation of ISessionStore. I would introduce a dependency on the exact 
implementation of ISessionStore used, not any published API. That somehow fills 
me with sombre premonitions ;-)
I still think it would be nice if org.apache.wicket.Session had a proper 
lifecycle (à la WebApplication.onDestroy()). Should I file a feature request or 
start a conversation on the dev list?

Thomas

> -----Original Message-----
> From: Eelco Hillenius [mailto:[EMAIL PROTECTED] 
> Sent: Donnerstag, 20. September 2007 02:39
> To: users@wicket.apache.org
> Subject: Re: WebSession shutdown
> 
> > In our WebSession subclass we manage some resources which 
> need to be 
> > cleaned up when the session goes away (because of timeout, etc). Is 
> > there a recommended way to call a "shutdown()" method on 
> our session 
> > class? I have seen WebApplication.sessionDestroyed(String), but I'm 
> > not sure how to get the wicket session from there (since we don't 
> > necessarily have an active request at that time). Of 
> course, I could 
> > implement my own session store or something like that, but that 
> > approach seems to be a bit hackish.
> 
> As long as you are putting the Wicket Session object in your 
> HttpSession (like the default session stores do) I think you 
> should be able to just let your session class inplement 
> HttpSessionBindingListener and react on valueUnbound. Can you 
> try that and let the list know whether that worked for you?
> 
> Eelco
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to