Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Example RCP-project: when is Application.stop() supposed to be called?
Example RCP-project: when is Application.stop() supposed to be called? [message #510609] Wed, 27 January 2010 23:37 Go to next message
Michael Moser is currently offline Michael Moser
Messages: 914
Registered: July 2009
Senior Member
To familiarize myself with the structure as well as overall startup and stop
behavior of an RCP application I had the wizard create me a new, simple RCP
project ("RCP application with a view"). It runs fine and creates a simple
demo app with a view listing "One", "Two", " Three" that has a single Menu
containing just one entry "Exit". So far - so good.

The only thing I added were a couple of println()'s in the generated
Activator and Application classes.

When starting that as an eclipse application the list of print-out's on the
console reads:
--------------------
Activator-ctor
Activator-start
Application-ctor
Application-start
<selecting File => Exit in the menu>
Activator-stop
--------------------

The begin is working as expected, but what puzzles me here is: the
Application.stop() method is missing! Why? When is that supposed to be
called?

Guessing from the class name I would have expected that one should put the
"meat" of one's Application into exactly that class. But if its stop()
method doesn't get properly called then this is somewhat unlucky if one
intends to properly cleanup, close of files and connections, etc. before
being shut down.

This is using Galileo and a Java 6.0 JRE.

Michael
Re: Example RCP-project: when is Application.stop() supposed to be called? [message #510660 is a reply to message #510609] Thu, 28 January 2010 09:41 Go to previous messageGo to next message
Michael Golovanov is currently offline Michael Golovanov
Messages: 37
Registered: October 2009
Member
Hi, Michael

This is Javadoc about this method:

Quote:
Forces this running application to exit. This method should wait until the running application is ready to exit. The start(IApplicationContext) should already have exited or should exit very soon after this method exits

This method is only called to force an application to exit. This method will not be called if an application exits normally from the start(IApplicationContext) method.

Note: This method is called by the platform; it is not intended to be called directly by clients




Regards,
Michael Golovanov
Re: Example RCP-project: when is Application.stop() supposed to be called? [message #511552 is a reply to message #510660] Tue, 02 February 2010 00:07 Go to previous message
Michael Moser is currently offline Michael Moser
Messages: 914
Registered: July 2009
Senior Member
"Michael Golovanov" <mike.golovanov@gmail.com> wrote in message
news:hjrm3t$d55$1@build.eclipse.org...
> Hi, Michael
>
> This is Javadoc about this method:
>
> Quote:
>> Forces this running application to exit. This method should wait until
>> the running application is ready to exit. The start(IApplicationContext)
>> should already have exited or should exit very soon after this method
>> exits
>>
>> This method is only called to force an application to exit. This method
>> will not be called if an application exits normally from the
>> start(IApplicationContext) method. Note: This method is called by the
>> platform; it is not intended to be called directly by clients
>
>
>
> Regards, Michael Golovanov

Aha! Guess, I need to install the eclipse sources as well, so that I get
these Javadocs displayed, too...

Thanks!
Michael
Previous Topic:Custom StatusHandler subclassing problem
Next Topic:Multi Plugin Project Problems with Menu
Goto Forum:
  


Current Time: Wed Oct 22 06:40:15 GMT 2014

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

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