|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.surf.task.AbstractTask
public abstract class AbstractTask
Abstract implementation of a task which may be useful to developers who wish to write custom tasks.
Field Summary | |
---|---|
protected String |
creator
|
protected String |
description
|
protected Date |
endTime
|
protected List<String> |
history
|
protected String |
id
|
protected boolean |
isCancelled
|
protected boolean |
isError
|
protected boolean |
isFinished
|
protected boolean |
isRunning
|
protected boolean |
isSuccess
|
protected static org.apache.commons.logging.Log |
logger
|
protected String |
name
|
protected int |
progress
|
protected int |
progressSize
|
protected Date |
startTime
|
protected String |
status
|
protected Throwable |
throwable
|
Constructor Summary | |
---|---|
AbstractTask(String name)
Instantiates a new abstract task. |
Method Summary | |
---|---|
abstract void |
cancel()
Cancels the task |
abstract void |
execute()
Executes the task |
String |
getCreator()
Returns the creator of the task |
String |
getDescription()
Returns the description of the task |
Date |
getEndTime()
The end time of the task |
List<String> |
getHistory()
Full history of all status updates to the task |
String |
getId()
Returns the internal id of the task |
String |
getName()
Returns the name of the task |
int |
getProgress()
Returns how far the task has progressed down the progress bar. |
int |
getProgressSize()
Returns the total size of the progress bar. |
Date |
getStartTime()
The start time of the task |
String |
getStatus()
Current status of the task |
Throwable |
getThrowable()
If the task resulted in an error, retrieves the throwable obtained by the task worker thread. |
void |
increment()
Increments the progress |
boolean |
isCancelled()
Whether the task was cancelled |
boolean |
isError()
Whether the task resulted in an error |
boolean |
isFinished()
Whether the tasks completed |
boolean |
isRunning()
Whether the task is still running |
boolean |
isSuccess()
Whether the task completed successfully |
void |
setCreator(String creator)
Sets the creator of the task |
void |
setDescription(String description)
Sets a description for the task |
void |
setStatus(String status)
Sets the status |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log logger
protected boolean isError
protected boolean isSuccess
protected boolean isFinished
protected boolean isRunning
protected boolean isCancelled
protected Throwable throwable
protected String id
protected String name
protected String description
protected String status
protected int progress
protected int progressSize
protected List<String> history
protected String creator
protected Date startTime
protected Date endTime
Constructor Detail |
---|
public AbstractTask(String name)
name
- the nameMethod Detail |
---|
public void increment()
Task
increment
in interface Task
public String getId()
Task
getId
in interface Task
public String getName()
Task
getName
in interface Task
public void setDescription(String description)
Task
setDescription
in interface Task
public String getDescription()
Task
getDescription
in interface Task
public void setCreator(String creator)
Task
setCreator
in interface Task
public String getCreator()
Task
getCreator
in interface Task
public abstract void execute() throws Throwable
Task
execute
in interface Task
Throwable
public abstract void cancel()
Task
cancel
in interface Task
public boolean isError()
Task
isError
in interface Task
public boolean isSuccess()
Task
isSuccess
in interface Task
public boolean isFinished()
Task
isFinished
in interface Task
public boolean isRunning()
Task
isRunning
in interface Task
public boolean isCancelled()
Task
isCancelled
in interface Task
public Date getStartTime()
Task
getStartTime
in interface Task
public Date getEndTime()
Task
getEndTime
in interface Task
public Throwable getThrowable()
Task
getThrowable
in interface Task
public String getStatus()
Task
getStatus
in interface Task
public void setStatus(String status)
Task
setStatus
in interface Task
public int getProgress()
Task
getProgress
in interface Task
public int getProgressSize()
Task
getProgressSize
in interface Task
public List<String> getHistory()
Task
getHistory
in interface Task
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |