|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.sape.carbon.services.threadpool.TaskInfoImpl
Besides supplying the functionality described by the TaskInfo interface, this implementation also is responsible for making callbacks using the TaskCallback interface if a callback has been specified. Copyright 2003 Sapient
| Field Summary | |
private TaskCallback |
callback
|
private org.apache.commons.logging.Log |
log
|
private TaskStatusEnum |
status
|
private Runnable |
task
|
private Throwable |
taskFailureCause
|
private String |
taskName
|
private String |
threadPoolName
|
| Constructor Summary | |
protected |
TaskInfoImpl(Runnable task,
String taskName,
TaskCallback callback,
String threadPoolName)
|
| Method Summary | |
private void |
callCallback(boolean success)
helper method that calls the callback |
Throwable |
getFailureCause()
Gets the cause of task failure. |
TaskStatusEnum |
getStatus()
Gets the task's status. |
Runnable |
getTask()
called by the DefaultThreadPoolImpl to get the task to execute |
String |
getTaskName()
Gets the name of the task as it was passed in to the ThreadPool.execute method. |
void |
setExecuting()
This method is called when a task begins execution. |
void |
setFailure(Throwable cause)
This method is called when a task fails. |
void |
setSuccess()
This method is called when a task succeeds. |
String |
toString()
|
void |
waitUntilExecuted()
Waits indefinitely for the task to complete. |
void |
waitUntilExecuted(long timeout)
Waits a given amout of time for the task to complete. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private org.apache.commons.logging.Log log
private Runnable task
private TaskStatusEnum status
private Throwable taskFailureCause
private String taskName
private String threadPoolName
private TaskCallback callback
| Constructor Detail |
protected TaskInfoImpl(Runnable task,
String taskName,
TaskCallback callback,
String threadPoolName)
| Method Detail |
public Throwable getFailureCause()
TaskInfo
getFailureCause in interface TaskInfopublic TaskStatusEnum getStatus()
TaskInfo
getStatus in interface TaskInfopublic String getTaskName()
TaskInfo
getTaskName in interface TaskInfo
public void waitUntilExecuted()
throws InterruptedException
TaskInfo
waitUntilExecuted in interface TaskInfoInterruptedException
public void waitUntilExecuted(long timeout)
throws InterruptedException
TaskInfo
waitUntilExecuted in interface TaskInfotimeout - timout in miliseconds
InterruptedExceptionpublic void setFailure(Throwable cause)
cause - public void setSuccess()
public void setExecuting()
public Runnable getTask()
public String toString()
toString in class Objectprivate void callCallback(boolean success)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||