Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Does RAP supports two way communication Client <---> Server?
icon5.gif  Does RAP supports two way communication Client <---> Server? [message #488241] Sat, 26 September 2009 15:14 Go to next message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Hello!

The question is in the title. Does RAP use for the requests AJAX polling or long polling?

Is it possible to make changes to the application on the server side and they will automatically make changes on the client-side like adding some new widgets on the client-side without any preceding activity from the client? Or will the client update its gui only if he makes an request and something changed on the server?

Best regards
Eduard
Re: Does RAP supports two way communication Client <---> Server? [message #488329 is a reply to message #488241] Mon, 28 September 2009 07:17 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi,

RAP uses both approach depending on the use-case. Normally all requests
are regular AJAX requests triggered by any user-interaction like button
clicks or a shell resize.
For special use cases like progress bars, jobs,etc where we need to
update the client without user-interaction, there is a mechanism called
UICallback. The activation and deactivation of the UICallback is done
behind the scenes of regular API but if you need to for other scenarios,
please take a look at the class org.eclipse.rwt.lifecycle.UICallback.

Regards,
Ben

Eduard wrote:
> Hello!
>
> The question is in the title. Does RAP use for the requests AJAX polling
> or long polling?
>
> Is it possible to make changes to the application on the server side and
> they will automatically make changes on the client-side like adding some
> new widgets on the client-side without any preceding activity from the
> client? Or will the client update its gui only if he makes an request
> and something changed on the server?
>
> Best regards
> Eduard


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: Does RAP supports two way communication Client <---> Server? [message #488432 is a reply to message #488241] Mon, 28 September 2009 16:02 Go to previous messageGo to next message
Eduard  is currently offline Eduard Friend
Messages: 29
Registered: September 2009
Junior Member
Ok, but I think the UICallback can't help me in my usecase.

I really need to change the UI on the client-side when an event occurs on the server-side (e. g. an plug-in was installed and the content must be inserted into to the UI of the main RWT apllication).

My understandndig of UICallback so far is, that I only can call UICallback.activate() while I am in an RWT request lifecycle. That means the client-side did a request. The only thing UICallback then does is just keep the connection open and send updates to the client. This is suitable for e. g. jobs which were triggered by some client activation. But it's still not possible to change the UI without any preceding client-request. If I understand it right. Smile

Could I implement a Javascript Timer on the client side which periodicaly sends empty AJAX requests to the client (e. g. every second) and I insert the content to the client through a display.syncExec(new Runnable...)? This is the same as I change the usual behavior of RAP form sending requests only when the client is doing somtheing with the UI to polling.

Is this reasonbale? Maybe there is another way to solve this problem?

Thankful for any hint and help. Smile

Re: Does RAP supports two way communication Client <---> Server? [message #488537 is a reply to message #488432] Tue, 29 September 2009 07:58 Go to previous message
Markus Wolf is currently offline Markus WolfFriend
Messages: 153
Registered: July 2009
Senior Member
It could help you but I'm not show how resource intensive the approach is
for your server.
Start a UICallback in the EntryPoint of you app. Then register the
display of the user with some background thread who gets notified on
required UI updates. This could then in turn update the clients UI.

We do so in our application to display tasks to the user which could
occure at any time without the user updates and popup a view to all users
the task is interesting for. But we have only a few users and I think it
could be hard if you have several hundret users at once because of all
the thread overhead. But maybe I'm wrong with this.

HTH
Markus Wolf


> Ok, but I think the UICallback can't help me in my usecase.
>
> I really need to change the UI on the client-side when an event occurs
> on the server-side (e. g. an plug-in was installed and the content must
> be inserted into to the UI of the main RWT apllication).
>
> My understandndig of UICallback so far is, that I only can call
> UICallback.activate() while I am in an RWT request lifecycle. That means
> the client-side did a request. The only thing UICallback then does is
> just keep the connection open and send updates to the client. This is
> suitable for e. g. jobs which were triggered by some client activation.
> But it's still not possible to change the UI without any preceding
> client-request. If I understand it right. :)
>
> Could I implement a Javascript Timer on the client side which
> periodicaly sends empty AJAX requests to the client (e. g. every second)
> and I insert the content to the client through a display.syncExec(new
> Runnable...)? This is the same as I change the usual behavior of RAP
> form sending requests only when the client is doing somtheing with the
> UI to polling.
>
> Is this reasonbale? Maybe there is another way to solve this problem?
>
> Thankful for any hint and help. :)





--
NMMN - New Media Markets & Networks GmbH
Langbehnstrasse 6, 22761 Hamburg
Geschäftsführung: Kfm. Michael Schütt
Finanzamt HH-Altona - UStID DE 812 699 852 - HRB 71102 Hamburg
HypoVereinsbank - BLZ 200 300 00 - Konto-Nr. 156 29 82

http://www.nmmn.com
Tel.: +49 40 284 118-0 - Fax: +49 40 284118-999
Softwareentwicklung LLynch: -720
Previous Topic:Invalid thread access when loading a Composite class form a Plug-in?
Next Topic:Problem with headless build
Goto Forum:
  


Current Time: Sat May 04 17:30:18 GMT 2024

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

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

Back to the top