FELIX-2671 (OSGi Bug 100) Add new isTerminated method

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1025759 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationImpl.java b/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationImpl.java
index cb400e1..5ecef55 100644
--- a/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationImpl.java
+++ b/coordinator/src/main/java/org/apache/felix/coordination/impl/CoordinationImpl.java
@@ -180,6 +180,16 @@
         return state == State.FAILED;
     }
 
+    /**
+     * Returns whether the coordination has ended.
+     * <p>
+     * The return value of <code>false</code> may be a transient situation if
+     * the coordination is in the process of terminating.
+     */
+    public boolean isTerminated() {
+        return state == State.TERMINATED;
+    }
+
     public void addTimeout(long timeOutInMs) {
         if (this.timeOutInMs > 0) {
             // already set, ignore
diff --git a/coordinator/src/main/java/org/apache/felix/service/coordination/Coordination.java b/coordinator/src/main/java/org/apache/felix/service/coordination/Coordination.java
index 6b785d0..d43731c 100644
--- a/coordinator/src/main/java/org/apache/felix/service/coordination/Coordination.java
+++ b/coordinator/src/main/java/org/apache/felix/service/coordination/Coordination.java
@@ -145,6 +145,11 @@
     boolean isFailed();
 
     /**
+     * @return true if this Coordination has terminated, false otherwise.
+     */
+    boolean isTerminated();
+
+    /**
      * Add a minimum timeout for this Coordination. If this timeout expires,
      * then the Coordination will fail and the initiating thread will be
      * interrupted. This method must only be called on an active Coordination,