|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.resources.Resource
com.sun.spot.service.TaskManager
public class TaskManager
TaskManager schedules and executes all current Tasks, including Conditions.
Please see the javadoc for Task for more details.
| Field Summary |
|---|
| Fields inherited from interface com.sun.spot.service.IService |
|---|
PAUSED, PAUSING, READY, RESUMING, RUNNING, STARTING, STOPPED, STOPPING |
| Constructor Summary | |
|---|---|
protected |
TaskManager()
|
| Method Summary | |
|---|---|
Task[] |
getAllTasks()
Return an array of all Tasks scheduled to be run. |
boolean |
getEnabled()
Return whether service is started automatically on reboot. |
static TaskManager |
getInstance()
Get the singleton instance of TaskManager. |
String |
getServiceName()
Return the name of this service. |
int |
getStatus()
Return the current status of this service. |
boolean |
isRunning()
Return whether the service is currently running. |
boolean |
pause()
Pause the service, and return whether successful. |
void |
removeAllTasks()
Remove all Tasks from the list of Tasks scheduled to be run. |
boolean |
resume()
Resume the service, and return whether successful. |
void |
run()
Internal method. |
static void |
schedule(Task t)
Schedule a Task to run. |
static void |
schedule(Task t,
long period)
Schedule a Task to run. |
void |
setEnabled(boolean enable)
Enable/disable whether service is started automatically. |
void |
setServiceName(String who)
Assign a name to this service. |
boolean |
start()
Start the service, and return whether successful. |
boolean |
stop()
Stop the service, and return whether successful. |
static void |
unschedule(Task t)
Remove a Task from the list of Tasks scheduled to be run. |
| Methods inherited from class com.sun.spot.resources.Resource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.spot.resources.IResource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Constructor Detail |
|---|
protected TaskManager()
| Method Detail |
|---|
public static TaskManager getInstance()
public static void schedule(Task t)
t - the Task to schedule
public static void schedule(Task t,
long period)
t - the Task to scheduleperiod - the amount of time (in milliseconds) that the schedule may be adjustedpublic static void unschedule(Task t)
t - the Task to removepublic void removeAllTasks()
public Task[] getAllTasks()
public void run()
run in interface RunnableThread.run()public boolean start()
IService
start in interface IServicepublic boolean stop()
IService
stop in interface IServicepublic boolean pause()
IService
pause in interface IServicepublic boolean resume()
IService
resume in interface IServicepublic int getStatus()
IService
getStatus in interface IServicepublic boolean isRunning()
IService
isRunning in interface IServicepublic String getServiceName()
IService
getServiceName in interface IServicepublic void setServiceName(String who)
IService
setServiceName in interface IServicewho - the name for this servicepublic boolean getEnabled()
IService
getEnabled in interface IServicepublic void setEnabled(boolean enable)
IService
setEnabled in interface IServiceenable - true if the service should be started automatically on reboot
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||