*/
protected void onError(AtmosphereResponse response) {
state = State.DISCONNECTED;
- getConnectionStateHandler().pushError(this);
+ getConnectionStateHandler().pushError(this, response);
}
protected void onClose(AtmosphereResponse response) {
state = State.CONNECT_PENDING;
- getConnectionStateHandler().pushClosed(this);
+ getConnectionStateHandler().pushClosed(this, response);
}
protected void onClientTimeout(AtmosphereResponse response) {
state = State.DISCONNECTED;
- getConnectionStateHandler().pushClientTimeout(this);
+ getConnectionStateHandler().pushClientTimeout(this, response);
}
protected void onReconnect(JavaScriptObject request,
@Override
public void onError(ResourceLoadEvent event) {
- getConnectionStateHandler()
- .pushScriptLoadError(event.getResourceUrl());
+ getConnectionStateHandler().pushScriptLoadError(
+ event.getResourceUrl());
}
});
}
*/
package com.vaadin.client.communication;
+import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.Response;
import com.vaadin.client.ApplicationConnection;
*
* @param pushConnection
* The push connection which was closed
+ * @param response
+ * An object containing response data
*/
- void pushClosed(PushConnection pushConnection);
+ void pushClosed(PushConnection pushConnection,
+ JavaScriptObject responseObject);
/**
* Called when a client side timeout occurs before a push connection to the
*
* @param pushConnection
* The push connection which timed out
+ * @param response
+ * An object containing response data
*/
- void pushClientTimeout(PushConnection pushConnection);
+ void pushClientTimeout(PushConnection pushConnection,
+ JavaScriptObject response);
/**
* Called when a fatal error fatal error occurs in the push connection.
*
* @param pushConnection
* The push connection where the error occurred
+ * @param response
+ * An object containing response data
*/
- void pushError(PushConnection pushConnection);
+ void pushError(PushConnection pushConnection, JavaScriptObject response);
/**
* Called when the push connection has lost the connection to the server and
import java.util.logging.Logger;
+import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.Response;
import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent;
import com.vaadin.client.ApplicationConnection.ApplicationStoppedHandler;
import com.vaadin.client.WidgetUtil;
+import com.vaadin.client.communication.AtmospherePushConnection.AtmosphereResponse;
import com.vaadin.shared.ui.ui.UIState.ReconnectDialogConfigurationState;
import elemental.json.JsonObject;
}
@Override
- public void pushError(PushConnection pushConnection) {
+ public void pushError(PushConnection pushConnection,
+ JavaScriptObject response) {
debug("pushError()");
connection.handleCommunicationError("Push connection using "
- + pushConnection.getTransportType() + " failed!", -1);
+ + ((AtmosphereResponse) response).getTransport() + " failed!",
+ -1);
}
@Override
- public void pushClientTimeout(PushConnection pushConnection) {
+ public void pushClientTimeout(PushConnection pushConnection,
+ JavaScriptObject response) {
debug("pushClientTimeout()");
// TODO Reconnect, allowing client timeout to be set
// https://dev.vaadin.com/ticket/18429
}
@Override
- public void pushClosed(PushConnection pushConnection) {
+ public void pushClosed(PushConnection pushConnection,
+ JavaScriptObject response) {
debug("pushClosed()");
getLogger().info("Push connection closed");
}