users@glassfish.java.net

Re: Deploy with no impact on current user sessions

From: <glassfish_at_javadesktop.org>
Date: Wed, 26 Mar 2008 17:04:53 PST

Good question!

I think the kind of callback you mention already exists.

If the app foresees the needs to inject session state during the upgrade, it could store a custom session attribute implementing the HttpSessionActivationListener interface in all of its sessions (this could be done by the sessionCreated() method of the app's HttpSessionListener) .

The HttpSessionActivationListener implementation could invoke a static method (that implements any required upgrade logic and takes a session as its argument) on one of the app's implementation classes, whose implementation could be different in the new version of the app.

Then, as each session is restored during the upgrade, its HttpSessionActivationListener attribute will be invoked at its sessionDidActivate() method, and could invoke the new upgrade logic, by passing it the session received in the HttpSessionEvent.

I have not thought this thru in detail, but it looks like this might work. What do you think?
[Message sent by forum member 'jluehe' (jluehe)]

http://forums.java.net/jive/thread.jspa?messageID=266091