Mp3dings 
20100427

de.mospace.lang
Interface RunnableQueue.Job

All Superinterfaces:
Runnable
All Known Implementing Classes:
ProcessRunnable
Enclosing class:
RunnableQueue

public static interface RunnableQueue.Job
extends Runnable

A Runnable that can be enqueued to a RunnableQueue.


Method Summary
 int getExitStatus()
          Returns the exit status of this job.
 boolean hasInput()
          Returns whether this job currently has a non-null input.
 void readInputFrom(InputStream stream)
          Requests that this job reads any input it needs from the specified stream.
 void registerExceptionHandler(ExceptionHandler eh)
          Registers an exception handler to deal with exceptions thrown within the run() method.
 void stop()
          Requests that this job stops executing if it is currently running.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getExitStatus

int getExitStatus()
Returns the exit status of this job. Should be zero by default and before the job has run.

Returns:
the exit status of this job

stop

void stop()
Requests that this job stops executing if it is currently running. This method will usually be called on another thread than run(). Implementations may choose to ignore this.


hasInput

boolean hasInput()
Returns whether this job currently has a non-null input. Jobs that don't require any input should always return true.

Returns:
whether this job has a non-null input
See Also:
readInputFrom(InputStream)

readInputFrom

void readInputFrom(InputStream stream)
Requests that this job reads any input it needs from the specified stream. Jobs that don't require any input may ignore this.

Parameters:
stream - the stream to read input from

registerExceptionHandler

void registerExceptionHandler(ExceptionHandler eh)
Registers an exception handler to deal with exceptions thrown within the run() method. By default any exceptions thrown within run should be re-thrown as RuntimeExceptions.

Parameters:
eh - an exception handler

Mp3dings 
20100427