Search in sources :

Example 1 with ProgressObserver

use of eu.ggnet.saft.api.progress.ProgressObserver in project dwoss by gg-net.

the class HiddenMonitorDisplayer method run.

@Override
public void run() {
    try {
        ProgressObserver po = Dl.remote().lookup(ProgressObserver.class);
        if (!po.hasProgress())
            return;
        SortedSet<Integer> remoteKeys = po.getActiveProgressKeys();
        // no new progress, all is tracked.
        if (remoteKeys.equals(localKeys))
            return;
        remoteKeys.removeAll(localKeys);
        for (Integer key : remoteKeys) {
            new HiddenMonitorDisplayTask(key, localKeys, view.progressBar, view.messageLabel).execute();
            localKeys.add(key);
        }
    } catch (IllegalArgumentException | NullPointerException ex) {
        LoggerFactory.getLogger(this.getClass()).warn("Exception during progress {}", ex.getMessage());
        // We know, but sometimes you want to se it explode somethere.
        ex.printStackTrace();
    }
}
Also used : ProgressObserver(eu.ggnet.saft.api.progress.ProgressObserver)

Aggregations

ProgressObserver (eu.ggnet.saft.api.progress.ProgressObserver)1