From efa2cfaa3ebe8505cbc8066b1cb440a368f9d073 Mon Sep 17 00:00:00 2001 From: Jamie Doornbos Date: Tue, 7 Oct 2008 18:51:55 +0000 Subject: [PATCH] For bureau log redirection, expose a method to detect if it is still running. Throw in the bureau id accessor too. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5416 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../bureau/util/BureauLogRedirector.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/java/com/threerings/bureau/util/BureauLogRedirector.java b/src/java/com/threerings/bureau/util/BureauLogRedirector.java index 53398ac08..d1231f37d 100644 --- a/src/java/com/threerings/bureau/util/BureauLogRedirector.java +++ b/src/java/com/threerings/bureau/util/BureauLogRedirector.java @@ -54,6 +54,23 @@ public class BureauLogRedirector thread.start(); } + /** + * Gets the bureau id this was created with. + */ + public String getBureauId () + { + return _bureauId; + } + + /** + * Returns true if the redirector is still active. Normally this indicates that the launched + * process is still running. + */ + public boolean isRunning () + { + return _reader != null; + } + protected void copyLoop () { String line; @@ -66,6 +83,7 @@ public class BureauLogRedirector log.warning("Failed to read bureau output", "bureauId", _bureauId, e); } finally { StreamUtil.close(_reader); + _reader = null; } }