Ejemplo n.º 1
0
  @SuppressWarnings("unchecked")
  private void doneRefresh() {
    refreshState = null;
    CometClientTransportWrapper temp = primaryTransport;
    primaryTransport = refreshTransport;
    refreshTransport = temp;

    listener.onAfterRefresh();

    if (refreshQueue != null) {
      if (refreshQueue.size() > 0) {
        GWT.log("CometClient: pushing queued messages");
      }
      for (Object object : refreshQueue) {
        if (object == REFRESH) {
          doOnRefresh(primaryTransport);
        } else if (object == DISCONNECT) {
          doOnDisconnected(primaryTransport);
        } else {
          doOnMessage((List<?>) object, primaryTransport);
        }
      }
      refreshQueue.clear();
    }
  }
Ejemplo n.º 2
0
 private void failedRefresh() {
   refreshState = null;
   GWT.log("CometClient: Failed refesh");
   // dispatch remaining messages;
   if (refreshQueue != null) {
     for (Object object : refreshQueue) {
       if (object == REFRESH || object == DISCONNECT) {
       } else {
         doOnMessage((List<?>) object, primaryTransport);
       }
     }
     refreshQueue.clear();
   }
   doDisconnect();
   doConnect();
 }