requestfactory

RequestFactory client-side inheritance of typed class with generics

自闭症网瘾萝莉.ら 提交于 2019-12-04 05:16:13
问题 I would like to know, is it possible to use generic classes of request factory proxy/context for common actions for all entities, like getById(Long id) . In my app I will have many dictionaries like classes, that will have only id and name parameters, so I would like to write once functionality and use it through inheritance in rest classes: Here is server implementation: Domain model classes @MappedSuperclass public class GenericModel<T extends GenericModel<T>> implements Identifiable,

Intercepting GWT RequestFactory requests

女生的网名这么多〃 提交于 2019-12-03 14:19:53
Is there a way to intercept RequestFactory requests on client side? I want to intercept calls like this: dummyRequest.dummyOperation().fire( new Receiver<String>() { @Override public void onSuccess(String response) { } }); The idea is to show some loading indication when communicating with server. You can override the default transport implementation and pass it during RF initialization: SampleRequestFactory factory = GWT.create( SampleRequestFactory.class ); factory.initialize( new SimpleEventBus(), new DefaultRequestTransport() ); You can inherit from DefaultRequestTransport and override the

GWT RequestFactory and multiple requests

跟風遠走 提交于 2019-12-03 10:03:53
问题 Is there a way to use RequestFactory to create two entities in a single request? I tried: EmployeeRequest request = requestFactory.employeeRequest(); EmployeeProxy newEmployee = request.create(EmployeeProxy.class); newEmployee.setName("Joe!"); Request<Void> createReq = request.persist().using(newEmployee); createReq.fire(); EmployeeProxy newEmployee2 = request.create(EmployeeProxy.class); newEmployee2.setName("Sam!"); Request<Void> createReq2 = request.persist().using(newEmployee2);

GWT 2.4.0 RequestFactory polymorphism

自古美人都是妖i 提交于 2019-12-03 09:08:22
Does GWT 2.4 support this case: @Entity class MyBase {...} @Entity class MyChild1 extends MyBase {...} @Entity class MyChild2 extends MyBase {...} ... @ProxyFor(MyBase.class) class MyBaseProxy extends EntityProxy {...} @ProxyFor(MyChild1.class) class MyChild1Proxy extends MyBaseProxy {...} @ProxyFor(MyChild2.class) class MyChild2Proxy extends MyBaseProxy {...} ... @Service(ArticleBase.class) public interface MyBaseRequest extends RequestContext { Request<MyBaseProxy> getStuff(); // MyChild1 here } ... Request<MyBaseProxy> getStuffRequest = request.getStuff(); getStuffRequest.fire(new Receiver

GWT RequestFactory not persisting attached entities

岁酱吖の 提交于 2019-12-03 08:54:38
I'm trying to get the hang of the new RequestFactory API and having a really tough time of it. My domain models consist of a Staffer , a Person and an Office . Staffer has a Person and an Office as fields. When I try to save updates to a Staffer instance in GWT, on the server-side persist() call I see the updates in its primitive/String fields, but I do not see updates to the attached Person or Office objects. Here is how I'm affecting the edits on the GWT side: private void persistStafferDetails() { CRMRequestFactory.StafferRequest stafferRequest = requestFactory.stafferRequest(); staffer =

GWT RequestFactory: how to use single EntityManager per request

江枫思渺然 提交于 2019-12-03 08:53:52
问题 In order to get RequestFactory to persist attached entities, I need to ensure that I use the same EntityManager for each request. I cobbled together my own Factory class for this based on a ThreadLocal implementation, but I'm unsure how to properly release resources (e.g. how to know that the request has finished and call close() ). Is there a simple way to ensure that a single EntityManager is used throughout a given ServletRequest without resorting to full-on J2EE/CDI? I'll take that route

RequestFactory slow on Android

家住魔仙堡 提交于 2019-12-03 08:27:27
I am using RequestFactory with appengine and android. It has been working great, however when I retrieve a list of objects of any size(around 400) it has a very delayed response. It appears that the transfer of data happens fairly quickly(~4 secs), however I do not get the onSuccess() callback until much later(1-2 mins or greater). I am guessing this could be slow performance of parsing within requestfactory. My objects are just POJOs with about 10 fields of text and longs. My question is has anyone come across this? Anyone have a more efficient way to get lots of data off of appengine quickly

GWT RequestFactory: How can I get a persistent id from stableId()?

北慕城南 提交于 2019-12-03 07:42:18
问题 I use Long ids in my entities, not only to store them in the datastore, but to reference other entities. Now, I'm using RequestFactory to create() objects on the client and persist them, but I need a way to figure out what id the server has generated. Here's one way I've figured out that requires two trips: final OrganizationProxy proxy = context.create(OrganizationProxy.class); context.persist().using(proxy).fire(new Receiver<Void>(){ public void onSuccess(Void response) { requestFactory

GWT Requestfactory performance suggestions

纵饮孤独 提交于 2019-12-03 07:08:16
I am observing really bad performance when using GWT requestfactory. For example, a request that takes my service layer 2 seconds to fullfil is taking GWT 20 seconds to serialize. My service is returning ~100 what will be EntityProxies. Each of these objects has what will become 4 ValueProxies and 2 more EntityProxies (100 root level EntityProxies, 400 ValueProxies and 200 additional EntityProxies). However, I see the same 10x performance degradation on much smaller datasets. Example of log snippet: D 2012-10-18 22:42:39.546 ServiceLayerDecorator invoke: Inoking service layer took 2265 ms D

GWT RequestFactory examples?

荒凉一梦 提交于 2019-12-03 04:32:33
问题 Do you know where i can find some code examples for the new GWT 2.1 RequestFactory? Google's tutorial is not good enough to begin with. 回答1: please check this http://javaasylum.blogspot.com/2010/11/gwt-21-request-factory.html and from googler : https://wave.google.com/wave/?pli=1#restored:wave:googlewave.com!w%252BWU4iAICkI.1 回答2: And written in 2011 there are these tutorials which use ServiceLocators and show how to split the server side code using DAOs. http://cleancodematters.wordpress.com