org.jasig.portal.utils.threading
Class RunnableTask

java.lang.Object
  extended by org.jasig.portal.utils.threading.BaseTask
      extended by org.jasig.portal.utils.threading.RunnableTask
All Implemented Interfaces:
java.lang.Runnable, Task

public class RunnableTask
extends BaseTask

This class exists as a convenience to execute Runnables. Although it may seem redundant, it is useful in that the superclass run() will appropriately catch and store Exceptions, so that callers need not worry about catching and handling them in their Runnable implementation.

Author:
Aaron Hamid (arh14 at cornell dot edu)

Field Summary
protected  java.lang.Runnable runnable
           
 
Fields inherited from class org.jasig.portal.utils.threading.BaseTask
exception
 
Constructor Summary
RunnableTask(java.lang.Runnable runnable)
          Constructs a RunnableTask with a Runnable object
 
Method Summary
 void execute()
          Simply calls the run() on the runnable that this RunnableTask was constructed with.
 
Methods inherited from class org.jasig.portal.utils.threading.BaseTask
getException, run, setException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

runnable

protected java.lang.Runnable runnable
Constructor Detail

RunnableTask

public RunnableTask(java.lang.Runnable runnable)
Constructs a RunnableTask with a Runnable object

Parameters:
runnable - a runnable implementation
Method Detail

execute

public void execute()
             throws java.lang.Exception
Simply calls the run() on the runnable that this RunnableTask was constructed with. BaseTask will catch and store any Exception the runnable, and hence this method, throws.

Specified by:
execute in class BaseTask
Throws:
java.lang.Exception