From 68cfc8fa6c8925ed98ef0c88c3a815a0790f28ae Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 5 Dec 2005 19:41:32 +0000 Subject: [PATCH] Changed the name of the interface implemented by the Runnable we post to a RunQueue to run the expired() method: calling it Runnable resulted in annoyance when one desired to create an anonymous java.lang.Runnable inside one's own Interval. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1737 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/util/Interval.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/util/Interval.java b/projects/samskivert/src/java/com/samskivert/util/Interval.java index e12c4462..05d151b5 100644 --- a/projects/samskivert/src/java/com/samskivert/util/Interval.java +++ b/projects/samskivert/src/java/com/samskivert/util/Interval.java @@ -36,8 +36,13 @@ public abstract class Interval * An interface that will be implemented by the runnable posted * to a RunQueue that can be used to retrieve the original Interval. */ - public static interface Runnable extends java.lang.Runnable + public static interface RunBuddy extends Runnable { + /** + * Retrieve the Interval that is responsible for posting this + * RunBuddy to a RunQueue. Most likely used to call toString() + * on the Interval for logging purposes. + */ public Interval getInterval (); } @@ -159,7 +164,7 @@ public abstract class Interval } else { if (_runner == null) { // lazy initialize _runner - _runner = new Runnable() { + _runner = new RunBuddy() { public void run () { safelyExpire(IntervalTask.this); } @@ -178,7 +183,7 @@ public abstract class Interval } /** If we are using a RunQueue, the Runnable we post to it. */ - protected Runnable _runner; + protected RunBuddy _runner; } /** If non-null, the RunQueue used to run the expired() method for each