1 package org.simantics.document.server;
\r
3 import java.util.List;
\r
5 import org.simantics.Logger;
\r
6 import org.simantics.db.procedure.Listener;
\r
8 public class DocumentHistoryListener implements Listener<List<JSONObject>> {
\r
10 final private DocumentHistory history;
\r
12 private boolean disposed = false;
\r
14 DocumentHistoryListener(DocumentHistory history) {
\r
15 this.history = history;
\r
19 public void execute(List<JSONObject> result) {
\r
21 synchronized(history) {
\r
23 history.refresh(result);
\r
24 if(!history.hasListeners()) {
\r
25 history.removeUpdater();
\r
34 public void exception(Throwable t) {
\r
35 Logger.defaultLogError(t);
\r
39 public boolean isDisposed() {
\r
41 synchronized(history) {
\r
42 if(!history.hasListeners()) {
\r
43 history.removeUpdater();
\r