This class uses the {@link Logger} namedcom.sun.jini.thread.TaskManager
to log information at the following logging levels:
Level | Description |
---|---|
{@link Level#SEVERE SEVERE} | failure to create a worker thread when no other worker threads exist |
{@link Level#WARNING WARNING} | exceptions thrown by {@link TaskManager.Task} methods, and failureto create a worker thread when other worker threads exist |
To get an instance of this class, use {@link #getInstance()}. This will check the "com.sun.jsft.TASK_MANAGER
" web.xml
context-param
to find the correct implementation to use. If not specified, it will use the {@link DefaultTaskManager}. Alternatively, you can invoke {@link setTaskManager(TaskManager)} directly to specify the desiredimplementation.
For all methods on TaskManager
, if the instance of Task
provided does not implement ManagedObject
then the TaskManager
will persist the Task
until it finishes. This provides durability, and is particularly convenient for simple tasks that the developer doesn't wish to manage and remove manually. However, if the Task
does implement ManagedObject
, then it's assumed that the Task
is already managed, and it is up to the developer to remove it from the DataManager
when finished.
If the instance of Task
provided to any of these methods is an instance of a class that has the RunWithNewIdentity
annotation then that task will be run with a new owning identity. Periodic tasks will use this same owning identity for all recurrences. In practical terms, this means that the system will be able to recognize these tasks as distinct behavior from other tasks in the system.
Note that there is no assumed ordering provided by implementations of this interface. If two tasks are scheduled in a given transaction, it is undefined which task will run or complete first. Likewise, if a task is scheduled and then a second scheduled in a later transaction, there is no guarantee that the task scheduled in the previous transaction will complete first. If any ordering or dependency is required, this should be implemented within the tasks themselves. @see AppContext#getTaskManager @see Task @see RunWithNewIdentity
Note that on the client, timer behaviour is somewhat dependant on browser behaviour. For example, the HTML 4 specification mandates that delays or intervals less than 10ms are silently increased to 10ms; HTML 5 lowers this minimum to 4ms. In addition, browsers such as Firefox and Chrome enforce a minimum timeout to 1000ms for pages in inactive tabs.
@author Mike Brock
@author Jonathan Fuerth
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|