Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RWT ServiceManager
RWT ServiceManager [message #1015943] Mon, 04 March 2013 11:13 Go to next message
Tiburon T is currently offline Tiburon T
Messages: 53
Registered: October 2011
Member
Hello!

I have used the new ServiceHandler to register images. I used an incrementing counter to create unique ids seperately for each user session (with SessionSingletonBase ..). I now noticed in a multi user environment, that the ids have to be unique among all client sessions. Is this the intended behavior?

Thanks,
Tiburon
Re: RWT ServiceManager [message #1016128 is a reply to message #1015943] Tue, 05 March 2013 07:49 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

Tiburon,

could you elaborate a bit more what you use these ids for?

Thanks, Ralf

--
Ralf Sternberg

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RWT ServiceManager [message #1016194 is a reply to message #1016128] Tue, 05 March 2013 12:47 Go to previous messageGo to next message
Tiburon T is currently offline Tiburon T
Messages: 53
Registered: October 2011
Member
Hello Ralf,

I use the ids like this (slightly changed example from [1]):

int id = 0; // This comes from a SessionSingleton

ServiceManager manager = RWT.getServiceManager();
String did = "download" + id++;
manager.registerServiceHandler( did, new DownloadServiceHandler() );
String url = manager.getServiceHandlerUrl( did );


I changed the ID generation to this(works fine):

String did = "download" + id++ + RWT.getUISession().getId();


It just seemed a little odd to me, that the ID is not scoped in the UISession.
I thought it might not hurt to post it here, to make sure it is no bug Smile .

Thanks,
Tiburon

[1]http://eclipse.org/rap/noteworthy/2.0/migration-guide/
Re: RWT ServiceManager [message #1016356 is a reply to message #1016194] Wed, 06 March 2013 07:53 Go to previous message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1291
Registered: July 2009
Senior Member

Hi Tiburon,

ServiceHandlers have application scope. Thus you should register them
only once with a fixed id. However, the service handler has access to
the current UISession.

If you need a sequence id for your downloads, you could either increment
it in your service handler directly, or you could append it as parameter
to your URL like this:

String url = manager.getServiceHandlerUrl( shid )
+ "&downloadId=" + id++;

HTH,
Ralf

--
Ralf Sternberg

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Checking Browser type & Version Number
Next Topic:Client-side javascript error on session timout
Goto Forum:
  


Current Time: Mon Oct 20 11:23:55 GMT 2014

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

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