|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.task.Task<T>
public abstract class Task<T>
A Task encapsulates the threading artifacts to provide a standardized interface for performing operations on a user thread. The TaskManager provides access to the Task during execution and also fires events on behalf of the task to indicate changes in State of the task. The client must implement the performTask() method where the lengthy task is executed. The return result is of genericised, and is up to the implementor to choose.
Field Summary | |
---|---|
protected TaskState |
state
|
protected TaskID |
taskID
|
Constructor Summary | |
---|---|
Task(java.lang.String implementorID,
int maxProgress)
The constructor for a Task. |
|
Task(java.lang.String implementorID,
java.lang.String userTaskID,
int maxProgress)
The constructor for a Task. |
Method Summary | |
---|---|
void |
addTaskListener(TaskListener tl)
Add a TaskListener to the this task. |
TaskID |
getID()
Retrieves the unique ID of the Task |
java.util.ArrayList<TaskListener> |
getListenerList()
Retrieve the listener list for this task |
TaskEvent |
getNewTaskEvent()
Get a new instance of TaskEvent. |
abstract T |
getResult()
If the task has produced aretrieveable result, this method will allow retrieval. |
java.lang.String |
getShortName()
Retrieves the implementor ID (not guranteed to be unique) It is expected to be meaningful to the implementor only. |
TaskState |
getState()
Retrieve the current state of the Task. |
abstract int |
getTimeLeftSeconds()
An estimate in seconds of the time left. |
int |
getTotalCount()
A task implementor must provide a quantitative measure of the Task. |
abstract TaskExitCode |
performTask(TaskMonitor tc)
This is the client method that will perform the actual work of this task. |
void |
removeTaskListener(TaskListener tl)
Remove a TaskListener from the this task. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TaskID taskID
protected TaskState state
Constructor Detail |
---|
public Task(java.lang.String implementorID, int maxProgress)
implementorID
- the client-chosen ID, no requirements from the Task API.maxProgress
- int count of the maximum progress 'count' for this
task. This is used for normalizing and firing taskUpdates for the
sub-tasks of this task. Must be equal or greater than 100.public Task(java.lang.String implementorID, java.lang.String userTaskID, int maxProgress) throws TaskException
implementorID
- the client-chosen ID, no requirements from the Task API.userTaskID
- the client-chosen ID, must be unique. Uniqueness to be assured
by the user.maxProgress
- int count of the maximum progress 'count' for this
task. This is used for normalizing and firing taskUpdates for the
sub-tasks of this task. Must be equal or greater than 100.
TaskException
Method Detail |
---|
public java.util.ArrayList<TaskListener> getListenerList()
public final void addTaskListener(TaskListener tl)
tl
- TaskListener which will be added to this taskpublic final void removeTaskListener(TaskListener tl)
tl
- TaskListener that will be removed from this taskpublic TaskID getID()
public java.lang.String getShortName()
public int getTotalCount()
public abstract int getTimeLeftSeconds()
public TaskEvent getNewTaskEvent()
public TaskState getState()
public abstract T getResult()
public abstract TaskExitCode performTask(TaskMonitor tc) throws java.lang.Exception
tc
- TaskMonitor this is the access point for the Task itself to
access the services which are offered, for example providing
progress update or acquaring locks etc.
java.lang.Exception
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |