public interface

RequestContext

com.google.gwt.requestfactory.shared.RequestContext
Known Indirect Subclasses

Class Overview

The base interface for RequestFactory service endpoints.

Summary

Public Methods
abstract <T extends BaseProxy> T create(Class<T> clazz)
Returns a new mutable proxy that this request can carry to the server, perhaps to be persisted.
abstract <T extends BaseProxy> T edit(T object)
Returns a mutable version of the proxy, whose mutations will accumulate in this context.
abstract void fire(Receiver<Void> receiver)
For receiving errors or validation failures only.
abstract void fire()
Send the accumulated changes and method invocations associated with the RequestContext.
abstract boolean isChanged()
Returns true if any changes have been made to proxies mutable under this context.

Public Methods

public abstract T create (Class<T> clazz)

Returns a new mutable proxy that this request can carry to the server, perhaps to be persisted. If the object is succesfully persisted, a PERSIST event will be posted including the EntityProxyId of this proxy.

Parameters
clazz a Class object of type T
Returns

public abstract T edit (T object)

Returns a mutable version of the proxy, whose mutations will accumulate in this context. Proxies reached via getters on this mutable proxy will also be mutable.

Parameters
object an instance of type T
Returns

public abstract void fire (Receiver<Void> receiver)

For receiving errors or validation failures only.

Parameters
receiver a Receiver instance
Throws
IllegalArgumentException if receiver is null

public abstract void fire ()

Send the accumulated changes and method invocations associated with the RequestContext.

If to(Receiver) has not been called, this method will install a default receiver that will throw a RuntimeException if there is a server failure.

public abstract boolean isChanged ()

Returns true if any changes have been made to proxies mutable under this context. Note that vacuous changes — e.g. foo.setName(foo.getName() — will not trip the changed flag. Similarly, "unmaking" a change will clear the isChanged flag

 String name = bar.getName();
 bar.setName("something else");
 assertTrue(context.isChanged());
 bar.setName(name);
 assertFalse(context.isChanged());
 

Returns
  • true if any changes have been made