[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
shutdown hook  XML
Forum Index -> Development
Author Message
moebus

Power User

Joined: 21/11/2007 12:49:18
Messages: 93
Offline

Being a swing novice hopefully you can help me with the following issue.
Is it possible to hook into the shutdown of the client? It is relatively easy for applets - we can establish our own applet class as a subclass of PageApplet, and then have the standard lifecycle methods like stop().
But I don't know of such a thing for webstart. Hopefully there is a solution which works uniformly for all client modes.

Manfred
p.s. just to avoid misunderstandings: this is not an issue of server programming, where we have the t:sessioncloser element, but of client programming; we are adding some custom stuff into the client jar, and for this we need the hook.
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hi,

we use a normal WindowListener that we apply to the frame holding the PageBrowser component instance. The window Listener has a windowClosing() method which is the one that is called before closing, and a windowClosed() method which the one called fter the window is closed.

We use a window lifecycle listener ourselves . which sends a System.exit(1) to the client VM. So there's a bunch of logic that is already in place. We can provide an exit into your "whatever you do" before closing the client.

Before doing this...: what do you want to place into the shutdown of the client?

Björn

PS: I am not aware of any applet-like lifecycle methods in webstart...

Björn Müller, CaptainCasa GmbH
moebus

Power User

Joined: 21/11/2007 12:49:18
Messages: 93
Offline

we sometimes create temporary files which are presented to the user via Desktop.open(). Then there is no secure point when to delete such files, so using the shutdown of the client was one option.

Then there is the issue of
http://www.captaincasademo.com/forum/posts/list/1470.page - we also have our own log appender which should be cleaned "at the end of the session".

In the meantime we have come to a possibility to implement such feature on our own: we can create our own version of the t:sessioncloser element, include in the our main page, and can implement our code there.
So if you don't consider this shutdown hooking as being of general interest to the community, we might as well withdraw this feature request.

Manfred
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hi,

OK - I understand, thanks for the info.
We will include such a "hook" for WebStart as part of out closing procedure. Next update...

Regards, Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team