org.mmbase.applications.crontab
Class Interruptable

java.lang.Object
  extended by org.mmbase.applications.crontab.Interruptable
All Implemented Interfaces:
Runnable

public class Interruptable
extends Object
implements Runnable

A Runnable wich also has an 'interrupt' method. This only works well if the job does sleeps (InterruptedException) or check Thread.isInterrupted().

Since:
MMBase-1.8
Version:
$Id: Interruptable.java 42079 2010-05-03 09:06:58Z michiel $
Author:
Michiel Meeuwissen

Nested Class Summary
static interface Interruptable.CallBack
           
 
Constructor Summary
Interruptable(Runnable run, Collection<Interruptable> col)
           
Interruptable(Runnable run, Collection<Interruptable> col, Interruptable.CallBack s, Interruptable.CallBack r)
           
 
Method Summary
 int getId()
           
 Throwable getRunException()
           
 Date getStartTime()
           
 boolean interrupt()
           
 boolean isAlive()
           
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Interruptable

public Interruptable(Runnable run,
                     Collection<Interruptable> col)

Interruptable

public Interruptable(Runnable run,
                     Collection<Interruptable> col,
                     Interruptable.CallBack s,
                     Interruptable.CallBack r)
Parameters:
run - The runnable wrapped by this Interrupted, which is to be executed in run().
col - A modifiable collection or null If not null, this interruptable is added to it just before running, and removed from it just after running.
Method Detail

getId

public int getId()

run

public void run()
Specified by:
run in interface Runnable

interrupt

public boolean interrupt()

isAlive

public boolean isAlive()

getStartTime

public Date getStartTime()

getRunException

public Throwable getRunException()


MMBase 2.0-SNAPSHOT - null