Allow invoker units to be easily named.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3022 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2004-06-13 08:03:45 +00:00
parent e5b1d3eda2
commit 86e2a25580
@@ -1,5 +1,5 @@
// //
// $Id: Invoker.java,v 1.14 2003/12/04 18:42:40 mdb Exp $ // $Id: Invoker.java,v 1.15 2004/06/13 08:03:45 mdb Exp $
package com.threerings.presents.util; package com.threerings.presents.util;
@@ -46,6 +46,16 @@ public class Invoker extends LoopingThread
*/ */
public static abstract class Unit implements Runnable public static abstract class Unit implements Runnable
{ {
/** The default constructor. */
public Unit () {}
/** Creates an invoker unit which will report the supplied name in
* {@link #toString}. */
public Unit (String name)
{
_name = name;
}
/** /**
* This method is called on the invoker thread and should be used * This method is called on the invoker thread and should be used
* to perform the primary function of the unit. It can return true * to perform the primary function of the unit. It can return true
@@ -86,6 +96,14 @@ public class Invoker extends LoopingThread
{ {
handleResult(); handleResult();
} }
/** Returns the name of this invoker. */
public String toString ()
{
return _name;
}
protected String _name = "Unknown";
} }
/** /**