Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » shared singleton synchronization
shared singleton synchronization [message #777386] Tue, 10 January 2012 11:45 Go to next message
frank b is currently offline frank bFriend
Messages: 45
Registered: July 2009
Member
Hello RAP users,

I have a collection that have to be shared across users of my RAP
application. The content of this collection is to be shown in a web page
through a tree viewer. Obviously, all users can access this collection
and also modify it. As this collection is a shared singleton, I have to
take care of concurrency problems.

I know only two solutions to this problem :

1) Duplicate entirely or partially the collection for each user session.
As this instance will be contained in only one user thread session,
there is no more synchronization problem, except when user want to apply
modification. In that case, any kind of synchronized or timed out lock
can do the job. But I need to regularly update all UI users : implies to
call setInput of tree viewer with a new synchronized updated instance of
the collection at regular interval. And what about memory allocation ?

2) Publish the collection outside of its container. In that case, I
Think I have to synchronize all my data model. The advantage is that all
UI users are updated with a simple call to refresh of the tree viewer.

What do you think about that ? What do you usually do ? Are there any
other solutions ?

Thanks a lot for your help,
frank
Re: shared singleton synchronization [message #780628 is a reply to message #777386] Wed, 18 January 2012 20:07 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
I am not an expert here but first thing comes to mind is RWT.getApplicationStore().

http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.rap.help%2Fhelp%2Fhtml%2Freference%2Fapi%2Forg%2Feclipse%2Frwt%2FRWT.html
Re: shared singleton synchronization [message #782204 is a reply to message #780628] Mon, 23 January 2012 10:43 Go to previous messageGo to next message
Yury Mising name is currently offline Yury Mising nameFriend
Messages: 95
Registered: May 2010
Location: Russia
Member
Regular singleton observable java object (actually the store for your shared data) with right synchronization will solve the problem I guess. It is not a RAP topic.

[Updated on: Mon, 23 January 2012 10:44]

Report message to a moderator

Re: shared singleton synchronization [message #782207 is a reply to message #780628] Mon, 23 January 2012 10:43 Go to previous messageGo to next message
Yury is currently offline YuryFriend
Messages: 7
Registered: July 2009
Junior Member
Regular singleton observable java object such as store for your shared data with right synchronization will solve the problem I guess. It is not a RAP topic.
Re: shared singleton synchronization [message #782689 is a reply to message #777386] Tue, 24 January 2012 08:35 Go to previous message
frank b is currently offline frank bFriend
Messages: 45
Registered: July 2009
Member
Hello Yuri and Ronald,

thanks alot for your responses.

And yes Yuri, you are absolutely right : this a general servlet topic
and perhaps an even more general one...

But I've not found a forum based on this kind of topic and as I'm
working with RAP and encounter this problem, I've thought that someone
could give some links...

thanks,
frank
Previous Topic:How to use untyped events in RAP
Next Topic:Larger difference between the theme 1.4 and 1.5
Goto Forum:
  


Current Time: Sat Oct 16 16:16:58 GMT 2021

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

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

Back to the top