Example usage for com.google.gwt.http.client RequestBuilder getTimeoutMillis

List of usage examples for com.google.gwt.http.client RequestBuilder getTimeoutMillis

Introduction

In this page you can find the example usage for com.google.gwt.http.client RequestBuilder getTimeoutMillis.

Prototype

public int getTimeoutMillis() 

Source Link

Document

Returns the timeoutMillis previously set by #setTimeoutMillis(int) , or 0 if no timeoutMillis was set.

Usage

From source file:org.fusesource.restygwt.client.dispatcher.CachingRetryingDispatcher.java

License:Apache License

public Request send(Method method, RequestBuilder builder) throws RequestException {

    RequestCallback outerRequestCallback = builder.getCallback();
    final CacheKey cacheKey = new CacheKey(builder);

    final Response cachedResponse = cacheStorage.getResultOrReturnNull(cacheKey);

    if (cachedResponse != null) {

        outerRequestCallback.onResponseReceived(null, cachedResponse);
        return null;

    } else {/*from w  ww .j  av a 2  s .  c om*/

        RequestCallback retryingCallback = new CachingRetryingCallback(builder, outerRequestCallback);
        builder.setCallback(retryingCallback);

        GWT.log("Sending http request: " + builder.getHTTPMethod() + " " + builder.getUrl() + " ,timeout:"
                + builder.getTimeoutMillis(), null);

        String content = builder.getRequestData();

        if (content != null && content.length() > 0) {
            GWT.log(content, null);
        }

        return builder.send();
    }

}

From source file:org.fusesource.restygwt.client.dispatcher.DefaultDispatcher.java

License:Apache License

public Request send(Method method, RequestBuilder builder) throws RequestException {
    GWT.log("Sending http request: " + builder.getHTTPMethod() + " " + builder.getUrl() + " ,timeout:"
            + builder.getTimeoutMillis(), null);

    String content = builder.getRequestData();
    if (content != null && content.length() > 0) {
        GWT.log(content, null);//from w ww  . j av a  2s  .c om
    }
    return builder.send();
}