|
GWT 2.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.requestfactory.client.DefaultRequestTransport
public class DefaultRequestTransport
An implementation of RequestTransport that uses a
RequestBuilder.
This implementation will send RequestEvent objects to the
EventBus passed into the constructor to provide indication of
transport-level activity. When an HTTP request is sent, an event with a
RequestEvent.State.SENT state and a null Request will be posted.
When an HTTP transport completes successfully, an event will be posted with
state RequestEvent.State.RECEIVED and the Request object provided to the
internal RequestCallback#onResponseReceived(). If an HTTP transport
fails (e.g. due to network malfunction), an event with state
RequestEvent.State.RECEIVED and a null Request will be sent. The
success or failure of the HTTP transport is wholly independent from whether
or not the application payload was successfully executed by the server.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.google.gwt.requestfactory.shared.RequestTransport |
|---|
RequestTransport.TransportReceiver |
| Field Summary | |
|---|---|
static java.lang.String |
URL
The default URL for a DefaultRequestTransport is which may be
overridden by calling setRequestUrl(String). |
| Constructor Summary | |
|---|---|
DefaultRequestTransport(EventBus eventBus)
Construct a DefaultRequestTransport. |
|
| Method Summary | |
|---|---|
protected void |
configureRequestBuilder(RequestBuilder builder)
Override to change the headers sent in the HTTP request. |
protected RequestBuilder |
createRequestBuilder()
Constructs a RequestBuilder using the RequestBuilder.POST method
sent to the URL returned from getRequestUrl(). |
protected RequestCallback |
createRequestCallback(RequestTransport.TransportReceiver receiver)
Creates a RequestCallback that maps the HTTP response onto the TransportReceiver interface. |
java.lang.String |
getRequestUrl()
Returns the current URL used by this transport. |
void |
send(java.lang.String payload,
RequestTransport.TransportReceiver receiver)
Called by the RequestFactory implementation. |
void |
setRequestUrl(java.lang.String url)
Override the default URL used by this transport. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String URL
GWT.getHostPageBaseURL() + "gwtRequest" which may be
overridden by calling setRequestUrl(String).
| Constructor Detail |
|---|
public DefaultRequestTransport(EventBus eventBus)
eventBus - the same EventBus passed into
RequestFactory.initialize.| Method Detail |
|---|
public java.lang.String getRequestUrl()
public void send(java.lang.String payload,
RequestTransport.TransportReceiver receiver)
RequestTransport
send in interface RequestTransportpublic void setRequestUrl(java.lang.String url)
protected void configureRequestBuilder(RequestBuilder builder)
protected RequestBuilder createRequestBuilder()
RequestBuilder.POST method
sent to the URL returned from getRequestUrl().
protected RequestCallback createRequestCallback(RequestTransport.TransportReceiver receiver)
TransportReceiver interface.
|
GWT 2.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||