com.openexchange.admin.taskmanagement
Class ExtendedFutureTask<V>

java.lang.Object
  extended by java.util.concurrent.FutureTask<V>
      extended by com.openexchange.admin.taskmanagement.ExtendedFutureTask<V>
Type Parameters:
V -
All Implemented Interfaces:
Runnable, Future<V>, RunnableFuture<V>

public class ExtendedFutureTask<V>
extends FutureTask<V>

A FutureTask extented by Progress

Author:
d7

Constructor Summary
ExtendedFutureTask(Callable<V> callable, String typeofjob, String furtherinformation, int id)
           
 
Method Summary
 String getFurtherinformation()
           
 int getProgressPercentage()
          Gets the progress percentage of the underlying job
 String getTypeofjob()
           
 boolean isFailed()
          Convenience method for detecting if a job failed
 boolean isRunning()
          Convenience method for detecting if a job runs
 
Methods inherited from class java.util.concurrent.FutureTask
cancel, get, get, isCancelled, isDone, run
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedFutureTask

public ExtendedFutureTask(Callable<V> callable,
                          String typeofjob,
                          String furtherinformation,
                          int id)
Method Detail

isRunning

public boolean isRunning()
Convenience method for detecting if a job runs

Returns:

isFailed

public boolean isFailed()
Convenience method for detecting if a job failed

Returns:

getProgressPercentage

public int getProgressPercentage()
                          throws NoSuchMethodException
Gets the progress percentage of the underlying job

Returns:
The progress in percent
Throws:
NoSuchMethodException - If the job doesn't support this feature

getFurtherinformation

public final String getFurtherinformation()

getTypeofjob

public final String getTypeofjob()