]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
More DB ListenerAdapter abstract to force isDisposed implementation 67/1167/2
authorjsimomaa <jani.simomaa@gmail.com>
Tue, 31 Oct 2017 06:14:30 +0000 (08:14 +0200)
committerJani Simomaa <jani.simomaa@semantum.fi>
Tue, 31 Oct 2017 06:15:13 +0000 (08:15 +0200)
This forces the user of the adapter to still handle the life-cycle of
the listener, which should never be neglected.

refs #7581

Change-Id: I1d30f6ed8b1a3d861185b7ea36ecbab38f07171a

bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncMultiListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/AsyncSetListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/MultiListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SetListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncMultiListenerAdapter.java
bundles/org.simantics.db.common/src/org/simantics/db/common/procedure/adapter/SyncSetListenerAdapter.java

index 29c039ca03c508a9ba222fad9c5456e86a9c6817..e7cd7d6c2ba64798a294a006ae34c256c8ca7d0b 100644 (file)
@@ -14,7 +14,7 @@ package org.simantics.db.common.procedure.adapter;
 import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.procedure.AsyncMultiListener;
 
-public class AsyncMultiListenerAdapter<T> implements AsyncMultiListener<T> {
+public abstract class AsyncMultiListenerAdapter<T> implements AsyncMultiListener<T> {
 
     @Override
     public void exception(AsyncReadGraph graph, Throwable t) {
@@ -29,8 +29,6 @@ public class AsyncMultiListenerAdapter<T> implements AsyncMultiListener<T> {
     }
 
     @Override
-    public boolean isDisposed() {
-        return false;
-    }
+    public abstract boolean isDisposed();
 
 }
index 2e8fcf459cdd3b84c5d233c849c3d04381a6f912..44bbfc02a8ff2ef306aa3bdf14a7f20d12a910f5 100644 (file)
@@ -14,7 +14,7 @@ package org.simantics.db.common.procedure.adapter;
 import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.procedure.AsyncSetListener;
 
-public class AsyncSetListenerAdapter<T> implements AsyncSetListener<T> {
+public abstract class AsyncSetListenerAdapter<T> implements AsyncSetListener<T> {
 
     @Override
     public void exception(AsyncReadGraph graph, Throwable t) {
@@ -29,8 +29,6 @@ public class AsyncSetListenerAdapter<T> implements AsyncSetListener<T> {
     }
 
     @Override
-    public boolean isDisposed() {
-        return false;
-    }
+    public abstract boolean isDisposed();
 
 }
index cb7d93e3208e08017080e952d245caebf3ad57ef..3dc1a495abe2f98cfaca69be39bcf67057521f56 100644 (file)
@@ -13,7 +13,7 @@ package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.procedure.MultiListener;
 
-public class MultiListenerAdapter<Result> implements MultiListener<Result> {
+public abstract class MultiListenerAdapter<Result> implements MultiListener<Result> {
     
     @Override
     public void execute(Result result) {
@@ -28,8 +28,6 @@ public class MultiListenerAdapter<Result> implements MultiListener<Result> {
     }
 
     @Override
-    public boolean isDisposed() {
-        return false;
-    }
+    public abstract boolean isDisposed();
        
 }
index 79daa2ebdf94053106948a9e829cdb311a87bc53..2e306927143c7108fe9d92a42cf73b831174e32e 100644 (file)
@@ -13,7 +13,7 @@ package org.simantics.db.common.procedure.adapter;
 
 import org.simantics.db.procedure.SetListener;
 
-public class SetListenerAdapter<T> implements SetListener<T> {
+public abstract class SetListenerAdapter<T> implements SetListener<T> {
 
     @Override
     public void exception(Throwable t) {
@@ -28,8 +28,6 @@ public class SetListenerAdapter<T> implements SetListener<T> {
     }
 
     @Override
-    public boolean isDisposed() {
-        return false;
-    }
+    public abstract boolean isDisposed();
 
 }
index a868613497e2f6d3c61a2b62e91d22827f541de9..53903b61ea128cff390dc66dd152222213924f63 100644 (file)
@@ -14,7 +14,7 @@ package org.simantics.db.common.procedure.adapter;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.procedure.SyncMultiListener;
 
-public class SyncMultiListenerAdapter<T> implements SyncMultiListener<T> {
+public abstract class SyncMultiListenerAdapter<T> implements SyncMultiListener<T> {
 
     @Override
     public void exception(ReadGraph graph, Throwable t) {
@@ -29,8 +29,6 @@ public class SyncMultiListenerAdapter<T> implements SyncMultiListener<T> {
     }
 
     @Override
-    public boolean isDisposed() {
-        return false;
-    }
+    public abstract boolean isDisposed();
 
 }
index da2febfa1185a6fa0578bdfa8971d7712e7aac92..3d61e5bfac028c2cd622a03d6891d76dcddef3f3 100644 (file)
@@ -14,7 +14,7 @@ package org.simantics.db.common.procedure.adapter;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.procedure.SyncSetListener;
 
-public class SyncSetListenerAdapter<T> implements SyncSetListener<T> {
+public abstract class SyncSetListenerAdapter<T> implements SyncSetListener<T> {
 
     @Override
     public void exception(ReadGraph graph, Throwable t) {
@@ -29,8 +29,6 @@ public class SyncSetListenerAdapter<T> implements SyncSetListener<T> {
     }
 
     @Override
-    public boolean isDisposed() {
-        return false;
-    }
+    public abstract boolean isDisposed();
 
 }