ch.javasoft.job
Class Executables<R>

java.lang.Object
  extended by ch.javasoft.job.Executables<R>

public class Executables<R>
extends Object

The Executables class contains methods to create executables from jobs, runnables or callables. Invoking the executables exec() or execAndWait() method causes execution in a new thread.


Method Summary
static
<R> Executable<R>
create(Callable<R> callable)
          Creates a new executable from the given callable.
static
<R> Executable<R>
create(Job<R> job)
          Creates a new executable from the given job.
static Executable<Void> create(Runnable runnable)
          Creates a new executable from the given runnable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static <R> Executable<R> create(Job<R> job)
Creates a new executable from the given job. The exec() and execAndWait() methods of the returned executable are processed in a new thread.

Type Parameters:
R - the return type of the job
Parameters:
job - the job to convert into an executable
Returns:
the executable for execution in a new thread

create

public static <R> Executable<R> create(Callable<R> callable)
Creates a new executable from the given callable. The exec() and execAndWait() methods of the returned executable are processed in a new thread.

Type Parameters:
R - the return type of the callable
Parameters:
callable - the callable to convert into an executable
Returns:
the executable for execution in a new thread

create

public static Executable<Void> create(Runnable runnable)
Creates a new executable from the given runnable. The exec() and execAndWait() methods of the returned executable are processed in a new thread.

Parameters:
runnable - the runnable to convert into an executable
Returns:
the executable for execution in a new thread