java implementation for task base class