From 356c51ece160e12032ceca1d70a0aacdcdc87b36 Mon Sep 17 00:00:00 2001
From: ribeaudc <ribeaudc>
Date: Mon, 30 Jun 2008 13:14:24 +0000
Subject: [PATCH] change: - Make the shutdown hook in DataMover more robust.

SVN: 6921
---
 .../cisd/common/utilities/CompoundTerminable.java     | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/common/source/java/ch/systemsx/cisd/common/utilities/CompoundTerminable.java b/common/source/java/ch/systemsx/cisd/common/utilities/CompoundTerminable.java
index 0cf0c09f482..85d2f7c8cfb 100644
--- a/common/source/java/ch/systemsx/cisd/common/utilities/CompoundTerminable.java
+++ b/common/source/java/ch/systemsx/cisd/common/utilities/CompoundTerminable.java
@@ -31,6 +31,15 @@ public class CompoundTerminable implements ITerminable
         this.terminables = terminables;
     }
 
+    /**
+     * Terminates given {@link ITerminable}.
+     */
+    protected boolean terminate(final ITerminable terminable)
+    {
+        assert terminable != null : "Unspecified ITerminable";
+        return terminable.terminate();
+    }
+
     //
     // ITerminable
     //
@@ -40,7 +49,7 @@ public class CompoundTerminable implements ITerminable
         boolean ok = true;
         for (final ITerminable terminable : terminables)
         {
-            ok = ok && terminable.terminate();
+            ok = ok && terminate(terminable);
         }
         return ok;
     }
-- 
GitLab