Example usage for com.google.gwt.http.client Response SC_GONE

List of usage examples for com.google.gwt.http.client Response SC_GONE

Introduction

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

Prototype

int SC_GONE

To view the source code for com.google.gwt.http.client Response SC_GONE.

Click Source Link

Usage

From source file:com.vaadin.client.communication.DefaultConnectionStateHandler.java

License:Apache License

@Override
public void heartbeatInvalidStatusCode(Request request, Response response) {
    int statusCode = response.getStatusCode();
    getLogger().warning("Heartbeat request returned " + statusCode);

    if (response.getStatusCode() == Response.SC_GONE) {
        // Session expired
        getConnection().showSessionExpiredError(null);
        stopApplication();/*from w ww. j  ava  2s.  c o m*/
    } else if (response.getStatusCode() == Response.SC_NOT_FOUND) {
        // UI closed, do nothing as the UI will react to this
        // Should not trigger reconnect dialog as this will prevent user
        // input
    } else {
        handleRecoverableError(Type.HEARTBEAT, null);
    }
}