RAP and OSGi Services [message #986932] |
Thu, 22 November 2012 07:17  |
Eclipse User |
|
|
|
Hi,
We have a large number of layered osgi components (stateless "singleton" services) that do not have the notion of sessions.
From the RAP ui there is a call to say "ItemService", ItemService is dynamically bound with a UserAdmin service.
When ItemService is called to receive items, it calls a method in UserAdminService to see if the user is authorized.
In the RCP environment UserAdminService uses a static UserProfile.getLoggedinUser() method but this approach will obviously not work in RAP.
Is there a way to get to the RAP session information from UserAdminService without changing the method signatures?
so in short
RAP UI (1..*) --> ItemService (1) --> UserAdmin (1) --> ?session?
Thanks for helping,
Wim
|
|
|
|
|
|
|
|
|
Re: RAP and OSGi Services [message #987344 is a reply to message #987306] |
Mon, 26 November 2012 03:52  |
Eclipse User |
|
|
|
Right, you *can* access session-scoped data from a background thread if
you have a reference to the user's display. I was hesitating to make
this statement in the first place because this API is under revision for
2.0.
As Chris states, in RAP 1.x, you can use
UICallBack.runNonUIThreadWithFakeContext(Display, Runnable).
For 2.0, stay tuned on the New & Noteworthy pages.
Regards, Ralf
--
Ralf Sternberg
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Powered by
FUDForum. Page generated in 0.04807 seconds