Provides generic support for the 'inner worker thread' coding pattern
where child classes are shielded from most of the processing mechanics.
Subclasses will need to implement
AbstractExecutable.work() , which will be called from
the inner worker thread.
Exactly how often or in what kind of thread configuration the
work() method can be customized by passing in a custom
Executor . If none is provided, a single new thread will be created.
The worker passed to this executor will never
Thread.sleep(long) ,
but it will
Thread.yield after each call to
work() .
Note that this class is
Active , and extends from
AbstractActive . As such, you should not override the
AbstractExecutable.initialize() nor the
AbstractExecutable.dispose() methods, but only ever
override
AbstractExecutable.doInitialize() and/or
AbstractExecutable.doDispose() . When you do,
make sure to call the overridden methods as well.
author: Leo Simons version: $Id: AbstractExecutable.java,v 1.1 2004/03/23 13:37:57 lsimons Exp $ |