Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » preWindowShellClose is not called
preWindowShellClose is not called [message #95815] Wed, 02 July 2008 13:39 Go to next message
Eclipse UserFriend
Originally posted by: diman.tetracom.com

Hi All,

I am working on a RAP application and I want to do some cleanup when the
application (in the browser) is closed. I've overrided the method
preWindowShellClose in ApplicationWorkbenchWindowAdvisor (extends
WorkbenchWindowAdvisor) and set a breakpoint there.
However, the browser was closed, but the code in the method was not
executed.

Can you give me a hint how and when it is suitable to make the cleanup?

greetings
Diman
Re: preWindowShellClose is not called [message #95830 is a reply to message #95815] Wed, 02 July 2008 13:56 Go to previous messageGo to next message
Dmitry Pryadkin is currently offline Dmitry PryadkinFriend
Messages: 146
Registered: July 2009
Senior Member
Hello Diman

This is because a session never ends. You may have to adjust your timeout.

http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.rap.help/help/html/getting-started/launcher.html

Diman Karagiozov wrote:
> Hi All,
>
> I am working on a RAP application and I want to do some cleanup when the
> application (in the browser) is closed. I've overrided the method
> preWindowShellClose in ApplicationWorkbenchWindowAdvisor (extends
> WorkbenchWindowAdvisor) and set a breakpoint there.
> However, the browser was closed, but the code in the method was not
> executed.
>
> Can you give me a hint how and when it is suitable to make the cleanup?
>
> greetings
> Diman
>
Re: preWindowShellClose is not called [message #95936 is a reply to message #95830] Wed, 02 July 2008 17:31 Go to previous messageGo to next message
Stefan Hansel is currently offline Stefan HanselFriend
Messages: 103
Registered: July 2009
Senior Member
<br><font size=2 face="sans-serif">By the way - is it planned to have the
browser send a last event when it is closed ?</font>
<br>
<br><font size=2 face="sans-serif">We usually have long running sessions
and most user just don't care about closing the Shell but just close the
browser.</font>
<br><font size=2 face="sans-serif">Then they restart the app because they
forgot something and the memory consumptions increases unnecessarily.</font>
<br>
<br>
<br>
Re: preWindowShellClose is not called [message #95950 is a reply to message #95936] Wed, 02 July 2008 20:01 Go to previous messageGo to next message
Dmitry Pryadkin is currently offline Dmitry PryadkinFriend
Messages: 146
Registered: July 2009
Senior Member
stefan.hansel@tolina.de wrote:
>
> By the way - is it planned to have the browser send a last event when it
> is closed ?
>

My guess, it's impossible.
Re: preWindowShellClose is not called [message #95994 is a reply to message #95936] Wed, 02 July 2008 20:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Hi,

I share Dmitrys doubts, it is at least hard to achieve and likely to
not work reliably in all situations.
As this topic was raised before, please also see this newsgroup
(session, timeout, invalidate, free, memory, etc) for discussions
about ideas and thoughts on this.

Cheers
Rüdiger

stefan.hansel@tolina.de wrote:
>
> By the way - is it planned to have the browser send a last event when it
> is closed ?
>
> We usually have long running sessions and most user just don't care
> about closing the Shell but just close the browser.
> Then they restart the app because they forgot something and the memory
> consumptions increases unnecessarily.
>
>
Re: preWindowShellClose is not called [message #96217 is a reply to message #95994] Thu, 03 July 2008 08:30 Go to previous messageGo to next message
Stefan Hansel is currently offline Stefan HanselFriend
Messages: 103
Registered: July 2009
Senior Member
<br><font size=2 face="sans-serif">Searched a while but indeed found no
suitable solution.</font>
<br>
<br><font size=2 face="sans-serif">Let's think a different way about those
two competing requirements:</font>
<br><font size=2 face="sans-serif">- we want to have long (maybe even neverending)
sessions ... users need to have time to get their coffee and beeing disturbed
by long telephone calls and then go on working in the app</font>
<br><font size=2 face="sans-serif">- if the users kill their browser we
want the session to die as soon as possible</font>
<br>
<br><font size=2 face="sans-serif">Wouldn't it be possible to write an
invisible 'keep alive' widget - this just pings the server say every &nbsp;10
minutes ?</font>
<br><font size=2 face="sans-serif">We could then configure the servers
timeout to say 15minutes.</font>
<br>
<br><font size=2 face="sans-serif">Nevertheless - as long as the user keeps
his browser window open, the session would not die at all. </font>
<br><font size=2 face="sans-serif">If he closes the browser or gets disconnected
from the network server resources are not held too long.</font>
<br>
<br><font size=2 face="sans-serif">This could even be done as a feature
of the shell, having an extra widget would just be a workaround.</font>
Re: preWindowShellClose is not called [message #96232 is a reply to message #96217] Thu, 03 July 2008 09:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Hi Stefan,

sorry to point you to nowhere. I cannot recall anymore where this
discussion happened, maybe on a bug or the mailing list.

Anyway, the keep-alive widget was discussed there and sounds like a
reasonable approach. Though I would consider this as an application
requirement and therefore should not be provided by RAP.

Note that implementing the keep-alive as a widget will likely cause
layouting issues. You might be better off using a similar approach
as the ExternalBrowser does. See also the 'custom widgets: life
cycle adapters and frequent client side activities' thread.

Cheers,
Rüdiger

stefan.hansel@tolina.de wrote:
>
> Searched a while but indeed found no suitable solution.
>
> Let's think a different way about those two competing requirements:
> - we want to have long (maybe even neverending) sessions ... users need
> to have time to get their coffee and beeing disturbed by long telephone
> calls and then go on working in the app
> - if the users kill their browser we want the session to die as soon as
> possible
>
> Wouldn't it be possible to write an invisible 'keep alive' widget - this
> just pings the server say every 10 minutes ?
> We could then configure the servers timeout to say 15minutes.
>
> Nevertheless - as long as the user keeps his browser window open, the
> session would not die at all.
> If he closes the browser or gets disconnected from the network server
> resources are not held too long.
>
> This could even be done as a feature of the shell, having an extra
> widget would just be a workaround.
Re: preWindowShellClose is not called [message #96384 is a reply to message #96232] Thu, 03 July 2008 13:01 Go to previous messageGo to next message
Stefan Hansel is currently offline Stefan HanselFriend
Messages: 103
Registered: July 2009
Senior Member
<br><font size=2 face="sans-serif">Hhmm - sound's not tooo complicated:
</font>
<br>
<br><font size=2 face="sans-serif">1) writing and configuration a dummy-servlet
(working as 'ping-destination'), so that I don't interfere with RAP</font>
<br><font size=2 face="sans-serif">2) registering a PhaseListener that
(once) sends a javascript to the browser, which regularly pings the dummy-servlet
</font>
<br>
<br><font size=2 face="sans-serif">I'll give that a try in the near future.</font>
Re: preWindowShellClose is not called [message #96456 is a reply to message #96384] Thu, 03 July 2008 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Stefan,

it should work this way. You're welcome to share your results here.

Cheers
Rüdiger

stefan.hansel@tolina.de wrote:
>
> Hhmm - sound's not tooo complicated:
>
> 1) writing and configuration a dummy-servlet (working as
> 'ping-destination'), so that I don't interfere with RAP
> 2) registering a PhaseListener that (once) sends a javascript to the
> browser, which regularly pings the dummy-servlet
>
> I'll give that a try in the near future.
Re: preWindowShellClose is not called [message #96656 is a reply to message #95830] Fri, 04 July 2008 06:01 Go to previous message
Stefan   is currently offline Stefan Friend
Messages: 316
Registered: July 2009
Senior Member
Hi all,

Dmitry Pryadkin schrieb:
> Hello Diman
>
> This is because a session never ends. You may have to adjust your timeout.
>

Just one remark. When deploying your RAP app in an application
container, you can set a reasonable time-out for your session, e.g. one
hour. You still have the problem of a closed browser window but it
would'n manifest itself that dramatic as it sounds when reading this
thread...
Regards,
Stefan.
Previous Topic:Change actionSet button state programatically
Next Topic:[ANN] Upcoming CVS Structure Reorganization
Goto Forum:
  


Current Time: Thu Apr 25 14:44:55 GMT 2024

Powered by FUDForum. Page generated in 0.04278 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top