# HG changeset patch # User Ingo Weinzierl # Date 1315403462 0 # Node ID 3168af23aec51c5f60baa0331db027c242a478aa # Parent 666417d5781c94f990e3e914c6bcd472cd68a00f Added a CallContext.isInBackground() method to determine if an Artifact or a Collection has started a background thread and is currently locked. artifacts/trunk@2666 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 666417d5781c -r 3168af23aec5 ChangeLog --- a/ChangeLog Thu Aug 25 14:30:59 2011 +0000 +++ b/ChangeLog Wed Sep 07 13:51:02 2011 +0000 @@ -1,3 +1,12 @@ +2011-09-07 Ingo Weinzierl + + * artifacts/src/main/java/de/intevation/artifacts/CallContext.java, + artifact-database/src/main/java/de/intevation/artifactdatabase/CollectionCallContext.java, + artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactCallContext.java: + The CallContext got a new method isInBackground() that determines, if + the Artifact or Collection (currently not implemented) has started a + background thread and is locked. + 2011-08-25 Ingo Weinzierl * artifacts-common/src/main/java/de/intevation/artifacts/common/utils/FileTools.java: diff -r 666417d5781c -r 3168af23aec5 artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactCallContext.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactCallContext.java Thu Aug 25 14:30:59 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactCallContext.java Wed Sep 07 13:51:02 2011 +0000 @@ -73,6 +73,11 @@ } + public boolean isInBackground() { + return database.getLockedIds().contains(artifact.getId()); + } + + public Long getTimeToLive() { return artifact.getTTL(); } diff -r 666417d5781c -r 3168af23aec5 artifact-database/src/main/java/de/intevation/artifactdatabase/CollectionCallContext.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/CollectionCallContext.java Thu Aug 25 14:30:59 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/CollectionCallContext.java Wed Sep 07 13:51:02 2011 +0000 @@ -51,6 +51,12 @@ } + public boolean isInBackground() { + log.debug("CollectionCallContext.isInBackground - NOT IMPLEMENTED"); + return false; + } + + public Long getTimeToLive() { log.debug("CollectionCallContext.getTimeToLive - NOT IMPLEMENTED"); return null; diff -r 666417d5781c -r 3168af23aec5 artifacts/src/main/java/de/intevation/artifacts/CallContext.java --- a/artifacts/src/main/java/de/intevation/artifacts/CallContext.java Thu Aug 25 14:30:59 2011 +0000 +++ b/artifacts/src/main/java/de/intevation/artifacts/CallContext.java Wed Sep 07 13:51:02 2011 +0000 @@ -65,6 +65,12 @@ void afterBackground(int action); /** + * Returns true, if the object forked a background thread and has not + * finished it yet. + */ + boolean isInBackground(); + + /** * Access to the global context of the runtime system. * @return The global context. */