org.elkoserver.foundation.run
Class SubRunner

java.lang.Object
  extended by org.elkoserver.foundation.run.SubRunner

public class SubRunner
extends Object

Object which manages a Runner for you. It accepts tasks to do, which it processes on its own asynchronous run queue, and handlers for the results, which it processes on your run queue.


Constructor Summary
SubRunner()
          Start a new sub-runner.
SubRunner(String name)
          Start a new, named sub-runner.
 
Method Summary
 void enqueue(Callable<Object> task, ArgRunnable resultee)
          Enqueue a task for execution.
 void shutdown()
          Shut down this sub-runner's run queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubRunner

public SubRunner()
Start a new sub-runner.


SubRunner

public SubRunner(String name)
Start a new, named sub-runner.

Method Detail

enqueue

public void enqueue(Callable<Object> task,
                    ArgRunnable resultee)
Enqueue a task for execution.

Parameters:
task - Callable that will perform the desired task; runs in this SubRunner's run queue.
resultee - ResultThank that will be given the result from running 'task'; runs in the run queue of the thread that created this SubRunner.

shutdown

public void shutdown()
Shut down this sub-runner's run queue.