Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to restart session?
How to restart session? [message #1022836] Fri, 22 March 2013 12:05 Go to next message
Julia Kurde is currently offline Julia Kurde
Messages: 61
Registered: November 2011
Location: Berlin, Germany
Member
Hi,

I'm trying to convert our (quite big) RCP application into an RAP application and it is already runnung Smile! But I'm facing the following problem:

In the RCP, when the application starts, all plugins and their classes are initialized, e.g. variables are given a value like
if (value == null) {value = newValue}
.

But in the RAP this only works the first time the application is startet. If it is stoped by File>Quit, all plugins are still alive. When the application is then started again by reloading the URL, all the old values are still there and the new ones will NOT be set!

Is there any way to start from a fresh session when the application is started?

Thanks for any advice!
Re: How to restart session? [message #1022871 is a reply to message #1022836] Fri, 22 March 2013 13:23 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rüger
Messages: 364
Registered: July 2009
Senior Member
Julia Kurde <forums-noreply@xxxxxxxx> wrote:
> Hi,
>
> I'm trying to convert our (quite big) RCP application into an RAP
> application and it is already runnung :)! But I'm facing the following problem:
>
> In the RCP, when the application starts, all plugins and their classes
> are initialized, e.g. variables are given a value like if (value == null)
> {value = newValue}.
> But in the RAP this only works the first time the application is startet.
> If it is stoped by File>Quit, all plugins are still alive. When the
> application is then started again by reloading the URL, all the old
> values are still there and the new ones will NOT be set!
>
> Is there any way to start from a fresh session when the application is started?
>
> Thanks for any advice!

Hi Julia,

this is normal behavior if you store values in classes like plugin
activator or singletons since they are only created once the class loads or
plugin starts. A plugin is only started one time for all users.

If you want to store values for a user session you must use a session
singleton.

See
http://wiki.eclipse.org/RAP/FAQ%23What_is_a_Session_Singleton_and_how_can_I_implement_one

Regards,
Markus
Re: How to restart session? [message #1022900 is a reply to message #1022871] Fri, 22 March 2013 14:58 Go to previous messageGo to next message
Julia Kurde is currently offline Julia Kurde
Messages: 61
Registered: November 2011
Location: Berlin, Germany
Member
Hi Markus,

Thanks for this info! I'll need some time to get into it...

Just for anyone who can edit the RAP/FAQ pages: There is a broken link in the section "What is a Session Singleton and how can I implement one?"

The correct link is this, I guess:
http://eclipse.org/rap/developers-guide/devguide.php?topic=singletons.html&version=2.0
Re: How to restart session? [message #1039519 is a reply to message #1022900] Fri, 12 April 2013 04:54 Go to previous message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1290
Registered: July 2009
Senior Member

> Just for anyone who can edit the RAP/FAQ pages: There is a broken link
> in the section "What is a Session Singleton and how can I implement one?"

Thanks for the pointer, I've fixed this link.

BTW, it's a public wiki, feel free to edit it yourself whenever you find
something that needs improvement.

Regards, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Focus first Text in Dialog
Next Topic:Cannot deploy to Tomcat 7
Goto Forum:
  


Current Time: Wed Jul 30 15:32:05 EDT 2014

Powered by FUDForum. Page generated in 0.02903 seconds