Allow unit names to be specified.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1887 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray
2006-08-14 18:05:54 +00:00
parent 14de52cffb
commit f2d299dc77
2 changed files with 25 additions and 0 deletions
@@ -36,6 +36,17 @@ public abstract class RepositoryListenerUnit<T> extends RepositoryUnit
_listener = listener;
}
/**
* Creates a repository listener unit that will report its results to the
* supplied result listener and report the supplied name in
* {@link #toString}.
*/
public RepositoryListenerUnit (String name, ResultListener<T> listener)
{
super(name);
_listener = listener;
}
/**
* Called to perform our persistent action and generate our result.
*/
@@ -27,6 +27,20 @@ import com.samskivert.util.Invoker;
*/
public abstract class RepositoryUnit extends Invoker.Unit
{
/** The default constructor. */
public RepositoryUnit ()
{
}
/**
* Create a RepositoryUnit which will report the supplied name
* in {@link #toString}.
*/
public RepositoryUnit (String name)
{
super(name);
}
// from abstract Invoker.Unit
public boolean invoke ()
{