Example usage for com.vaadin.client.communication ServerRpcQueue isEmpty

List of usage examples for com.vaadin.client.communication ServerRpcQueue isEmpty

Introduction

In this page you can find the example usage for com.vaadin.client.communication ServerRpcQueue isEmpty.

Prototype

public boolean isEmpty() 

Source Link

Document

Checks if the queue is empty.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.timer.CubaTimerConnector.java

License:Apache License

public void onTimer() {
    if (running) {
        if (getState().listeners) {
            ServerRpcQueue rpcQueue = getConnection().getServerRpcQueue();

            if (rpcQueue.isEmpty() || !rpcQueue.isFlushPending()) {
                // if application stopped we will not schedule new timer event
                if (getConnection().isApplicationRunning()) {
                    rpc.onTimer();/*from  w w w .ja  v a2  s  .  c o  m*/
                }
            } else {
                jsTimer.schedule(DEFFERED_DELAY_MS);
            }
        } else {
            requestCompleted();
        }
    }
}