]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/ExecutionScope.java
Deal with destruction callbacks
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / ExecutionScope.java
index 3605d03a31892893464edded4395f3158f857e2c..42fc59522e4cb16e7def6765913e45a6bfe5d8e4 100644 (file)
@@ -131,8 +131,11 @@ public class ExecutionScope implements Scope {
        }
 
        public void registerDestructionCallback(String name, Runnable callback) {
-               // TODO: implement it
-               // throw new UnsupportedOperationException();
+               if (Thread.currentThread() instanceof ExecutionThread) {
+                       ExecutionThread executionThread = (ExecutionThread) Thread
+                                       .currentThread();
+                       executionThread.registerDestructionCallback(name, callback);
+               }
        }
 
        public Object remove(String name) {