commit | bfb55374e0c35dd1da99c7b618fded8386ccf1fd | [log] [tgz] |
---|---|---|
author | Felix Meschberger <fmeschbe@apache.org> | Wed Oct 20 21:18:31 2010 +0000 |
committer | Felix Meschberger <fmeschbe@apache.org> | Wed Oct 20 21:18:31 2010 +0000 |
tree | ee11209c382afd4493f0b143431794d11fe349da | |
parent | 0192619097ec1954850c6ef5d6858b85c606abf5 [diff] |
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,