|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface RequestContext
The base interface for RequestFactory service endpoints. Implementations of this interface are provided by the RequestFactory plumbing and this interface may be extended in the future.
FakeRequestContext| Method Summary | ||
|---|---|---|
|
append(T other)
Joins another RequestContext to this RequestContext. |
|
|
create(java.lang.Class<T> clazz)
Returns a new mutable proxy that this request can carry to the server, perhaps to be persisted. |
|
|
edit(T object)
Returns a mutable version of the proxy, whose mutations will accumulate in this context. |
|
|
find(EntityProxyId<P> proxyId)
Return a request to find a fresh instance of the referenced proxy. |
|
void |
fire()
Send the accumulated changes and method invocations associated with the RequestContext. |
|
void |
fire(Receiver<java.lang.Void> receiver)
For receiving errors or validation failures only. |
|
RequestFactory |
getRequestFactory()
Returns the RequestFactory that created the RequestContext. |
|
boolean |
isChanged()
Returns true if any changes have been made to proxies mutable under this context. |
|
| Method Detail |
|---|
<T extends RequestContext> T append(T other)
SomeContext ctx = myFactory.someContext(); // Perform operations on ctx OtherContext other = ctx.append(myFactory.otherContext()); // Perform operations on both other and ctx ctx.fire() // or other.fire() are equivalent
other - a freshly-constructed RequestContext whose state should be
bound to this RequestContext
other
java.lang.IllegalStateException - if any methods have been called on
other or if other was constructed by a different
RequestFactory instance<T extends BaseProxy> T create(java.lang.Class<T> clazz)
clazz - a Class object of type T
BaseProxy instance of type T<T extends BaseProxy> T edit(T object)
object - an instance of type T
EntityProxy or ValueProxy instance of type T<P extends EntityProxy> Request<P> find(EntityProxyId<P> proxyId)
proxyId - an EntityProxyId instance of type P
Request objectvoid fire()
If Request.to(Receiver) has not been called, this method will
install a default receiver that will throw a RuntimeException if there is a
server failure.
void fire(Receiver<java.lang.Void> receiver)
receiver - a Receiver instance
java.lang.IllegalArgumentException - if receiver is
nullRequestFactory getRequestFactory()
RequestFactory that created the RequestContext.
boolean isChanged()
String name = bar.getName();
bar.setName("something else");
assertTrue(context.isChanged());
bar.setName(name);
assertFalse(context.isChanged());
true if any changes have been made
|
GWT 2.7.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||