public CometClientTransportWrapper() {
      // Websocket support not enabled yet

      if (webSocketsEnabled && WebSocketCometTransport.hasWebSocketSupport()) {
        transport = new WebSocketCometTransport();
      } else {
        transport = GWT.create(CometTransport.class);
      }
      GWT.log("Created transport: " + transport.getClass().getName());
      transport.initiate(AtmosphereClient.this, this);
    }
 @Override
 public void onDisconnected() {
   cancelTimers();
   if (transport instanceof WebSocketCometTransport && webSocketSuccessful == false) {
     // server doesn't support WebSocket's degrade the connection ...
     logger.info("Server does not support WebSockets");
     transport = GWT.create(CometTransport.class);
     transport.initiate(AtmosphereClient.this, this);
     transport.connect(++connectionCount);
   } else {
     doOnDisconnected(this);
   }
 }
 @Override
 public void onError(Throwable exception, boolean connected) {
   cancelTimers();
   if (transport instanceof WebSocketCometTransport && webSocketSuccessful == false) {
     if (connected) {
       transport.disconnect();
     }
   } else {
     doOnError(exception, connected, this);
   }
 }
 public void disconnect() {
   cancelTimers();
   transport.disconnect();
 }
 public void connect() {
   connectionTimer.schedule(connectionTimeout);
   transport.connect(++connectionCount);
 }
 public void broadcast(List<?> messages) {
   transport.broadcast(messages);
 }
 public void broadcast(Object message) {
   transport.broadcast(message);
 }
 public void post(List<?> messages, AsyncCallback<Void> callback) {
   transport.post(messages, callback);
 }
 public void post(Object message, AsyncCallback<Void> callback) {
   transport.post(message, callback);
 }
Esempio n. 10
0
 public void broadcast(List<Serializable> messages) {
   transport.broadcast(messages);
 }
Esempio n. 11
0
 public void broadcast(Serializable message) {
   transport.broadcast(message);
 }
Esempio n. 12
0
 public void post(List<Serializable> messages, AsyncCallback<Void> callback) {
   transport.post(messages, callback);
 }
Esempio n. 13
0
 public void post(Serializable message, AsyncCallback<Void> callback) {
   transport.post(message, callback);
 }