public abstract class

AbstractRequestFactory

extends IdFactory
implements RequestFactory
java.lang.Object
   ↳ com.google.gwt.requestfactory.shared.impl.IdFactory
     ↳ com.google.gwt.requestfactory.shared.impl.AbstractRequestFactory
Known Direct Subclasses

Class Overview

Base type for generated RF interfaces.

Summary

[Expand]
Inherited Constants
From interface com.google.gwt.requestfactory.shared.RequestFactory
Public Constructors
AbstractRequestFactory()
Public Methods
<T extends BaseProxy> AutoBean<T> createProxy(Class<T> clazz, SimpleProxyId<T> id)
Creates a new proxy with an assigned ID.
<P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId)
Return a request to find a fresh instance of the referenced proxy.
EventBus getEventBus()
Returns the event bus this factory's events are posted on, which was set via initialize(EventBus).
String getHistoryToken(EntityProxyId<?> proxy)
Get a History compatible token that represents the given proxy class.
String getHistoryToken(Class<? extends EntityProxy> clazz)
Get a History compatible token that represents the given class.
Class<? extends EntityProxy> getProxyClass(String historyToken)
Return the class object which may be used to create new instances of the type of this token, via create(Class).
<T extends EntityProxy> EntityProxyId<T> getProxyId(String historyToken)
Return the appropriate EntityProxyId using a string returned from getHistoryToken(EntityProxyId).
RequestTransport getRequestTransport()
ProxySerializer getSerializer(ProxyStore store)
Returns a ProxySerializer that can encode and decode the various EntityProxy and ValueProxy types reachable from the RequestFactory.
void initialize(EventBus eventBus, RequestTransport transport)
Start this request factory with a user-provided transport.
abstract void initialize(EventBus eventBus)
The choice of a default request transport is runtime-specific.
Protected Methods
abstract AutoBeanFactory getAutoBeanFactory()
Implementations of EntityProxies are provided by an AutoBeanFactory, which is itself a generated type.
boolean hasVersionChanged(SimpleProxyId<?> id, String observedVersion)
Used by AbstractRequestContext to quiesce update events for objects that haven't truly changed.
[Expand]
Inherited Methods
From class com.google.gwt.requestfactory.shared.impl.IdFactory
From class java.lang.Object
From interface com.google.gwt.requestfactory.shared.RequestFactory

Public Constructors

public AbstractRequestFactory ()

Public Methods

public AutoBean<T> createProxy (Class<T> clazz, SimpleProxyId<T> id)

Creates a new proxy with an assigned ID.

public Request<P> find (EntityProxyId<P> proxyId)

Return a request to find a fresh instance of the referenced proxy.

Parameters
proxyId an EntityProxyId instance of type P
Returns

public EventBus getEventBus ()

Returns the event bus this factory's events are posted on, which was set via initialize(EventBus).

Returns
  • the EventBus associated with this instance

public String getHistoryToken (EntityProxyId<?> proxy)

Get a History compatible token that represents the given proxy class. It can be processed by getProxyClass(String).

The history token returned for an EntityProxyId associated with a newly-created (future) EntityProxy will differ from the token returned by this method after the EntityProxy has been persisted. Once an EntityProxy has been persisted, the return value for this method will always be stable, regardless of when the EntityProxyId was retrieved relative to the persist operation. In other words, the "future" history token returned for an as-yet-unpersisted EntityProxy is only valid for the duration of the RequestFactory's lifespan.

Parameters
proxy an EntityProxyId instance
Returns

public String getHistoryToken (Class<? extends EntityProxy> clazz)

Get a History compatible token that represents the given class. It can be processed by getProxyClass(String)

Parameters
clazz a Class object for an EntityProxy subclass
Returns

public Class<? extends EntityProxy> getProxyClass (String historyToken)

Return the class object which may be used to create new instances of the type of this token, via create(Class). The token may represent either a proxy instance (see getHistoryToken(EntityProxyId)) or a proxy class (see getProxyClass(String)).

Parameters
historyToken a String token
Returns

public EntityProxyId<T> getProxyId (String historyToken)

Return the appropriate EntityProxyId using a string returned from getHistoryToken(EntityProxyId).

Parameters
historyToken a String token
Returns

public RequestTransport getRequestTransport ()

public ProxySerializer getSerializer (ProxyStore store)

Returns a ProxySerializer that can encode and decode the various EntityProxy and ValueProxy types reachable from the RequestFactory.

Parameters
store a helper object for the ProxySerializer to provide low-level storage access
Returns
  • a new ProxySerializer

public void initialize (EventBus eventBus, RequestTransport transport)

Start this request factory with a user-provided transport.

Parameters
eventBus an EventBus
transport a RequestTransport instance

public abstract void initialize (EventBus eventBus)

The choice of a default request transport is runtime-specific.

Parameters
eventBus an EventBus

Protected Methods

protected abstract AutoBeanFactory getAutoBeanFactory ()

Implementations of EntityProxies are provided by an AutoBeanFactory, which is itself a generated type.

protected boolean hasVersionChanged (SimpleProxyId<?> id, String observedVersion)

Used by AbstractRequestContext to quiesce update events for objects that haven't truly changed.