简体   繁体   中英

Singletone Object on Client side in GWT

I want Singletone Object on Client side in GWT .

I want one Singletone Map(String, Map(String, Object) ) ChangeMap(ie, Single object of that ChangeMap for whole application) that will store changes made by any user.

every user can get all changes made by any user.

For example,There are two users ABC and XYZ who have logged in to the GWT App.

Now user ABC has add two Cities and deleted 1 country via Application.

And user XYZ has added two new users and has updated one new role.

Then in that ChangeMap, Values shoud be :

changeMap

{ {"ABC",{"added",City1} }, 
  {"ABC",{"added",City2} } , 
  {"ABC",{"deleted",country1} }, 
  {"XYZ",{"added",User1} }, 
  {"XYZ",{"added",User2} }, 
  {"XYZ",{"updated",Role1} }
}

Well,GWT plays on client side without sending any requests to server other users wont get those effects .

Remember that singleton object must be in the servletVContext not even ib the session so that every user can access it.

When some one done an event by making a server call( RPC ) update that map and send the changes to all other users through some event service .

Here is the code examples of events which i am talking about.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM