Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Reload Java Class (i.e. a ViewPart) on Runtime
Reload Java Class (i.e. a ViewPart) on Runtime [message #521107] Tue, 16 March 2010 13:44 Go to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Hello there

is it possible to reload some Views, Editor, or other Java Classes while running a RAP Application? I wish i.e. to add new functionality to a existing view, so next time the view is reopened on the client side, the new class implementation should be loaded?

Greetings, Edin
Re: Reload Java Class (i.e. a ViewPart) on Runtime [message #521132 is a reply to message #521107] Tue, 16 March 2010 09:50 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Hi Edin,
if I understand your question correctly, you want to change i.e. a
ViewPart Implementation during runtime. Maybe triggered by a user's
interaction. Am I right?

I see no way to do this with Eclipse Techniques. But I think this is
not an eclipse problem. Instead it's more a question on software
design. You may check the proxy design pattern [1] to see how
implementations could change durign runtime. I think this is exactly
what you need.

Feel free to ask if something is not clear.

Regards Holger

[1] http://en.wikipedia.org/wiki/Proxy_pattern

On 2010-03-16 14:44:55 +0100, ededagic <dedagic@acsa-consulting.de> said:

> Hello there
>
> is it possible to reload some Views, Editor, or other Java Classes
> while running a RAP Application? I wish i.e. to add new functionality
> to a existing view, so next time the view is reopened on the client
> side, the new class implementation should be loaded?
>
> Greetings, Edin


--
-----------------------------------------

http://eclipsesource.com

http://twitter.com/eclipsesource
Re: Reload Java Class (i.e. a ViewPart) on Runtime [message #521144 is a reply to message #521132] Tue, 16 March 2010 14:57 Go to previous messageGo to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Hey Holger,

thny for your answer, but that is not what i want. Actually i just want to have sth. like dynamically reloading Java classes while the RAP Application is running. I.e. i have a ViewPart with a button and, i start the RAP application with that view. So after a while i check that my view should have two buttons. So i add that second button to the source, create class file, and want to use that new class file instead of old one. but without retarting the RAP app. dynamically loading and reloading class with normal java isnt a problem. but i dont know if its possible with RAP? i want, that when user logs in next time (or in best way, reopen the view), he get that new view instance with two buttons, without restarting the whole RAP app.

hope now its clear, otherwise i can write to you a mail on german if you like.

Greetings, Edin
Re: Reload Java Class (i.e. a ViewPart) on Runtime [message #521157 is a reply to message #521144] Tue, 16 March 2010 15:25 Go to previous messageGo to next message
Holger Staudacher is currently offline Holger StaudacherFriend
Messages: 166
Registered: July 2009
Senior Member
Oh ok,
so to replace classes you can use OSGi. Just load a new bundle (should
have a newer version than the old one) with your ViewPart Impl and
Extension. Just google a little bit about OSGi/Equinox and how to load
bundles.

Hope this may help.

Regards Holger

On 2010-03-16 15:57:17 +0100, ededagic <dedagic@acsa-consulting.de> said:

> Hey Holger,
>
> thny for your answer, but that is not what i want. Actually i just want
> to have sth. like dynamically reloading Java classes while the RAP
> Application is running. I.e. i have a ViewPart with a button and, i
> start the RAP application with that view. So after a while i check that
> my view should have two buttons. So i add that second button to the
> source, create class file, and want to use that new class file instead
> of old one. but without retarting the RAP app. dynamically loading and
> reloading class with normal java isnt a problem. but i dont know if its
> possible with RAP? i want, that when user logs in next time (or in best
> way, reopen the view), he get that new view instance with two buttons,
> without restarting the whole RAP app.
>
> hope now its clear, otherwise i can write to you a mail on german if you like.
>
> Greetings, Edin


--
-----------------------------------------

http://eclipsesource.com

http://twitter.com/eclipsesource
Re: Reload Java Class (i.e. a ViewPart) on Runtime [message #521164 is a reply to message #521157] Tue, 16 March 2010 15:53 Go to previous messageGo to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Ok, that with Osgi we are looking now, but its not so comfrotable as wanted. we have some kind of admin viewpart inside our application, and from there we would like to reload some views. with osgi you have to reload projects with more classes. that means that we should have one project per view. we will do it if necessary, but i would prefer the way to reload single classes if possible.
on the other hand, as i undestand reloading new version of osgi bundle works from console. is it possible to do it programatically, and if someone is using that app at the moment of reloading, will he be able to continue working within that session?

Regards, Edin
Re: Reload Java Class (i.e. a ViewPart) on Runtime [message #521936 is a reply to message #521164] Fri, 19 March 2010 11:39 Go to previous message
Onno  is currently offline Onno Friend
Messages: 7
Registered: September 2009
Junior Member
Hi Edin,

yes, you can start/stop/update/install/remove osgi bundles programmatically. You'll find everything you need in the osgi javadocs. Have a look at the Bundle Interface and the BundleContext Interface.
As far as i know, the current sessions will stay valid.

If you are working with custom widgets that contain their own custom client-side qooxdoo classes, you may run into problems. RAP 1.2 prepares the javascript code for the client at application startup and therefore will not deliver JS-code to the client, which wasn't present at startup.

Regards,
Onno Hensgen
Previous Topic:Error disposing image resource
Next Topic:Your advice about rap
Goto Forum:
  


Current Time: Mon Oct 07 05:29:45 GMT 2024

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

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

Back to the top