Create autobean as RF does it

60 views
Skip to first unread message

Eugene Ivlev

unread,
Mar 29, 2012, 6:10:09 AM3/29/12
to Google Web Toolkit
I have such problem:

I use RF as main CRUD client-server interface, but I also use
Atmosphere framework as server-push mechanism.
My aim is multi-client application. All clients must receive
notification about changes made by anyone. The communication looks
like this:


@ProxyFor(TestEntity.class)
TestProxy extends EntityProxy



| |
TestProxy obj |--------RF update entity------>|--- RequestFactory
Servlet
| | |
| | |
| | |
| | |
AutoBean<TestProxy> obj |<--Atmosphere notification-----|<-|
Atmosphere Servlet creates AutoBean<TestProxy>
| with entity to all client |
| |
| |
| |
| |
| |
| |
client server

But RF adds to AutoBean some kind of additional information. Therefore
I can't use autobaen received from Atmosphere in next communication by
RF channel.
How I can create autobean as RF does it?

Thomas Broyer

unread,
Mar 30, 2012, 3:32:03 AM3/30/12
to google-we...@googlegroups.com
Have a look at AbstractRequestContext (particularly the processReturnOperations method; also look for calls to setTag), but basically you'll have to transport more than the AutoBean data: you'll have to send its stableId and version (have a look at SimpleRequestContext et al. for how they're computed).
You'll also have to apply the BaseProxycategory, EntityProxyCategory and ValueProxyCategory to your AutoBeanFactory, and @NoWrap the EntityProxyId. Have a look at the RequestFactoryGenerator or run the DevMode or Compiler with the -gen argument to look at what's generated.

All in all, it might be better (and I really mean *might*, as I have not actually looked at it in details) to use a ProxySerializer or extend the AbstractRequestContext to use RF's serialization.

Search the group, there has been a similar question in the past months (and I made basically the same answer).

JoseM

unread,
Apr 2, 2012, 7:34:41 PM4/2/12
to google-we...@googlegroups.com
Is there a way to a ValueProxy from the same type of object that RF would use to make a ValueProxy but outside of a web server.

I'm looking to use ProxySerializer to get a string of a ValueProxy and send it via some other means to the browser where I can then serialize it back into a ValueProxy.
Reply all
Reply to author
Forward
0 new messages