common.threads
Class WorkRequest

java.lang.Object
  extended bycommon.threads.WorkRequest

public final class WorkRequest
extends java.lang.Object

A work request to the thread pool. Allow other threads to wait until the "runnable" is finished.

Since:
CC 0.9.0
Author:
Marcelo Vanzin

Constructor Summary
WorkRequest(java.lang.Runnable work)
           
 
Method Summary
 java.lang.Exception getError()
          Returns any exception that was caught while running the request.
protected  java.lang.Runnable getRunnable()
           
 boolean isDone()
           
protected  void run()
           
 void waitFor()
          Waits until the running job is finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkRequest

public WorkRequest(java.lang.Runnable work)
Method Detail

waitFor

public void waitFor()
             throws java.lang.InterruptedException
Waits until the running job is finished.

Throws:
java.lang.InterruptedException

isDone

public boolean isDone()

getError

public java.lang.Exception getError()
Returns any exception that was caught while running the request.

Since:
CC 0.9.4

run

protected void run()

getRunnable

protected java.lang.Runnable getRunnable()