public interface TaskManager
ManagerFactory
.Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(TaskListener theListener)
Adds a
TaskListener . |
Task |
getCurrentTask()
Returns an instance of the
Task the caller belongs to. |
java.util.List<Task> |
getTaskList(boolean includeSystem)
Returns a list of running and paused tasks.
|
boolean |
pauseTask(Task task)
Pauses given
Task . |
void |
removeStatusListener(TaskListener theListener)
Removes a
TaskListener . |
boolean |
resumeTask(Task task)
Resumes given
Task . |
boolean |
setForegroundTask(Task task)
Assign foreground task.
|
boolean |
setPriority(Task task,
TaskPriority priority)
Changes priority for given
Task . |
Task |
startTask(Suite suite,
java.lang.String className)
|
boolean |
stopTask(Task task)
Stops given
Task . |
java.util.List<Task> getTaskList(boolean includeSystem)
includeSystem
- indicates whether to include system task
into list.Task getCurrentTask()
Task
the caller belongs to.Task
Task startTask(Suite suite, java.lang.String className) throws java.lang.IllegalArgumentException, SuiteNotFoundException
Task
from given Suite
.
Throws an exception if suite
is a library and can therefore
not be started.
More than one call to this method can be performed for the same arguments. In this case subsequent calls lead to attempts to re-start the task (see the concurrency chapter for details. It is not guaranteed that this will be successful though.
suite
- the suite to start the task fromclassName
- the name of the class within the suite that is used to start
the application; this class MUST exist and MUST be derived from
MIDlet
Task
java.lang.IllegalArgumentException
- if the suite
argument is a
library, or if the specified class does not exist in the suite or
is not derived from MIDlet
SuiteNotFoundException
- if the suite cannot be foundboolean stopTask(Task task) throws java.lang.IllegalStateException
Task
.task
- the task to be stoppedtrue
if the task
was destroyedjava.lang.IllegalStateException
- in case the specified task has already been
stoppedboolean resumeTask(Task task) throws java.lang.IllegalStateException
Task
.
task
- the task to be resumedtask
was resumedjava.lang.IllegalStateException
- in case the specified task has already been
resumed or never been pausedboolean pauseTask(Task task) throws java.lang.IllegalStateException
Task
.
task
- the task to be pausedtask
was pausedjava.lang.IllegalStateException
- in case the specified task has already been
pausedboolean setForegroundTask(Task task)
A task is said to be in the foreground
If none of those packages is supported by the implementation, a call to this method has no effect.task
- the task to become foreground tasktrue
if task
was assigned as foreground,
otherwise false
boolean setPriority(Task task, TaskPriority priority) throws java.lang.IllegalArgumentException
Task
.task
- the task to change priority forpriority
- new prioritytrue
if priority has been changed successfully,
false
otherwisejava.lang.IllegalArgumentException
void addStatusListener(TaskListener theListener)
TaskListener
. Several listeners can be added, each of them
will be notified about task status changes.theListener
- TaskListener
to be addedvoid removeStatusListener(TaskListener theListener)
TaskListener
.theListener
- TaskListener
to be removedCopyright (c) 2013, Oracle and/or its affiliates. All Rights Reserved. Use of this specification is subject to license terms.