Example RCP-project: when is Application.stop() supposed to be called? [message #510609] |
Wed, 27 January 2010 18:37  |
Eclipse User |
|
|
|
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 #511552 is a reply to message #510660] |
Mon, 01 February 2010 19:07  |
Eclipse User |
|
|
|
"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
|
|
|
Powered by
FUDForum. Page generated in 0.04744 seconds