Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.ide.task
Class TaskGroup

java.lang.Object
  extended by oracle.ide.task.Task
      extended by oracle.ide.task.TaskGroup

public class TaskGroup
extends Task

A TaskGroup is a specialized Task that is composed of one or more sub-tasks. Execution of TaskGroup results in execution of each individual Task The exact policy of handling failure of member Tasks is decided by the Task execution policy for a particular TaskGroup instance.


Field Summary
protected  int countDone
           
 
Fields inherited from class oracle.ide.task.Task
state, taskID
 
Constructor Summary
TaskGroup(java.lang.String implementorID, TaskGroupExecutionPolicy policy)
          Constructor for a taskGroup.
 
Method Summary
 void addTask(Task task)
          Adds a Task to the group, and throws exceptions if the TaskGroup is not in the appropriate state for addition to the group.
 int getCountDone()
          Retrieve the total count done so far, -which will be the cumulative count done so far.
 int getCountLeft()
          Retrieve the total count that is left of this task.
 int getCurrentTaskCount()
          The currently running task index
 java.lang.Object getResult()
          A TaskGroup is Task.
 int getTimeLeftSeconds()
          An estimate in seconds of the time left.
 int getTotalCount()
          A task implementor must provide a quantitative measure of the Task.
 int getTotalTaskCount()
          The total number of tasks in this group.
 TaskExitCode performTask(TaskMonitor ignore)
          A TaskGroups is also a Task, -this method implements the performTask method of the Task.
 
Methods inherited from class oracle.ide.task.Task
addTaskListener, getID, getListenerList, getNewTaskEvent, getShortName, getState, removeTaskListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

countDone

protected int countDone
Constructor Detail

TaskGroup

public TaskGroup(java.lang.String implementorID,
                 TaskGroupExecutionPolicy policy)
          throws TaskException
Constructor for a taskGroup.

Throws:
TaskException
Method Detail

getResult

public java.lang.Object getResult()
A TaskGroup is Task. This method is part of the Task requirement. Always returns null, as this Task has no results.

Specified by:
getResult in class Task
Returns:
T the result from the Task if any. The type is specified during the construction of the Task. The result can be null. It is up to the implementor to decide.

getCountLeft

public int getCountLeft()
Retrieve the total count that is left of this task. It will be the accumulation of the total counts of all sub-tasks.

Returns:
int total count left.

getCountDone

public int getCountDone()
Retrieve the total count done so far, -which will be the cumulative count done so far.

Returns:
int count that is done so far.

getTotalCount

public int getTotalCount()
Description copied from class: Task
A task implementor must provide a quantitative measure of the Task. This must be consistent with the task progress updates. The maximum progress must not exceed this number. This is provided via the constructor of the Task, viz., the maxProgress parameter. The count values for tasks that belong to a group should reflect the variation of time taken for each task. They should not all have the same value (unless that is the actually the case).

Overrides:
getTotalCount in class Task
Returns:
int declaration of the length of the task in counts.
See Also:
Task.getTotalCount()

getTimeLeftSeconds

public int getTimeLeftSeconds()
Description copied from class: Task
An estimate in seconds of the time left.

Specified by:
getTimeLeftSeconds in class Task
Returns:
int the number of seconds that are left for this task.
See Also:
Task.getTimeLeftSeconds()

getTotalTaskCount

public int getTotalTaskCount()
The total number of tasks in this group.

Returns:

getCurrentTaskCount

public int getCurrentTaskCount()
The currently running task index

Returns:
index of the currently running task.

addTask

public void addTask(Task task)
             throws TaskException
Adds a Task to the group, and throws exceptions if the TaskGroup is not in the appropriate state for addition to the group.

Parameters:
task - the task to add to this task group.
Throws:
TaskException

performTask

public final TaskExitCode performTask(TaskMonitor ignore)
                               throws java.lang.Exception
A TaskGroups is also a Task, -this method implements the performTask method of the Task.

Specified by:
performTask in class Task
Parameters:
ignore - 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.
Returns:
TaskExitCode the return value from the Task, an enumeration, indicating how the task ended. It is up to the implementor to return the correct value. The task manager will fire events based on this return value
Throws:
java.lang.Exception
See Also:
oracle.ide.task.Task#performTask(oracle.ide.task.TaskClientServices)

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.