Java Reference
In-Depth Information
Figure 7-16.
The
ServiceExample
program after the task threw an exception
As you can see from the preceding screenshots, the number that is entered into the text field does indeed
influence the number of items processed in each run of the service, as is evidenced by the messages reflected in the UI
in the screenshots.
■
Because the task that is started with the JavaFX worker threading framework executes in background
threads, it is very important not to access any live scenes in the task code.
Caution
Understanding the
ScheduledService<V>
Abstract Class
The
ScheduledService<V>
abstract class extends the
Service<V>
abstract class, and provides repeated executions
of the tasks created by the service. The
ScheduledService<V>
class controls how its tasks are repeated through the
following properties:
delay
•
period
•
backOffStrategy
•
restartOnFailure
•
maximumFailureCount
•
currentFailureCount
•
cumulativePeriod
•
maximumCumulativePeriod
•
lastValue
•
Search WWH ::
Custom Search